Aave Interest Rate Model: DeFi Dynamic Rate Engine
Table of Contents
Table of Contents
Share

How Aave calculates DeFi interest rates using RAY precision and a kinked two-slope model. Solidity implementation, Foundry tests, and 2025 rate benchmarks.
Frequently Asked Questions
- RAY precision is a 27-decimal fixed-point format (1e27) Aave uses for all interest rate calculations. It eliminates rounding errors that would accumulate in high-frequency compound interest math across millions of positions. Any integration that passes non-RAY values into Aave rate functions will silently produce incorrect borrow and supply rates.
- Aave applies a gentle slope (Slope1) when utilization is below the optimal target. Once utilization crosses that threshold, a steep Slope2 kicks in to sharply raise borrow costs, discouraging further draws and protecting depositor liquidity. The kink point is the boundary between these two regimes. (Aave V3 Risk Parameters, July 2025)
- The reserve factor is the share of gross borrow interest Aave routes to its DAO treasury instead of distributing to depositors. Typical values are in the ten-to-twenty-five percent range depending on asset risk. A higher reserve factor reduces the supply rate while keeping the borrow rate unchanged, widening the spread between what borrowers pay and what lenders earn.
- Fork mainnet at a specific block using vm.createFork, then call the deployed DefaultReserveInterestRateStrategy directly with controlled totalBorrowed and totalAvailable inputs. Assert that your local implementation matches Aave's on-chain output to within 1 RAY unit (1e0 tolerance). Use forge coverage to confirm all three utilization regimes are exercised: below optimal, at optimal, and above optimal.
- The three most common mistakes are: passing percentage values as plain integers instead of converting them to RAY format first, using integer division before RAY multiplication which floors precision early, and ignoring the reserve factor when estimating net supply yield for depositors. Each mistake produces an incorrect rate silently with no revert.
Don't Miss What's Next
Subscribe to newsletter
Aave
DeFi Lending
Interest Rate Model
Solidity
RAY Precision
Smart Contracts
Get in Touch
Our team will get back to you within 24 hours.


















