Interest
Last updated
Last updated
Inherits: , Ownable
Implementation of the IInterestRateModel interface for calculating interest rates
The approximate number of blocks per year that is assumed by the interest rate model
The multiplier of utilization rate that gives the slope of the interest rate
The base interest rate which is the y-intercept when utilization rate is 0
The multiplierPerBlock after hitting a specified utilization point
The utilization point at which the jump multiplier is applied
A name for user-friendliness, e.g. WBTC
Construct an interest rate model
Parameters
blocksPerYear_
uint256
The estimated number of blocks per year
baseRatePerYear
uint256
The base APR, scaled by 1e18
multiplierPerYear
uint256
The rate increase in interest wrt utilization, scaled by 1e18
jumpMultiplierPerYear
uint256
The multiplier per block after utilization point
kink_
uint256
The utilization point where the jump multiplier applies
owner_
address
The owner of the contract
name_
string
A user-friendly name for the contract
Update the parameters of the interest rate model (only callable by owner, i.e. Timelock)
Parameters
baseRatePerYear
uint256
The approximate target base APR, as a mantissa (scaled by 1e18)
multiplierPerYear
uint256
The rate of increase in interest rate wrt utilization (scaled by 1e18)
jumpMultiplierPerYear
uint256
The multiplierPerBlock after hitting a specified utilization point
kink_
uint256
The utilization point at which the jump multiplier is applied
Updates the blocksPerYear in order to make interest calculations simpler
Parameters
blocksPerYear_
uint256
The new estimated eth blocks per year.
Should return true
Calculates the utilization rate of the market
Parameters
cash
uint256
The total cash in the market
borrows
uint256
The total borrows in the market
reserves
uint256
The total reserves in the market
Returns
<none>
uint256
The utilization rate as a mantissa between [0, 1e18]
Returns the current borrow rate per block for the market
Parameters
cash
uint256
The total cash in the market
borrows
uint256
The total borrows in the market
reserves
uint256
The total reserves in the market
Returns
<none>
uint256
The current borrow rate per block, scaled by 1e18
Returns the current supply rate per block for the market
Parameters
cash
uint256
The total cash in the market
borrows
uint256
The total borrows in the market
reserves
uint256
The total reserves in the market
reserveFactorMantissa
uint256
The current reserve factor for the market
Returns
<none>
uint256
The current supply rate per block, scaled by 1e18
Internal function to update the parameters of the interest rate model
Parameters
baseRatePerYear
uint256
The base APR, scaled by 1e18
multiplierPerYear
uint256
The rate increase wrt utilization, scaled by 1e18
jumpMultiplierPerYear
uint256
The multiplier per block after utilization point
kink_
uint256
The utilization point where the jump multiplier applies