Skip to main content

Start querying Uniswap v4 instantly

Uniswap v4 data on Base is already indexed and ready to use on Ormi. With a free developer account, you can start querying protocol data right away - no setup, no credit card required. Start free.

Go to the 0xGraph page and click on the URL icon

0xGraph graph init

Open GraphiQL Explorer

0xGraph graph init

Introspect the schema

After opening the Explorer, you’ll be able to see available entites, for example pool, swap, poolDayData, etc.
0xGraph graph init

Core entities and what they mean

  • uniswapDayDatas - protocol-wide daily snapshot
  • poolManager- Uniswap’s global accounting contract. Holds network-wide stats like total volume, fees and pool counts.
  • pools / pool - A liquidity pool which tracks liquidity, swaps, ticks, etc.
  • poolDayDatas - Daily snapshots for one pool.
  • tokenDayDatas - Daily snapshot for a token across all pools.
  • swaps - Individual trade events like buyer/seller, amounts, timestamp.
  • positions - Liqiuidty provider positions.

Creating your own query using Explorer

0xGraph graph init
  1. Select the entities and fields you want to query.
  2. Press run
  3. Get output
In this example, I ran:

Input

query {
  uniswapDayDatas {
    id
    date
    volumeETH
    volumeUSD
    volumeUSDUntracked
    feesUSD
    txCount
    tvlUSD
  }
}

Output

{
  "data": {
    "uniswapDayDatas": [
      {
        "id": "20110",
        "date": 1737504000,
        "volumeETH": "0",
        "volumeUSD": "0",
        "volumeUSDUntracked": "0",
        "feesUSD": "0",
        "txCount": "1",
        "tvlUSD": "0"
      },
      {
        "id": "20111",
        "date": 1737590400,
        "volumeETH": "0.03825796132944227393357183151400676",
        "volumeUSD": "137.4168486184123701729440534967298",
        "volumeUSDUntracked": "0",
        "feesUSD": "0.2895005352096755986878110059489288",
        "txCount": "78",
        "tvlUSD": "277.7215175412274270560062480579528"
      },

Querying for pool-level daily stats

Input

{
  poolManager(id: "0x498581ff718922c3f8e6a244956af099b2652b2b") {
    poolCount
    txCount
    totalVolumeUSD
    totalVolumeETH
  }
}
  • poolCount - how many pools exist
  • txCount - total txns / swaps recorded
  • totalVolumeUSD/ETH - cumulative trading volume since launch

Output

{
  "data": {
    "poolManager": {
      "poolCount": "6404",
      "txCount": "2660638",
      "totalVolumeUSD": "118888687.8347001359469929298875743",
      "totalVolumeETH": "51610.64004064559902428529500862623"
    }
  }
}

You can now start querying!

I