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

### Table Details

| Property | Value |
| - | - |
| Table Name | `robinhood.dex.trades_flagged` |
| Table Status | Beta 🌱 |
| Unique Key | `block_timestamp`, `unique_id` |
| Clustering Key(s) | `block_timestamp::date` |

Trades from [`robinhood.dex.trades`](/historical-data/supported-blockchains/evm/robinhood/dex/trades) flagged as wash or otherwise inorganic, one row per trade. Use it to see what was flagged and why, or to join flags onto your own queries.

<Info>
  Flagged trades are not removed from `robinhood.dex.trades`. For every trade with flags already joined, use [`robinhood.dex.trades_enriched`](/historical-data/supported-blockchains/evm/robinhood/dex/trades-enriched).
</Info>

| `flag_reason` | Meaning |
| - | - |
| `roundtrip_wash` | The transaction buys and sells through the same pool within itself, printing volume with no net position. |

### Sample Queries

Flagged volume by day and reason:

```sql theme={null}
select
    f.block_timestamp::date as date,
    f.flag_reason,
    count(*) as trades,
    sum(t.usd_amount) as flagged_volume_usd
from robinhood.dex.trades_flagged f
join robinhood.dex.trades t
    on t.block_timestamp = f.block_timestamp
    and t.unique_id = f.unique_id
group by 1, 2
order by 1
```

### Table Columns

| Column Name | Data Type | Description |
| - | - | - |
| block\_timestamp | TIMESTAMP\_NTZ(9) | Block timestamp of the swap event. |
| block\_number | NUMBER(38,0) | Block number of the swap event. |
| transaction\_hash | VARCHAR(66) | Transaction hash that this swap belongs to. |
| 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). |
| 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. |
| flag\_reason | VARCHAR(16777216) | Why the trade is flagged. `roundtrip_wash` = the transaction round-trips a pool inside itself, so its legs print volume with no net position. |
| flag\_source | VARCHAR(16777216) | Which match key flagged the trade: `transaction_hash`, `transaction_from_address` (the wallet that sent the transaction) or `transaction_to_address` (the contract it called). When several match, the most specific is kept, in that order. |
| flagged\_at | DATE | Date the flag was added. Use it to explain changes to adjusted values. |
| \_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. |
| unique\_id | VARCHAR(16777216) | Unique ID of each trade. |
