Section 3 of 18

Build
+15 Lynx

Interest Rate Model

Key takeaway: Compound V2's JumpRateModel produces a piecewise linear borrow rate curve with a kink at 80% utilization. Below the kink the rate climbs gently with the multiplier; above it the slope jumps sharply via the jumpMultiplier to discourage exhausting reserves. Real Compound USDC parameters: baseRate 2%, multiplier 20%, kink 80%, jumpMultiplier 200%. The 80% kink is also the protocol's implicit liquidity-buffer commitment to suppliers.

What You Are Building

The interest rate model determines how expensive it is to borrow and how much suppliers earn. Compound V2 uses the Jump Rate Model: a piecewise linear function with a "kink" that causes rates to spike when utilization gets too high. This section builds both the abstract InterestRateModel interface and the concrete JumpRateModel implementation.

This contract is standalone. It does not inherit from the math library because it uses raw uint256 arithmetic with explicit 1e18 scaling. The CToken calls it externally to get the current rates.

Your Code

Solution.sol
Solidity
Loading editor...

Requirements

Write your implementation, then click Run Tests. Tests execute on the server.

Sign up free — keep reading + earn 15 Lynx

Zealynx Academy is free. Track your progress, earn Lynx, and climb the leaderboard.

Sign up free to continue

Already have an account? Log in