Interest accrual
How the protocol tracks the accrual of interest.
Last updated
Was this helpful?
How the protocol tracks the accrual of interest.
Last updated
Was this helpful?
The and have been designed to simplify the calculation of interest-earning and interest-paying, even in multiple deposits or borrows, and avoid custom calculations for each user.
At the beginning the indexes are both set at value 1.
The following formulas have been designed to calculate the growth of the interest indexes, which considers the interests accrued, throughout the period from protocol beginning to the latest protocol state change.
Where:
represents the interest rate converted from annual percentage rate (APR) to second percentage rate:
represents the time interval between the latest psc () and the current time , in seconds.
Because of the limitation in the precision of on-chain calculation, uses a multiplier ฮต which is set as a number equal or slightly higher than 1. This ensures that the interest is not eroded by the limitation of on-chain math.