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

# Trades

### Table Details

| Property     | Value                           |
| ------------ | ------------------------------- |
| Table Name   | `casper.dex.trades`             |
| Table Status | Production-Ready                |
| Unique Key   | `transaction_hash`, `unique_id` |

### Table Columns

| Column Name                     | Data Type         | Description                                                                  |
| ------------------------------- | ----------------- | ---------------------------------------------------------------------------- |
| project                         | VARCHAR(16777216) | Name of the DEX protocol's project (e.g., Casperswap).                       |
| protocol                        | VARCHAR(16777216) | Specific protocol variant or version identifier.                             |
| liquidity\_pool\_address        | VARCHAR(16777216) | Address of the liquidity pool contract where the trade occurred.             |
| sender\_address                 | VARCHAR(16777216) | Address that initiated the trade.                                            |
| to\_address                     | VARCHAR(16777216) | Address that received the bought tokens.                                     |
| token\_sold\_address            | VARCHAR(16777216) | Address of the token sold (input) in the trade.                              |
| token\_sold\_name               | VARCHAR(16777216) | Human-readable name of the sold token.                                       |
| token\_sold\_symbol             | VARCHAR(16777216) | Ticker symbol of the sold token.                                             |
| token\_sold\_decimals           | NUMBER(38,0)      | Decimals of the sold token.                                                  |
| token\_sold\_amount\_raw\_str   | VARCHAR(16777216) | Raw amount of the sold token in its smallest unit as a string.               |
| token\_sold\_amount\_raw        | FLOAT             | Raw amount in the token's smallest unit (no decimal adjustment).             |
| token\_sold\_amount\_str        | VARCHAR(16777216) | Human-readable amount of the sold token adjusted for decimals as a string.   |
| token\_sold\_amount             | FLOAT             | Human-readable amount adjusted for token decimals.                           |
| usd\_sold\_amount               | FLOAT             | USD value of the sold token amount at the time of the trade.                 |
| token\_bought\_address          | VARCHAR(16777216) | Address of the token bought (output) in the trade.                           |
| token\_bought\_name             | VARCHAR(16777216) | Human-readable name of the bought token.                                     |
| token\_bought\_symbol           | VARCHAR(16777216) | Ticker symbol of the bought token.                                           |
| token\_bought\_decimals         | NUMBER(38,0)      | Decimals of the bought token.                                                |
| token\_bought\_amount\_raw\_str | VARCHAR(16777216) | Raw amount of the bought token in its smallest unit as a string.             |
| token\_bought\_amount\_raw      | FLOAT             | Raw amount in the token's smallest unit (no decimal adjustment).             |
| token\_bought\_amount\_str      | VARCHAR(16777216) | Human-readable amount of the bought token adjusted for decimals as a string. |
| token\_bought\_amount           | FLOAT             | Human-readable amount adjusted for token decimals.                           |
| usd\_bought\_amount             | FLOAT             | USD value of the bought token amount at the time of the trade.               |
| usd\_amount                     | FLOAT             | USD value of the trade, using the closest available price.                   |
| extra\_fields                   | VARIANT           | Protocol-specific additional fields not captured by standard columns.        |
| swap\_count                     | NUMBER(38,0)      | Number of underlying swaps composing the trade (>1 for multi-hop routes).    |
| transaction\_hash               | VARCHAR(16777216) | Hash of the transaction this event belongs to.                               |
| log\_index                      | NUMBER(38,0)      | Index of the event within the transaction.                                   |
| block\_timestamp                | TIMESTAMP\_NTZ(9) | Timestamp of the block this event was included in.                           |
| block\_number                   | NUMBER(38,0)      | Height of the block this event was included in.                              |
| block\_hash                     | VARCHAR(16777216) | Hash of the block this event was included in.                                |
| unique\_id                      | VARCHAR(16777216) | Unique identifier for the row, used for deduplication.                       |
