Skip to main content

Historical DeFi data API client: per-block, point-in-time contract state as pandas DataFrames. Aave rates, Uniswap prices, USDC supply, aligned onto one time axis.

Project description

defipipe: historical DeFi data API, per block, as pandas DataFrames

What read functions actually returned at every Ethereum block: Aave borrow rates, Uniswap slot0 prices, USDC total supply. Reconstructed historically, indexed live, and aligned onto one clean time axis.

Most DeFi data is built from events. defipipe serves state: the result of calling a contract's read functions at a specific block. If you need to know what the Aave WETH borrow rate actually was at block 19,000,000, not an hourly average from a dashboard, this is the API for it.

Install

pip install defipipe

Five lines to an aligned DataFrame

from defipipe import Client

df = Client().aligned([
    "eth:aave:v3:0x87870bca3f3fd6335c3f4ce8392d69350b4fa4e2/weth:call:getreservedata[currentvariableborrowrate]",
    "eth:lido:v2:0xae7ab96520de3a18e5e111b5eaab095312d7fe84:call:gettotalpooledether",
], freq="1h", since="2026-07-07", until="2026-07-12")

df.corr()

No API key needed for recent data at hourly bars. Full history and per-block granularity: get a key at https://defipipe.io/pricing and set DEFIPIPE_API_KEY (or pass api_key=).

Why quants use this

  • Point-in-time correctness. Every value is the last observation at or before each interval boundary, resolved through the block↔timestamp map. No interpolation, no lookahead bias: safe for backtests.
  • Exact raw values. client.series(id) returns value_raw as the exact on-chain string (uint256-safe) alongside the unit-scaled float.
  • One key for everything. Canonical series IDs ({chain}:{protocol}:{version}:{instance}[/{scope}]:{kind}:{metric}) name every series across protocols; browse them at https://defipipe.io/datasets.
  • Per-block granularity back to each pool's deployment, from our own archive node, not sampled snapshots.

Raw per-block rows

raw = Client(api_key="dp_...").series(
    "eth:uniswap:v3:0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640:call:slot0[sqrtpricex96]",
    since="2026-07-11", until="2026-07-12",
)
raw.head()  # block_number → ts, value_raw, value

Coverage

Aave V3, Uniswap V3, Lido today; Morpho, GMX V2, Uniswap V4, Ethena, Maple next. Request a pool at https://defipipe.io/feature-requests; approved requests ship with full backfilled history.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

defipipe-0.2.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

defipipe-0.2.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file defipipe-0.2.0.tar.gz.

File metadata

  • Download URL: defipipe-0.2.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for defipipe-0.2.0.tar.gz
Algorithm Hash digest
SHA256 644150dcc98df33de94a3decefe56de810ae4f8c6b04b44753daa082b21028fc
MD5 6dc7beb18ec6c43034952c32068564ee
BLAKE2b-256 53f25cd3d2bf120e7027984e888c79d78a547feb32192588880059be3ea18f5e

See more details on using hashes here.

File details

Details for the file defipipe-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: defipipe-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for defipipe-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a9ed7d22bf338780bfe7f4470cba86380195fb0a55d7bd7e841b65a75674ee6f
MD5 ab3677a34dd412a0b86dbebeb4e21f02
BLAKE2b-256 aec139f46c6aed85a3e3cf1d59f28c9a43d81b1e02f0e955e553c53734068743

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page