Skip to main content
Reference · Interest Rate Models

InterestRateModel.

The base interface every interest-rate-model implementation must conform to. Defines the standard methods used by RToken markets to compute borrow and supply rates.

Overview

Every RToken market references an InterestRateModel to determine the current rates as a function of cash, borrows, and reserves. Implementations of this interface compute rates per block.

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 — returns true to confirm the contract implements the InterestRateModel interface.

function isInterestRateModel() external view returns (bool);