GM Interest Rate Model
Last updated
Last updated
The Lending Pool has an associated Interest Rate Model contract, which informs the interest rate attributed to the lending and borrowing of assets. On day one, USDC is the only asset that can be lent and borrowed. The initial Model establishes four key variables, which differ between assets. The values of these variables are subject to change in the future:
vertexUtilization
= 70e16
(70%)
minRate
= 10e16 / secondsInOneYear
(10% per annum)
vertexRate
= 25e16 / secondsInOneYear
(25% per annum)
maxRate
= 40e16 / secondsInOneYear
(40% per annum)
Note: secondsInOneYear
= 60 * 60 * 24 * (365 + (1/4))
// (accounting for leap years)
The Gloop Interest Rate Model follows a typical DeFi interest rate chart/curve (see image below), where utilization directly determines rates. Borrowers of USDC pay interest in USDC, based on the below borrow rate model. This interest paid turns into interest earned by the lenders of USDC. The Interest Rate steadily increases as the Utilization Rate increases. This model includes a utilization rate “kink” -- above this point, the interest rate increases more rapidly. Interest accrues every second.
The functions:
Calculates and returns the current borrow interest rate per second like so:
cash
uint256
The total amount of immediately available tokens (liquidity) for the asset
borrows
uint256
The total amount of outstanding borrows for the asset
Returns:
unnamed
uint256
The borrow rate per block, as a percentage, scaled by 1e18
Calculates and returns the current asset utilization rate. The function reverts if the utilization Rate is above 1e18
:
utilizationRate = borrows / (cash + borrows)
cash
uint256
The total amount of immediately available tokens (liquidity) for the asset
borrows
uint256
The total amount of outstanding borrows for the asset
Returns:
utilization
uint256
The current utilization rate of the asset
Calculates and returns the current borrow APY.
availableLiquidity
uint256
The total amount of available asset liquidity in the Lending Pool.
borrows
uint256
The total amount of outstanding borrows for the asset
Returns:
unnamed
uint256
The asset's borrow APY
Calculates the current borrow APY, where blockDelta
is the number of Arbitrum blocks in one year = 31,536,000 seconds per year * 4 = 126,144,000 blocks per year:
availableLiquidity
uint256
The total amount of immediately available liquidity for the asset
borrows
uint256
The total amount of outstanding borrows for the asset
Returns:
unnamed
uint256
The current borrow APY