Calculations

There are few important calculations in the lending pool that allows for handling interest accumulation:

  • interest accumulation - updates the reserve indexes that are used to accumulate each account interests.

  • account interest accumulation - accumulates an account interests

  • rate recalculation - recalculates the interest rates.

The other important calculation allows to check if an account's position is collateralized:

  • calculate lending power - calculates an account's position ability to borrow

Each lending action associated with an asset invokes the following actions on the data associated with an asset and account on behalf which the lending action is performed:

  1. interest accumulation

  2. account interest accumulation

  3. rate recalculation

  4. ( if an action results in reduction of an account lending power ) check if result of calculate lending power > 0

Note: All calculations' rounding should be in favor of the protocol.

Last updated