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

> ## Agent Instructions
> To query the Token Terminal data catalog, read https://tokenterminal.com/docs/catalog/agents-manual.md first. It is the whole catalog as one page: table naming grammar, key columns, partition and cluster rules, units, additivity, and the tables that are documented but not served yet.
> Never query a catalog table on a time bound alone. Also filter its cluster key, which you read from INFORMATION_SCHEMA.COLUMNS; an empty result means the object is a view, whose pruning contract is on its page. Compute is billed to the caller's own Google Cloud project.

# Metrics

> Daily DEX figures per project, app, pool and pair.

Trading volume, TVL, fees and revenue, in USD. One row per thing per day, at four grains: project, app, pool and pair.

## Tables

> [!NOTE]
>
> Daily pool trading volume and position principal, uncollected fees and TVL cover closed UTC days and follow the availability cutoff of each pool’s chain.

A tab per grain. [Coverage](https://tokenterminal.com/docs/catalog/dex.md) shows which apps report which measure.

**Project**

One row per project per day.

<table>
  <thead>
    <tr>
      <th width="330">Table</th>
      <th width="190">Value column</th>
      <th>What it holds</th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`metrics_projects.trading_volume_daily`</td><td>`trading_volume`</td><td>Total value of trades executed.</td></tr>
    <tr><td>`metrics_projects.tvl_daily`</td><td>`tvl`</td><td>Total value locked.</td></tr>
    <tr><td>`metrics_projects.fees_daily`</td><td>`fees`</td><td>Total fees paid by users.</td></tr>
    <tr><td>`metrics_projects.fees_supply_side_daily`</td><td>`fees_supply_side`</td><td>Fees paid out to the supply side.</td></tr>
    <tr><td>`metrics_projects.revenue_daily`</td><td>`revenue`</td><td>Fees retained by the protocol.</td></tr>
  </tbody>
</table>

**App**

One row per app per day.

<table>
  <thead>
    <tr>
      <th width="330">Table</th>
      <th width="190">Value column</th>
      <th>What it holds</th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`metrics_apps.trading_volume_daily`</td><td>`trading_volume`</td><td>Value of trades executed by the app, measured on the quote leg at execution price.</td></tr>
    <tr><td>`metrics_apps.tvl_daily`</td><td>`tvl`</td><td>Total value locked in the app.</td></tr>
    <tr><td>`metrics_apps.fees_daily`</td><td>`fees`</td><td>Fees paid by users of the app across every chain it runs on.</td></tr>
    <tr><td>`metrics_apps.fees_supply_side_daily`</td><td>`fees_supply_side`</td><td>Fees the app passed through to builders and, on HIP-3 markets, to market deployers.</td></tr>
    <tr><td>`metrics_apps.revenue_daily`</td><td>`revenue`</td><td>Fees the app retained across every chain it runs on.</td></tr>
  </tbody>
</table>

**Pool**

One row per pool per day.

<table>
  <thead>
    <tr>
      <th width="330">Table</th>
      <th width="190">Value column</th>
      <th>What it holds</th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`metrics_dex_pools.trading_volume_daily`</td><td>`trading_volume`</td><td>Total value of trades executed through the DEX pool.</td></tr>
    <tr><td>`metrics_dex_pools.tvl_daily`</td><td>`tvl`</td><td>USD value of assets held in the DEX pool.</td></tr>
    <tr><td>`metrics_dex_pools.fees_daily`</td><td>`fees`</td><td>Fees paid by users of the DEX pool.</td></tr>
    <tr><td>`metrics_dex_pools.flash_loan_volume_daily`</td><td>`flash_loan_volume`</td><td>Total value of flash loans executed through the DEX pool.</td></tr>
  </tbody>
</table>

**Pair**

One row per pool and token pair per day.

<table>
  <thead>
    <tr>
      <th width="330">Table</th>
      <th width="190">Value column</th>
      <th>What it holds</th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`metrics_dex_pools_by_pair.trading_volume_daily`</td><td>`trading_volume`</td><td>Total value of trades executed through the DEX pool.</td></tr>
  </tbody>
</table>

## Sample queries

**One pool's series**

Each measure is its own table, so a row with all three is a join on `dex_pool_id` and `timestamp`, bounded on every side. Join with `full join`: a pool can hold liquidity on a day nothing traded.

```sql theme={null}
with volume as (
    select timestamp, trading_volume
    from `metrics_dex_pools.trading_volume_daily`
    where dex_pool_id = '0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640-ethereum'
      and timestamp >= timestamp('2026-06-01')
),

tvl as (
    select timestamp, tvl
    from `metrics_dex_pools.tvl_daily`
    where dex_pool_id = '0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640-ethereum'
      and timestamp >= timestamp('2026-06-01')
),

fees as (
    select timestamp, fees
    from `metrics_dex_pools.fees_daily`
    where dex_pool_id = '0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640-ethereum'
      and timestamp >= timestamp('2026-06-01')
)

select
    timestamp,
    volume.trading_volume,
    tvl.tvl,
    fees.fees
from volume
full join tvl
    using (timestamp)
full join fees
    using (timestamp)
order by timestamp
```

**Pools by volume**

One day of pool volume across the catalog, ranked. `dex_pool_id` joins `dimensions.dex_pools` for the pool's tokens and its fee tier.

```sql theme={null}
select
    dex_pool_id,
    app_id,
    chain_id,
    trading_volume
from `metrics_dex_pools.trading_volume_daily`
where timestamp = timestamp('2026-08-01')
order by trading_volume desc
limit 25
```

**Pair total across pools**

The same pair can trade in many pools, and it has the same `dex_pair_id` in all of them, so a total across pools is a group by on that column.

```sql theme={null}
select
    timestamp,
    sum(trading_volume) as trading_volume
from `metrics_dex_pools_by_pair.trading_volume_daily`
where dex_pair_id = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48-0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2-ethereum'
  and timestamp >= timestamp('2026-08-01')
group by timestamp
order by timestamp
```

**Pool by pair breakdown**

A pool's pair rows add back up to its row on the pool table. A breakdown by single token would not: every swap involves two tokens, so counting it under each one counts it twice and the total stops matching the pool.

```sql theme={null}
select
    dex_pair_id,
    sum(trading_volume) as trading_volume
from `metrics_dex_pools_by_pair.trading_volume_daily`
where dex_pool_id = '0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640-ethereum'
  and timestamp >= timestamp('2026-08-01')
  and timestamp < timestamp('2026-08-08')
group by dex_pair_id
order by trading_volume desc
```

**Sector total**

A sector total is a grouping over the pool volume table joined to `dimensions.projects`, by day. Group by `primary_market_sector`, where every project appears exactly once.

```sql theme={null}
select
    daily.timestamp,
    sum(daily.trading_volume) as sector_volume
from `metrics_dex_pools.trading_volume_daily` as daily
join `dimensions.projects` as projects
    on projects.project_id = daily.project_id
where projects.primary_market_sector = 'exchange'
  and daily.timestamp >= timestamp('2026-08-01')
group by daily.timestamp
order by daily.timestamp
```

**Pool vs pair check**

The pool row is the sum of its pair rows. On any day the pool traded, the two sides agree exactly.

```sql theme={null}
with pairs as (
    select
        dex_pool_id,
        timestamp,
        sum(trading_volume) as summed
    from `metrics_dex_pools_by_pair.trading_volume_daily`
    where dex_pool_id = '0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640-ethereum'
      and timestamp >= timestamp('2026-08-01')
    group by dex_pool_id, timestamp
),

pools as (
    select
        dex_pool_id,
        timestamp,
        trading_volume
    from `metrics_dex_pools.trading_volume_daily`
    where dex_pool_id = '0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640-ethereum'
      and timestamp >= timestamp('2026-08-01')
)

select
    timestamp,
    pools.trading_volume as pool_grain,
    pairs.summed as pair_grain
from pools
join pairs
    using (dex_pool_id, timestamp)
order by timestamp
```


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