# 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 %}          |                                                                                                 |           |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.openblocklabs.com/data-offering/defi-canonical-data/dex-aggregator.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
