Liquidity Snapshots

Availability

This collection is available for the Ethereum, Polygon, Arbitrum, and Base.

Methodology

The table is built by the following process:

  1. Identify all liquidity events emitted by supported DEX pools in a block

  2. Call the balanceOf method for each pair of (pool, ERC-20)

We currently support the following DEXes:

  • Uniswap V2

  • Uniswap V3

  • Curve

We extract data from any contract compatible with one of the above DEXes ABI.

It means that any DEXes that forked or tried to be compatible at the ABI level with these contracts will be indexed automatically.

Table Schema

Usage

The query below makes use of the defi_liquidity_snapshots_ethereum_mainnet_v1 to chart the daily average of liquidity for each token of the famous Curve 3Pool (0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7).

select
    date_trunc('day', timestamp) as date,
    avg(amounts['0x6b175474e89094c44da98b954eedeac495271d0f']) as dai_liquidity,
    avg(amounts['0xdac17f958d2ee523a2206206994597c13d831ec7']) as usdt_liquidity,
    avg(amounts['0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48']) as usdc_liquidity
from defi_liquidity_snapshots_ethereum_mainnet_v1
where contract = '0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7'
and timestamp >= now() - interval 30 day 
group by date

Last updated