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

### Table Details

| Property | Value |
| - | - |
| Table Name | `robinhood.dex.trades_enriched` |
| Table Status | Beta 🌱 |
| Unique Key | `block_timestamp`, `unique_id` |

Every row of [`robinhood.dex.trades`](/historical-data/supported-blockchains/evm/robinhood/dex/trades), with the same columns, plus flags that mark wash and other inorganic trades. Use it when you want DEX volume that reflects real trading, while keeping every trade available.

<Info>
  Nothing is removed. Flagged trades keep their original `usd_amount`; `usd_amount_adjusted` is null on them, so you choose what to exclude. Flag details live in [`robinhood.dex.trades_flagged`](/historical-data/supported-blockchains/evm/robinhood/dex/trades-flagged).
</Info>

| Column | What it adds |
| - | - |
| `usd_amount_adjusted` | `usd_amount`, or null on flagged trades. Sum it for adjusted volume. |
| `is_flagged` | `true` if the trade is flagged. |
| `flag_reason` | Why it is flagged, e.g. `roundtrip_wash`. |
| `flag_source` | Which key matched: tx hash, tx sender or called contract. |
| `flagged_at` | Date the flag was added. |

### Sample Queries

Daily DEX volume, raw and adjusted:

```sql theme={null}
select
    block_timestamp::date as date,
    sum(usd_amount) as volume_usd,
    sum(usd_amount_adjusted) as volume_usd_adjusted,
    sum(usd_amount) - sum(usd_amount_adjusted) as flagged_volume_usd
from robinhood.dex.trades_enriched
where block_timestamp >= current_date - 30
group by 1
order by 1
```

Only unflagged trades:

```sql theme={null}
select *
from robinhood.dex.trades_enriched
where block_timestamp >= current_date - 1
  and not is_flagged
```

<Tip>
  Always filter on `block_timestamp`. It keeps queries on this table as fast as on `robinhood.dex.trades`.
</Tip>

### Table Columns

| Column Name | Data Type | Description |
| - | - | - |
| project | VARCHAR(16777216) | The project (decentralized exchange) of the liquidity pool that the swap occurred from. |
| protocol | VARCHAR(16777216) | DEX protocol (& version, if applicable) of the contract address facilitating the swap. |
| liquidity\_pool\_address | VARCHAR(42) | Contract address of the liquidity pool holding the asset. For protocol without the concept of LP such as airswap, this will be null. |
| sender\_address | VARCHAR(42) | The address of the sender emitted on the swap event logs. This can be a router or pool address. |
| to\_address | VARCHAR(42) | Address of the recipient emitted on the swap event logs. For example, recipient\_address from the uniswap v3 swap event log. |
| token\_sold\_address | VARCHAR(42) | Token address of the token sold. |
| token\_sold\_name | VARCHAR(16777216) | Name of the token sold. |
| token\_sold\_symbol | VARCHAR(16777216) | Symbol of the token sold. |
| token\_sold\_decimals | NUMBER(38,0) | Token decimals of the token sold. |
| token\_sold\_amount\_raw\_str | VARCHAR(16777216) | Raw amount of tokens sold (unnormalized) in string. |
| token\_sold\_amount\_raw | FLOAT | Raw amount of tokens sold (unnormalized). |
| token\_sold\_amount\_str | VARCHAR(16777216) | Amount of tokens sold in string. |
| token\_sold\_amount | FLOAT | Amount of tokens sold. |
| usd\_sold\_amount | FLOAT | Amount of token sold in USD value. |
| token\_bought\_address | VARCHAR(42) | Token address of the token bought, i.e. the asset acquired from the trade. |
| token\_bought\_name | VARCHAR(16777216) | Name of the token bought. |
| token\_bought\_symbol | VARCHAR(16777216) | Symbol of the token bought. |
| token\_bought\_decimals | NUMBER(38,0) | Token decimals of the token bought. |
| token\_bought\_amount\_raw\_str | VARCHAR(16777216) | Raw amount of tokens bought (unnormalized) in string. |
| token\_bought\_amount\_raw | FLOAT | Raw amount of tokens bought (unnormalized). |
| token\_bought\_amount\_str | VARCHAR(16777216) | Amount of tokens bought in string. |
| token\_bought\_amount | FLOAT | Amount of tokens bought. |
| usd\_bought\_amount | FLOAT | Amount of token bought in USD value. |
| usd\_amount | FLOAT | USD value of the swap. This field preferentially selects the USD value of ETH and Stablecoin (USDT/USDC) tokens, as spam token prices may conflate the true swap value. |
| usd\_amount\_adjusted | FLOAT | `usd_amount`, or null when `is_flagged` is true. `sum(usd_amount_adjusted)` gives adjusted volume. |
| is\_flagged | BOOLEAN | True if the trade is in `robinhood.dex.trades_flagged`. Filter `where not is_flagged` to exclude flagged trades. |
| flag\_reason | VARCHAR(16777216) | Why the trade is flagged, e.g. `roundtrip_wash`. Null when `is_flagged` is false. |
| flag\_source | VARCHAR(16777216) | Which match key flagged the trade: `transaction_hash`, `transaction_from_address` or `transaction_to_address`. Null when `is_flagged` is false. |
| flagged\_at | DATE | Date the flag was added. Null when `is_flagged` is false. |
| extra\_fields | VARIANT | This field contains all the extra columns emitted from the event/function call that were not part of the convetional DEX trades columns. |
| swap\_count | NUMBER(38,0) | Swap count within the transaction. |
| transaction\_fees | VARCHAR(16777216) | Fees paid at the transaction level. Varchar to retain precision. |
| transaction\_fees\_usd | FLOAT | Fees paid in USD. |
| fee\_details | VARIANT | Additional fee details of the transaction, including max priority fee, gas price and gas used for the transaction. |
| transaction\_from\_address | VARCHAR(42) | Transaction sender address. I.e. the address of the transaction initiator. (from\_address in the raw\.transactions field for the transaction\_hash of this swap). |
| transaction\_to\_address | VARCHAR(42) | Transaction receiver. (to\_address in the raw\.transactions field for the transaction\_hash of this swap). |
| transaction\_hash | VARCHAR(66) | Transaction hash that this swap belongs to. |
| transaction\_index | NUMBER(38,0) | The position of this transaction in the block that it belongs to. The first transaction has index 0. |
| selector | VARCHAR(16777216) | 4byte selector of the transaction. |
| log\_index | NUMBER(38,0) | The position of the swap event log in the transaction. |
| block\_timestamp | TIMESTAMP\_NTZ(9) | Block timestamp of the swap event. |
| block\_number | NUMBER(38,0) | Block number of the swap event. |
| block\_hash | VARCHAR(66) | Block hash of the swap event. |
| unique\_id | VARCHAR(16777216) | Unique ID of each trade. |
| \_created\_at | TIMESTAMP\_NTZ(9) | Timestamp of when the entry was created in the database. |
| \_updated\_at | TIMESTAMP\_NTZ(9) | Timestamp of when the entry was last updated in the database. |
| \_changed\_since\_full\_refresh | BOOLEAN | Indicates if the record has changed since the last full data refresh. |
