The interest rate curve shows how borrow and supply APY change as pool utilization increases from 0% to 100%, where utilization represents the share of supplied liquidity that is borrowed.
Calculate Interest Rate Curve
Generate curve points showing APY at different utilization levels.1
Import Dependencies
2
Configure Market and Reserve
CHART_POINTS sets the chart resolution: 21 points is 0% to 100% utilization in 5% steps. The curve’s own points are always included, so its kinks aren’t skipped.3
Load Market and Reserve
4
Extract Borrow Curve Points
The curve is a list of (utilization, borrow rate) points in basis points, joined by straight lines. Its rates are APRs. The on-chain list has a fixed length, so repeated points at 100% are padding and are dropped.The reserve metrics history endpoint returns the same configured curve as
borrowCurve, without an RPC.5
Read the Rate Parameters
Borrowers pay the curve rate plus the reserve’s fixed host interest. Suppliers earn the curve rate on the borrowed share of the reserve, minus the protocol take rate.
6
Generate Curve Points
Calculate the borrow and supply APY at each utilization.getBorrowRate reads the borrow rate at any utilization from the curve. calculateAPYFromAPR compounds an APR into an APY.7
Compare with Current Rates
The table shows the borrow and supply APY across the curve, and the current rates show where the reserve sits on it. Plot the table with any charting library.
Understanding the Results
The curve shows how rates change with utilization:- Below the kink: rates rise slowly. For USDG the kink is at 95% utilization.
- Above the kink: rates rise sharply to pull in deposits and push borrowers to repay.
- Supply APY: always below borrow APY, because suppliers earn only on the borrowed share of the reserve, minus the protocol take rate.