Aavescan logo Aavescan

Live and historical data for Aave

How to Calculate Historical Interest Rates on Aave

A guide for researchers, borrowers and depositors. Learn how to track DeFi APRs and APYs.

Aavescan Insights - Published 07.11.2022, Edited 10.04.2026

Why Calculate Historical Interest Rates?

If you're lending, borrowing or researching onchain lending platforms like Aave, Morpho or Euler, understanding how to calculate historical interest rates is key to seeing how interest accumulates over time and comparing onchain venues with traditional benchmarks.

Onchain lending rates can be highly volatile, changing every minute, and different approaches to gathering historical data can produce different results. This article explains how to calculate historical lending rates with precision.

Two Ways to Calculate DeFi Interest Rates

1. Use Historical APR Snapshots

A simple method for tracking historical interest rates is to take regular snapshots, daily or hourly, of the APR values quoted by smart contracts such as Aave’s currentVariableBorrowRate and drawnRate.

Snapshot figures represent APRs at specific points in time and can be used to understand broad trends in lending rates. However, these figures can be skewed by volatility between the snapshot timestamps and do not account for intraday fluctuations or compounding effects.

Quoted APR snapshots miss movement between observations Volatile rate path with periodic snapshots high APR mid APR low APR snapshot snapshot snapshot snapshot snapshot time
The blue line shows a volatile interest rate while the vertical markers show snapshots. Snapshots can miss intraday changes between the observed points.

2. Use the Interest Index

A precise method for calculating historical interest rates is to track the growth of the interest index. The interest index is a number that increases continuously to reflect accumulated interest.

By comparing the index values at two different dates, you can calculate the interest that has accrued, i.e. the interest earned or owed, while accounting for compounding and, in some cases, additional sources of income such as flash loan fees.

Index Borrow index Example market 1.0000 1.0180 1.0360 1.0540 1.0720 1.0900 launch month 6 month 12 month 18 month 24 now
The chart shows an example borrow index. The index starts at 1 and increases with accrued interest, reflecting the total amount of interest that has accumulated over time.

In Aave V2 and V3, the liquidityIndex tracks deposit interest and the variableBorrowIndex tracks borrow interest. In Aave V4, the analogous measures include the supplied/shares ratio for deposits (similar to ERC-4626 vault assets/shares ratio) and drawnIndex for borrows.

Aavescan Pro datasets include supplyIndex, borrowIndex, supplyApr24h and borrowApr24h. The 24h rates are derived from historical index growth, providing an accurate measure that captures intraday interest fluctuations.

Calculating Interest Rates Using the Index

Compare the index values from two snapshots to calculate the actual interest accrued during that period. This is a precise method for calculating historical interest rates.

// 1. Get supplyIndex values
snapshotNow = currentSnapshot.supplyIndex
snapshot24hAgo = previousSnapshot.supplyIndex

// 2. Compute daily growth
growth = snapshotNow / snapshot24hAgo

// 3. Convert to APR
depositApr = (growth - 1) * 365

// 4. Annualise to APY
depositApy = Math.pow(growth, 365) - 1

This rate reflects the actual interest accrued over the past 24 hours.

Aave Interest Technical Details

The amount of interest earned by lenders and paid by borrowers depends on lending rates, compounding frequency and extra rewards such as flash loan fees.

In Aave V2 and V3, borrow interest compounds every second while deposit interest compounds when the market is updated, typically when users interact with it. Depositors also receive additional yield from flash loan fees.

Rates example

The chart below illustrates how APY calculations can differ depending on how blockchain data is interpreted. This is especially pronounced in Compound V2 market data, where rates are quoted on a per-block basis.

Compound USDC APR comparison
The chart shows three different APY calculations for the Compound V2 USDC market using different measures.

Special thanks to @samlafer for insights in this Twitter thread and to Robert L. in Compound’s Discord.

Read More

Aavescan Dataset Guide
Guide to the Aavescan dataset for Aave historical data, CSV exports, interest rates, utilization, and market data analysis.
Aave Interest Rates History
Exploring major events in the history of Aave interest rates including the USDC depeg, ETH PoW fork and sUSDe looping
DeFi Strategies
Learn how Aave is used by investors and traders to maximise yields, leverage and hedge exposure