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

# Trades

> Individual DEX swaps in token amounts.

<Info>
  **In progress.** This table is not served yet. The page documents it as it lands.
</Info>

`facts.dex_trades_volume` holds one row per swap, in token amounts rather than dollars. Instead of signing the amounts, each row names the token the trader handed over in `token_in_id` and the token they got back in `token_out_id`, both amounts positive. Every swap keeps its row: if the pool is missing from the [registry](/docs/catalog/dex/registry), `app_id` is left empty rather than the swap being dropped.

`log_index` is the swap event's position within its block on EVM chains; chains that are not EVM put their own event position in the same column.

## Columns

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

  <tbody>
    <tr>
      <td><code>block\_timestamp</code></td>
      <td><code>TIMESTAMP</code></td>
      <td>The time when the block containing this swap was included.</td>
    </tr>

    <tr>
      <td><code>transaction\_hash</code></td>
      <td><code>STRING</code></td>
      <td>Hash of the transaction containing the swap.</td>
    </tr>

    <tr>
      <td><code>log\_index</code></td>
      <td><code>INT64</code></td>
      <td>Position of the swap event within its block.</td>
    </tr>

    <tr>
      <td><code>dex\_pool\_id</code></td>
      <td><code>STRING</code></td>
      <td>Pool the swap executed in, keyed like <code>dimensions.dex\_pools</code>.</td>
    </tr>

    <tr>
      <td><code>app\_id</code></td>
      <td><code>STRING</code></td>
      <td>The app operating the pool, read from the pool registry table. Empty when that table does not carry the pool.</td>
    </tr>

    <tr>
      <td><code>chain\_id</code></td>
      <td><code>STRING</code></td>
      <td>Chain the swap executed 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>token\_in\_id</code></td>
      <td><code>STRING</code></td>
      <td>Token the trader handed to the pool, keyed like <code>dimensions.tokens</code>.</td>
    </tr>

    <tr>
      <td><code>token\_out\_id</code></td>
      <td><code>STRING</code></td>
      <td>Token the trader received from the pool.</td>
    </tr>

    <tr>
      <td><code>fee\_rate</code></td>
      <td><code>BIGNUMERIC</code></td>
      <td>Fee charged on this swap, as a decimal fraction of its size.</td>
    </tr>

    <tr>
      <td><code>amount\_in</code></td>
      <td><code>BIGNUMERIC</code></td>
      <td>Amount of <code>token\_in\_id</code> handed over, in whole token units, always positive.</td>
    </tr>

    <tr>
      <td><code>amount\_out</code></td>
      <td><code>BIGNUMERIC</code></td>
      <td>Amount of <code>token\_out\_id</code> received, in whole token units, always positive.</td>
    </tr>
  </tbody>
</table>

## Sample queries

<Warning>
  Put a filter on `block_timestamp` in every query. The table is partitioned on it, and leaving the filter out reads every day we hold.
</Warning>

<Tabs>
  <Tab title="One pool, one day">
    **Read one pool's swaps on a single day.** Amounts are in whole token units, so a dollar value means joining a price yourself.

    ```sql theme={null}
    select
        block_timestamp,
        transaction_hash,
        token_in_id,
        token_out_id,
        amount_in,
        amount_out,
        fee_rate
    from `facts.dex_trades_volume`
    where dex_pool_id = '0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640-ethereum'
      and block_timestamp >= timestamp('2026-08-01')
      and block_timestamp < timestamp('2026-08-02')
    order by block_timestamp
    limit 100
    ```
  </Tab>

  <Tab title="Largest purchases">
    **Rank the largest purchases of one token in a window.** `token_out_id` is the token the trader received, keyed like `dimensions.tokens`.

    ```sql theme={null}
    select
        trades.block_timestamp,
        trades.transaction_hash,
        trades.dex_pool_id,
        trades.app_id,
        trades.amount_out,
        tokens.symbol
    from `facts.dex_trades_volume` as trades
    join `dimensions.tokens` as tokens
        on tokens.token_id = trades.token_out_id
    where trades.token_out_id = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2-ethereum'
      and trades.block_timestamp >= timestamp('2026-08-01')
      and trades.block_timestamp < timestamp('2026-08-08')
    order by trades.amount_out desc
    limit 20
    ```
  </Tab>
</Tabs>

## Notes

`fee_rate` describes the individual swap. On most venues it is the same as the pool's fixed `fee_tier`, so every trade in the pool carries the same value. Where the venue can change its fee, the rate is set swap by swap and two trades in the same pool can differ.

This table carries token amounts and no dollar column. The daily tables apply our token prices once, in one place, which is what makes their pool, app and project totals agree with each other. For a dollar figure on an individual swap, join whichever price you trust. [Metrics](/docs/catalog/dex/metrics) covers daily pool volume, fees and TVL.
