Interest Rate Model
The contract that computes borrow and supply rates from a market's utilization. In Compound V2 and most of its forks, the model is piecewise linear with a kink at ~80% utilization, above which rates spike to deter further borrowing.
An Interest Rate Model in DeFi lending is the function that determines borrowing and supplying rates based on market conditions — primarily utilization (the ratio of borrowed to supplied assets). The model runs on every borrow, repay, supply, or redeem; its output determines what rate the market is currently offering.
The Compound V2 Design: Piecewise Linear With a Kink
The canonical rate model, used by Compound V2 and inherited by most of its forks:
1utilization = totalBorrows / (cash + totalBorrows - reserves)23If utilization <= kink:4 borrowRate = baseRate + (utilization * multiplier)5Else:6 borrowRate = baseRate + (kink * multiplier) + ((utilization - kink) * jumpMultiplier)78supplyRate = utilization * borrowRate * (1 - reserveFactor)
A typical parameterization:
baseRate= 0% (or a very small value)multiplier= 4% per yearkink= 80% utilizationjumpMultiplier= 100% per year
At 40% utilization: borrow rate ≈ 1.6% APR At 80% utilization (at kink): borrow rate ≈ 3.2% APR At 90% utilization: borrow rate ≈ 13.2% APR (jumped past the kink) At 99% utilization: borrow rate ≈ 22.2% APR
The steep rise past the kink is intentional. It deters further borrowing when the market is near-dry (preserving the last bit of liquidity for withdrawals) and incentivizes more supply (higher deposit rates attract lenders).
Why This Shape
The piecewise linear + kink shape is a compromise between several goals:
- Liquidity protection: the kink rises steeply so suppliers can always redeem — the protocol becomes painful to borrow from once liquidity gets scarce.
- Capital efficiency: below the kink, rates stay modest, so borrowers don't overpay in normal conditions.
- Self-balancing: if suppliers leave (lowering pool size), utilization rises, rates rise, new suppliers are attracted, supply normalizes.
Other model shapes exist (fully linear, curved, dynamic) but the piecewise-with-kink is the most widely deployed pattern because it's simple, parameterizable, and stable in practice.
Common Forks' Modifications
Forks of Compound V2 often modify the rate model:
- Different multipliers per market. Stablecoins might use lower rates (more stable demand), volatile assets might use higher rates.
- Different kink positions. Some forks kink at 70%, 85%, or other values.
- Tied to external factors. Canto v2 ties its rate model to its algorithmic stablecoin's deviation from peg, introducing dynamic feedback.
- Multiple rate curves per market. For supplier vs borrower asymmetry.
Each modification is a surface for bugs. Custom rate models that haven't been stress-tested in production can have edge cases at extreme utilization that the default model handled. The Shadow Arena in Zealynx Academy includes Canto v2 specifically because several of its documented bugs are in the custom rate model's interaction with the rest of the protocol.
Implementation Considerations
In the Compound V2 module, you implement the default rate model and can optionally experiment with custom variants. Common traps:
Precision. Rates are typically in "per-block" units scaled by a large factor (e.g., 1e18) to handle fractional percentages. Conversion between per-block and per-year rates requires care.
Overflow at extreme utilization. If utilization somehow exceeds 100% (shouldn't happen, but forks have introduced bugs that allow it), the rate calculation can overflow.
Division by zero. If cash + totalBorrows = 0 (empty market), utilization is undefined. Default to 0 or handle explicitly.
Gas. The rate model is called on every market interaction. Complex custom models can significantly increase gas per transaction.
Why It Matters
The rate model determines the economics of the lending market. Get it wrong and suppliers abandon (rates too low), borrowers abandon (rates too high), or the market becomes unstable (wrong feedback dynamics). Get it right and the market self-balances through normal operation.
This is why builders who ship lending protocols spend serious effort on rate model design — and why auditors who review lending protocols check the rate model's edge cases carefully.
Articles Using This Term
Learn more about Interest Rate Model in these articles:
Related Terms
Compound (V2)
Compound Finance V2, the canonical pooled-liquidity lending protocol in DeFi, launched in 2019. The most-forked lending contract ever shipped. Composed of cToken contracts, a Comptroller for cross-market policy, an Interest Rate Model, and a price oracle.
cToken
An ERC-20 token representing a user's share of a Compound V2 lending market. Supplying USDC to Compound mints cUSDC. As the pool earns interest, the cToken's exchange rate grows, so each cToken represents more underlying over time.
Collateral Factor
The percentage of a collateral asset's value that can be borrowed against in a pooled-liquidity lending protocol like Compound V2. Set per market by governance. A 75% collateral factor on ETH means users can borrow up to 75% of their ETH collateral's value.
Need expert guidance on Interest Rate Model?
Our team at Zealynx has deep expertise in blockchain security and DeFi protocols. Whether you need an audit or consultation, we're here to help.
Get a Quote