> ## 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.

# Registry

> Pool identity, the fee it charges, its tokens, and who runs it.

`dimensions.dex_pools` holds one row per DEX pool, which is one place to swap tokens on one chain. It brings together the pools of every project we cover, read from the events that created them, so it lists every pool that has ever existed rather than only the ones still in use.

## Columns

<table>
  <thead>
    <tr>
      <th width="280">Column</th>
      <th width="130">Type</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>dex\_pool\_id</code></td>
      <td><code>STRING</code></td>
      <td>Identifier of the pool: the pool address joined with the chain.</td>
    </tr>

    <tr>
      <td><code>deployment\_id</code></td>
      <td><code>STRING</code></td>
      <td>The operating app's deployment on the pool's chain.</td>
    </tr>

    <tr>
      <td><code>protocol\_id</code></td>
      <td><code>STRING</code></td>
      <td>The app operating the pool, for example <code>uniswap-v3</code>.</td>
    </tr>

    <tr>
      <td><code>chain\_id</code></td>
      <td><code>STRING</code></td>
      <td>Chain the pool lives on.</td>
    </tr>

    <tr>
      <td><code>project\_id</code></td>
      <td><code>STRING</code></td>
      <td>Project the operating app belongs to.</td>
    </tr>

    <tr>
      <td><code>pool\_address</code></td>
      <td><code>STRING</code></td>
      <td>Onchain address of the pool. Where one contract holds every pool, this is the pool's id inside that contract.</td>
    </tr>

    <tr>
      <td><code>pool\_name</code></td>
      <td><code>STRING</code></td>
      <td>The pool's tokens as a name, for example <code>USDC-WETH</code>.</td>
    </tr>

    <tr>
      <td><code>pool\_display\_name</code></td>
      <td><code>STRING</code></td>
      <td>Pool name with the fee added on, where the pool charges a fixed one.</td>
    </tr>

    <tr>
      <td><code>fee\_tier</code></td>
      <td><code>BIGNUMERIC</code></td>
      <td>The fee the pool charges on every swap, as a decimal fraction, so <code>0.0005</code> reads 0.05%. Empty where the venue sets the fee swap by swap.</td>
    </tr>

    <tr>
      <td><code>created\_at</code></td>
      <td><code>TIMESTAMP</code></td>
      <td>Time of the block the pool was created in.</td>
    </tr>

    <tr>
      <td><code>hooks\_address</code></td>
      <td><code>STRING</code></td>
      <td>Address of the pool's hooks contract, on venues that attach one. A hooks contract is extra code the venue runs around each swap.</td>
    </tr>

    <tr>
      <td><code>token\_ids</code></td>
      <td><code>ARRAY\<STRING></code></td>
      <td>The tokens the pool holds, in pool order, as keys of <code>dimensions.tokens</code>.</td>
    </tr>
  </tbody>
</table>

## Sample queries

<Tabs>
  <Tab title="Pools per chain">
    **Count pools by protocol version and chain.** `protocol_id` names the app operating the pool and `deployment_id` names that app's deployment on the pool's chain.

    ```sql theme={null}
    select
        protocol_id,
        chain_id,
        count(*) as pools
    from `dimensions.dex_pools`
    group by protocol_id, chain_id
    order by pools desc
    limit 20
    ```
  </Tab>

  <Tab title="A pool's tokens">
    **Look up a pool's tokens.** `token_ids` lists the pool's tokens, in the order the pool holds them, as keys of `dimensions.tokens`. Symbol, name, decimals and `asset_id` live on that token table rather than on the pool, so join it on one element of the list.

    ```sql theme={null}
    select
        pools.dex_pool_id,
        pools.pool_display_name,
        position,
        tokens.symbol,
        tokens.decimals,
        tokens.asset_id
    from `dimensions.dex_pools` as pools,
        unnest(pools.token_ids) as token_id with offset as position
    join `dimensions.tokens` as tokens
        using (token_id)
    where pools.dex_pool_id = '0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640-ethereum'
    order by position
    ```
  </Tab>

  <Tab title="Pools for one pair">
    **Find every pool that holds one pair.** Check that both tokens appear in the list.

    ```sql theme={null}
    select
        dex_pool_id,
        protocol_id,
        pool_display_name,
        fee_tier
    from `dimensions.dex_pools`
    where chain_id = 'ethereum'
      and '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48-ethereum' in unnest(token_ids)
      and '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2-ethereum' in unnest(token_ids)
    order by created_at
    limit 50
    ```
  </Tab>
</Tabs>

## Notes

A pool holds two or more tokens, and a pair is any two of them, so there is no separate table of pairs. A pool holding three tokens has three possible pairs, readable straight off `token_ids`. Keeping the tokens in a list is also what lets a pool hold more than two, which fixed `token0` and `token1` columns could not.

Which of those pairs users traded is a separate question, and a matter of record rather than of membership. The pairs that traded and their volumes are on the [daily pair table](/docs/catalog/dex/metrics), keyed by `dex_pair_id`.

`fee_tier` is filled in for Uniswap v2, where it is fixed at 0.30%, and for v3, where the pool sets it onchain. It is empty for every v4 pool, because a v4 pool's fee can be changed swap by swap by its hooks contract. For those pools, the fee a trade paid is `fee_rate` on [Trades](/docs/catalog/dex/trades) rather than anything on the pool.

This table lists every pool, including ones that never traded and ones long abandoned.
