InterestRateModel
The InterestRateModel is the base interface that all interest rate model implementations must conform to within the Rheofi Protocol. It defines the standard methods for calculating borrow and supply rates used by RToken markets.
Overview
Every RToken market references an InterestRateModel to determine the current interest rates based on the utilization of the pool. Implementations of this interface compute rates as a function of cash, borrows, and reserves.
Key Functions
getBorrowRate
Returns the current per-block borrow interest rate for a market.
function getBorrowRate(
uint256 cash,
uint256 borrows,
uint256 reserves
) external view returns (uint256);
getSupplyRate
Returns the current per-block supply interest rate, accounting for the reserve factor.
function getSupplyRate(
uint256 cash,
uint256 borrows,
uint256 reserves,
uint256 reserveFactorMantissa
) external view returns (uint256);
isInterestRateModel
Indicator function that returns true to confirm the contract implements the InterestRateModel interface.
function isInterestRateModel() external view returns (bool);