Aave V3 liquidations

In this notebook we will analyse liquidation events events from Aave V3 to a Parquet file.

  • Run the script scipts/aave-v3/scan-liquidations.py to download the data

    • You need JSON RPC endpoints for the chains you want to scan

python scripts/aave-v3/scan-liquidations.py
Reading Aave liquidations data on Binance: 1 - 64,473,706: 100%|████████████████████████████████████████████████████████████████| 64473705/64473705 [00:39<00:00, 1622236.90it/s, At=2025-10-13 08:43:20, Liquidations=9,353]
Chain binance done, total liquidation rows now 9,353, file size is 1.58 MiB
Reading Aave liquidations data on Arbitrum: 1 - 389,080,336: 100%|███████████████████████████████████████████████████████████| 389080335/389080335 [01:22<00:00, 4738462.79it/s, At=2025-10-12 15:42:05, Liquidations=43,989]
Chain arbitrum done, total liquidation rows now 53,342, file size is 7.28 MiB
...

Setup

  • Setup chains and where do we store the results

[14]:
from pathlib import Path
import pandas as pd
from eth_defi.research.notebook import setup_charting_and_output, OutputMode

PARQUET_PATH = Path.home() / ".tradingstrategy" / "liquidations" / "aave-v3-liquidations.parquet"

assert PARQUET_PATH.exists(), f"Run the script scripts/aave-v3/scan-liquidations.py to create the file {PARQUET_PATH}"

# Initialise the data file if it does not exist
df = pd.read_parquet(PARQUET_PATH)


# Setup static rendering so we can display this notebook on Github
setup_charting_and_output(
    OutputMode.static,
    image_format="png",
    height=800,
)