DeFi

Interest Rate Model

An interest rate model calculates borrow and supply rates from protocol state, usually utilization.

An interest rate model decides how expensive borrowing is and how much suppliers earn.

Interest Rate Model Explained in Detail

An interest rate model sets borrow and supply rates from protocol state. Many lending protocols use utilization: how much supplied liquidity has been borrowed.

Some models are kinked, meaning rates rise slowly below a target utilization and sharply above it.

Smart contract example

utilization = total borrows / (cash + total borrows - reserves)

The exact formula varies by protocol, but the rate curve converts utilization into borrow and supply rates.

Interest Rate Model in Auditing

Rate math affects debt growth, supplier yield, reserves, liquidations, and protocol solvency. A broken model can undercharge borrowers, overpay suppliers, or make a market unusable.

Auditors review rate formulas and the accrual paths that use them.

Red flags in code

  • Division by zero at zero liquidity.

  • Per-block and per-second rates are mixed.

  • Scaling is inconsistent between wad, ray, or 1e18 math.

  • Rates are non-monotonic or discontinuous at the kink.

  • Interest accrual is skipped before borrow, repay, liquidate, or withdraw.

How to test or review it

  • Test zero, low, target, high, and full utilization.

  • Check continuity around the kink.

  • Time-skip accrual over long periods.

  • Verify reserve factor and index updates.

  • Differential test the implementation against the published formula.

Sources