AAVE V3 (DeFi Lending)

AAVE is a decentralized lending protocol where users can deposit assets to earn interest or borrow against their collateral.

Supported Networks: ETH, POLYGON, AVAX, ARB, OP, BASE, GNOSIS, SCROLL, BSC, ZK, LINEA

Parameters:

ParameterTypeRequiredDescription
eth_market_typestringNo (ETH only)Market type: Core, Prime, or EtherFi (default: Core)
involvingstringNoFilter by address involved in the event (e.g., user, on_behalf_of)
involving_labelstringNoFilter where any involved address matches a label substring (e.g., Binance). Mutually exclusive with involving.
involving_categorystringNoFilter where any involved address matches a category (e.g., exchange). Mutually exclusive with involving.

Event Types:

Deposit

Users supply assets to the protocol to earn interest.

Endpoint: GET /v1/aave_v3/events/deposit

curl -H "X-API-Key: $API_KEY" 
  "https://api.defistream.dev/v1/aave_v3/events/deposit?network=ETH&block_start=24000000&block_end=24010000"

Example Data:

block_numberusertokenamounton_behalf_ofreferral_codetime
240000050x1691…9142USDE51.950x1691…914202025-12-13T00:07:11Z
240000110x5695…0149PYUSD81493924.640x5695…014902025-12-13T00:08:23Z
240000120x326f…51c4WBTC0.00740x326f…51c402025-12-13T00:08:35Z
240000170xd4fa…23eUSDC19804.270xd4fa…23e02025-12-13T00:09:35Z
240000170xd016…722WETH5.750xc7e8…3ac002025-12-13T00:09:35Z

Withdraw

Users remove their supplied assets from the protocol.

Endpoint: GET /v1/aave_v3/events/withdraw

curl -H "X-API-Key: $API_KEY" 
  "https://api.defistream.dev/v1/aave_v3/events/withdraw?network=ETH&block_start=24000000&block_end=24010000"

Example Data:

block_numberusertokenamountrecipienttime
240000120xd2da…77a0PYUSD15000.00xd2da…77a02025-12-13T00:08:35Z
240000170x7bc3…3af8USDT19798.040xb817…a162025-12-13T00:09:35Z
240000200x2b81…ca37e0USDT96.720xa946…f192025-12-13T00:10:11Z
240000200x2b81…ca37e0USDT189554.860x356b…ba7d2025-12-13T00:10:11Z
240000260x1f2f…f387WBTC0.02640x1f2f…f3872025-12-13T00:11:23Z

Borrow

Users take out loans using their deposited assets as collateral.

Endpoint: GET /v1/aave_v3/events/borrow

curl -H "X-API-Key: $API_KEY" 
  "https://api.defistream.dev/v1/aave_v3/events/borrow?network=ETH&block_start=24000000&block_end=24010000"

Example Data:

block_numberusertokenamounton_behalf_ofinterest_rate_modeborrow_ratetime
240000010xd016…722WETH400.00xf833…37620.01972025-12-13T00:06:23Z
240000010x531e…6e9fUSDE392362.00x531e…6e9f20.03592025-12-13T00:06:23Z
240000060xc564…1aeaUSDC150.00xc564…1aea20.04842025-12-13T00:07:23Z
240000120x8921…409bUSDC10000.00x8921…409b20.04842025-12-13T00:08:35Z
240000260x1f2f…f387CRVUSD1742.030x1f2f…f38720.05452025-12-13T00:11:23Z

Repay

Users pay back their borrowed amounts.

Endpoint: GET /v1/aave_v3/events/repay

curl -H "X-API-Key: $API_KEY" 
  "https://api.defistream.dev/v1/aave_v3/events/repay?network=ETH&block_start=24000000&block_end=24100000"

Example Data:

block_numberusertokenamountrepayeruse_a_tokenstime
240000450x7a3d…8e21USDC5000.00x7a3d…8e21false2025-12-13T00:15:23Z
240001120x9b4c…2f78WETH2.50x9b4c…2f78false2025-12-13T00:28:47Z
240002980x6c8e…4a92DAI15000.00x6c8e…4a92false2025-12-13T01:05:35Z

Flash Loan

Instant uncollateralized loans that must be repaid within the same transaction. Used for arbitrage, collateral swaps, and liquidations.

Endpoint: GET /v1/aave_v3/events/flashloan

curl -H "X-API-Key: $API_KEY" 
  "https://api.defistream.dev/v1/aave_v3/events/flashloan?network=ETH&block_start=24000000&block_end=24100000"

Example Data:

block_numberinitiatortokenamountpremiumtargettime
240051230x3a7b…9c42WETH1000.00.90x8f2e…4d912025-12-13T18:42:11Z
240084560x6d2f…8a73USDC500000.0450.00x1b9c…7e282025-12-14T05:18:35Z

Liquidation

When a borrower’s collateral value falls below the liquidation threshold, liquidators can repay part of the debt and receive discounted collateral.

Endpoint: GET /v1/aave_v3/events/liquidation

curl -H "X-API-Key: $API_KEY" 
  "https://api.defistream.dev/v1/aave_v3/events/liquidation?network=ETH&block_start=24000000&block_end=24100000"

Example Data:

block_numberownerliquidatordebt_tokencollateral_tokendebt_to_coverliquidated_collateraltime
240106230x07a4…4bc0xa645…868USDTWBTC26087.450.3062025-12-14T11:43:59Z
240106330x26f7…7260x193e…846USDECBBTC2.240.00002682025-12-14T11:45:59Z
240106330xeace…d4f0x193e…846USDCWETH3.060.001042025-12-14T11:45:59Z
240138490x589a…9ab0x193e…846USDCWBTC54.120.0006432025-12-14T22:32:35Z
240140770x0c94…0930x193e…846USDCLINK15.101.212025-12-14T23:18:23Z

Example: AAVE Prime Market on Ethereum

curl -H "X-API-Key: $API_KEY" 
  "https://api.defistream.dev/v1/aave_v3/events/deposit?network=ETH&block_start=24000000&block_end=24010000&eth_market_type=Prime"

Example: AAVE deposits involving exchange addresses

curl -H "X-API-Key: $API_KEY" 
  "https://api.defistream.dev/v1/aave_v3/events/deposit?network=ETH&block_start=24000000&block_end=24010000&involving_category=exchange"

Aggregate Queries

Bucket AAVE events into time or block intervals with summary statistics.

Endpoint: GET /v1/aave_v3/events/{event_type}/aggregate

Requires group_by (time or block_number) and period (e.g., 2h, 1d, 10000).

Aggregatable event types: deposit (agg_amount, agg_value_usd*), withdraw (agg_amount, agg_value_usd*), borrow (agg_amount, mean_borrow_rate, agg_value_usd*), repay (agg_amount, agg_value_usd*), flashloan (agg_amount, agg_value_usd*), liquidation (agg_debt_to_cover, agg_liquidated_collateral_amount, agg_value_usd*)

* agg_value_usd is only present when with_value=true is passed in the request.

Example: Hourly deposit volume

curl -H "X-API-Key: $API_KEY" 
  "https://api.defistream.dev/v1/aave_v3/events/deposit/aggregate?network=ETH&block_start=21000000&block_end=21100000&group_by=time&period=1h"

Sample Aggregate Results (deposit):

time_starttime_endagg_amountcount
2024-11-08T00:00:00Z2024-11-08T01:00:00Z2841952.1887
2024-11-08T01:00:00Z2024-11-08T02:00:00Z1523048.7462
2024-11-08T02:00:00Z2024-11-08T03:00:00Z984215.3341
2024-11-08T03:00:00Z2024-11-08T04:00:00Z1205683.9153
2024-11-08T04:00:00Z2024-11-08T05:00:00Z1892047.5671

Sample Aggregate Results (borrow):

time_starttime_endagg_amountmean_borrow_ratecount
2024-11-08T00:00:00Z2024-11-08T01:00:00Z1245820.450.041234
2024-11-08T01:00:00Z2024-11-08T02:00:00Z892104.180.039828
2024-11-08T02:00:00Z2024-11-08T03:00:00Z534291.670.042519

Quota & Limits

AAVE V3 endpoints use a block-based quota model. Cost formula: max(100, round(block_range × network_discount × aggregate_discount)).

FormatMax time rangeMax block rangeQuota cost
JSON31 days10,000block_range (min 100)
CSV / Parquet31 days10,000,000block_range (min 100)
CSV / Parquet (ARB)31 days10,000,000block_range × 0.2 (min 100)
Aggregate31 dayssame as aboveblock_range × 0.5 (min 100)

Check response headers X-RateLimit-Remaining and X-Request-Cost to monitor usage.