> For the complete documentation index, see [llms.txt](https://docs.openblocklabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.openblocklabs.com/data-offering/defi-canonical-data/dex-aggregator.md).

# DEX Aggregator

Key Tables:

* **Tokens:** Details of the tokens supported by the aggregator, including token addresses, names, symbols, and decimals.
* **Token Snapshot:** Token-level snapshots, capturing trading volume, fees, and incentives collected in USD for a given period.
* **Protocol Snapshot:** Snapshot of aggregator-wide metrics, including total volume and fees in USD across all tokens.
* **Trades:** Data on individual trades executed via the aggregator, including token swaps, slippage, and fees.

{% tabs %}
{% tab title="Tokens" %}

| Property       | Description                                                    | Type   |
| -------------- | -------------------------------------------------------------- | ------ |
| chain\_id      | The standard id of the chain.                                  | number |
| token\_address | The contract address of the token.                             | string |
| token\_name    | The full name of the token, from the eth\_call name().         | string |
| token\_symbol  | The symbol of the token, from the eth\_call symbol().          | string |
| decimals       | The decimals name of the token, from the eth\_call decimals(). | number |
| {% endtab %}   |                                                                |        |

{% tab title="Token Snapshot" %}

| Property          | Description                                                                                                       | Type   |
| ----------------- | ----------------------------------------------------------------------------------------------------------------- | ------ |
| timestamp         | The timestamp of the record.                                                                                      | number |
| block\_date       | The timestamp truncated (ie, YYYY-MM-DD format for daily snapshots and YYYY-MM-DD HH:00:00 for hourly snapshots). | date   |
| chain\_id         | The standard id of the chain.                                                                                     | number |
| token\_address    | The contract address of the token.                                                                                | string |
| volume\_amount    | The volume amount of the token, during the snapshot period, decimal normalized.                                   | number |
| volume\_usd       | The volume of the token in USD.                                                                                   | number |
| fees              | The fees (ie, revenue generated from trading this token) from this token in native, decimal normalized terms.     | number |
| fees\_usd         | The fees collected in USD.                                                                                        | number |
| incentive\_amount | The amount of incentives collected from this token, during the snapshot period, decimal normalized.               | number |
| incentive\_usd    | The value of incentives in USD.                                                                                   | number |
| {% endtab %}      |                                                                                                                   |        |

{% tab title="Protocol Snapshot" %}

| Property     | Description                                                                                                       | Type   |
| ------------ | ----------------------------------------------------------------------------------------------------------------- | ------ |
| timestamp    | The timestamp of the block this snapshot was taken.                                                               | number |
| block\_date  | The timestamp truncated (ie, YYYY-MM-DD format for daily snapshots and YYYY-MM-DD HH:00:00 for hourly snapshots). | date   |
| chain\_id    | The standard id of the chain.                                                                                     | number |
| volume\_usd  | The volume in USD, in the given snapshot period.                                                                  | number |
| fees\_usd    | The fees (ie, total revenue generated in the protocol) collected in USD, during the snapshot period.              | number |
| {% endtab %} |                                                                                                                   |        |

{% tab title="Trades" %}

| Property               | Description                                                                                     | Type      |
| ---------------------- | ----------------------------------------------------------------------------------------------- | --------- |
| timestamp              | The timestamp of the trade.                                                                     | number    |
| chain\_id              | The standard id of the chain this trade belongs to.                                             | number    |
| block\_number          | The block number in which the trade occurred.                                                   | number    |
| transaction\_hash      | The transaction hash associated with this trade.                                                | string    |
| log\_index             | The event log. For transactions that don't emit event, create arbitrary index starting from 0.  | number    |
| fees                   | The amount of fees from this trade (ie, the revenue generated from executing this trade).       | number    |
| fees\_usd              | The fees for this trade in USD.                                                                 | number    |
| slippage               | (Optional) The slippage of the given trade, as a percentage (ie, 1.3% slippage is 0.013).       | number    |
| user\_address          | The address of the user initiating the trade.                                                   | string    |
| input\_tokens          | The contract address of the input token(s).                                                     | \[string] |
| input\_token\_amounts  | Parallel array to input\_tokens, dictating the normalized native amounts of each token traded.  | \[number] |
| output\_tokens         | The contract address of the output token(s).                                                    | \[string] |
| output\_token\_amounts | Parallel array to output\_tokens, dictating the normalized native amounts of each token traded. | \[number] |
| swap\_amount\_usd      | The value of the swap in USD.                                                                   | number    |
| {% endtab %}           |                                                                                                 |           |
| {% endtabs %}          |                                                                                                 |           |
