Links

Interest Rate Models

Interest Rate Models are a critical part of any Market Pool. It is essentially a smart-contract that decides the Interest Rate to be paid, per block, for supplying or borrowing an asset based on the utilisation ratio of the pool.
Each asset can have a different Interest Rate Model, based on the kind of asset it is and how volatile and precious that particular asset it is.
The interesting thing about Market's Interest Rate Model is that you can customise it as much as you want, from jump-rate to fixed interest to custom logic, we support it all.

Some Important Terms

BaseRatePerYear

The approximate target base APR of the model at zero utilisation ratio

MultiplierPerYear

The rate of increase in interest rate with respect to the utilisation ratio, when utilisation ratio is lower than the kink

JumpMultiplierPerYear

The rate of increase in interest rate with respect to the utilisation ratio, when utilisation ratio is lower than the kink

Kink

The utilisation point beyond which the jump multiplier is applied

Roof

The utilisation ratio after which the borrow rate is fixed. Beyond this utilisation ratio, the interest rate is evaluated assuming utilisation ratio is that defined by the roof.

BlocksPerYear

The approximate number of blocks per year that is assumed by the interest rate model

APY Calculation

SupplyRate/BorrowRate calculation by an IRM (integers scaled appropriately)
const supplyRate = mToken.methods.supplyRatePerBlock().call();
const mantissa = 1e18;
const blocksPerYear = 15768000; // each chain has it's own blocks per year
const blocksPerDay = Math.floor(blocksPerYear / 365);
​
const APY =
(Math.pow((supplyRate/mantissa) * blocksPerDay + 1, 365) - 1) * 100;
​