RateModel contract computes the borrow rate per second for a given pool utilization. It is called by every LendingPool during update_state() to determine how much interest has accrued since the last update.
Testnet address: CCJAUPCU6EIFQK6GTAAYLW3Y4YETJAAUPAGBPFGQ2OUJPSW3WWHUCL2Z
Functions
get_utilisation_ratio
| Parameter | Type | Description |
|---|---|---|
liquidity_wad | U256 | Pool’s available liquidity in WAD |
borrows_wad | U256 | Total outstanding borrows in WAD |
liquidity_wad and borrows_wad are zero, returns 0 (empty pool, 0% utilization).
get_borrow_rate_per_sec
| Coefficient | WAD Value | Decimal |
|---|---|---|
c1 | 10^17 | 0.1 |
c2 | 3 × 10^17 | 0.3 |
c3 | 35 × 10^17 | 3.5 |
SECS_PER_YEAR to get the annual rate.
Rate Curve Behavior
The polynomial curve produces the following behavior:| Utilization | Approximate Annual Rate |
|---|---|
| 0% | ~0% |
| 20% | ~7% |
| 50% | ~18% |
| 70% | ~35% |
| 80% | ~60% |
| 90% | ~150% |
| 95% | ~300%+ |
util^32 and util^64 terms are nearly zero at low utilization but dominate at high utilization, creating a sharp increase in rates as the pool approaches full capacity. This is intentional — high rates at high utilization attract new deposits and incentivize repayments.
Exponentiation
Theutil^32 and util^64 terms are computed via rpow_wad(util, n), which uses repeated squaring (exponentiation by squaring) in WAD arithmetic:
Constants
| Constant | Value |
|---|---|
WAD_U128 | 10^18 |
C1 | 10^17 (= 0.1) |
C2 | 3 × 10^17 (= 0.3) |
C3 | 35 × 10^17 (= 3.5) |
SECS_PER_YEAR | 31,556,952 × 10^18 |
Error Codes
Calling Pattern
LendingPools call the RateModel on everyupdate_state():
Related
- Math Reference — full formula derivation
- Lending Pools —
update_state()integration - Interest Rate Model — user-facing explanation of the curve shape

