> ## Documentation Index
> Fetch the complete documentation index at: https://ormilabs.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# How to query a Uniswap v4 subgraph with Ormi 0xGraph

> Subgraphs provides fast, reliable, and structured access to onchain data - without the need to run your own indexing infrastructure.

### 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.](http://app.ormilabs.com/)

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

![0xGraph graph init](https://mintcdn.com/ormilabs/XdTpJ0jGUKw4Ynly/images/how-to/subgraph-query.png?fit=max\&auto=format\&n=XdTpJ0jGUKw4Ynly\&q=85\&s=382d999f1c440c34e797f57dba87e8df)

API Keys

## Open GraphiQL Explorer

![0xGraph graph init](https://mintcdn.com/ormilabs/XdTpJ0jGUKw4Ynly/images/how-to/subgraph-query2.png?fit=max\&auto=format\&n=XdTpJ0jGUKw4Ynly\&q=85\&s=e6be210c428276aa4299b843c33ccd57)

API Keys

## Introspect the schema

After opening the Explorer, you'll be able to see available entites, for example pool, swap, poolDayData, etc.

![0xGraph graph init](https://mintcdn.com/ormilabs/XdTpJ0jGUKw4Ynly/images/how-to/subgraph-query3.png?fit=max\&auto=format\&n=XdTpJ0jGUKw4Ynly\&q=85\&s=281531b32e4358ad7fb203352bde039f)

API Keys

## 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](https://mintcdn.com/ormilabs/XdTpJ0jGUKw4Ynly/images/how-to/subgraph-query4.png?fit=max\&auto=format\&n=XdTpJ0jGUKw4Ynly\&q=85\&s=6bd6a85caa491f50d55839663181b17e)

API Keys

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!


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.