GM Interest Rate Model
Last updated
Last updated
Each GM token has an associated Interest Rate Model contract, which informs the percent interest attributed to the lending and borrowing of the token. It establishes four key variables, which differ between assets:
vertexUtilization
minRate
vertexRate
maxRate
The gLoop interest rate models follow a typical DeFi interest rate chart/curve (see image below), where utilization directly determines rates. Lenders of a GM asset earn interest, denominated in the base asset, based on a supply rate model. Borrowers of a GM asset pay interest in USDC, based on a borrow rate model. The models include a utilization rate “kink” -- above this point, the interest rate increases more rapidly. Interest accrues every block by using the block.number
Ethereum Virtual Machine primitive.
The functions:
Calculates and returns the current borrow interest rate per block:
cash
uint256
The total amount of asset in cash (?)
borrows
uint256
The total amount of asset borrows
reserves
uint256
The total amount of asset reserves
Returns:
unnamed
uint256
The borrow rate per block, as a percentage and scaled by 1e18
Calculates and returns the current supply interest rate per block:
cash
uint256
The total amount of asset in cash (?)
borrows
uint256
The total amount of asset borrows
reserves
uint256
The total amount of asset reserves
Returns:
unnamed
uint256
The supply rate per block (as a percentage, and scaled by 1e18)
Calculates and returns the current asset utilization rate:
utilizationRate = borrows / (cash - reserves)
cash
uint256
The total amount of the asset in cash (?)
borrows
uint256
The total amount of outstanding borrows for the asset
reserves
uint256
The total amount of reserves of the asset
Returns:
unnamed
uint256
The current utilization rate of the asset