InterestRateModel
Given supply and demand values, the InterestRateModel is queried to calculate and return both fixed and variable rates. Contains parameters as state variables that are used to get the different points in the utilization curve for an asset. There's one InterestRateModel contract per enabled asset.
Public State Variables
fixedCurveA
Scale factor of the fixed curve.
fixedCurveB
Origin intercept of the fixed curve.
fixedMaxUtilization
Asymptote of the fixed curve.
floatingCurveA
Scale factor of the floating curve.
floatingCurveB
Origin intercept of the floating curve.
floatingMaxUtilization
Asymptote of the floating curve.
View Methods
fixedBorrowRate
Gets the rate to borrow a certain amount at a certain maturity with supply/demand values in the fixed rate pool and assets from the backup supplier.
Parameters
maturity
uint256
maturity date for calculating days left to maturity.
amount
uint256
the current borrow's amount.
borrowed
uint256
ex-ante amount borrowed from this fixed rate pool.
supplied
uint256
deposits in the fixed rate pool.
backupAssets
uint256
backup supplier assets.
Returns
uint256
rate of the fee that the borrower will have to pay (represented with 18 decimals).
floatingBorrowRate
Returns the interest rate integral from utilizationBefore to utilizationAfter.
Minimum and maximum checks to avoid negative rate.
Parameters
utilizationBefore
uint256
ex-ante utilization rate, with 18 decimals precision.
utilizationAfter
uint256
ex-post utilization rate, with 18 decimals precision.
Returns
uint256
the interest rate, with 18 decimals precision.
Last updated