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

# prediction_markets.trades

> Cross-venue per-fill trade table, one row per trade with prices normalized to P(Yes) in [0, 1].

export const TableSample = ({tableName, tableSchema}) => <>
    <div className="hidden dark:block">
      <iframe src={`https://dune.com/embeds/3419983/5785629?table_schema_t6f0df=${tableSchema}&table_name_t6f0df=${tableName}&darkMode=true`} style={{
  width: '100%',
  height: '500px',
  border: 'none',
  marginTop: '10px'
}} />
    </div>
    <div className="dark:hidden">
      <iframe src={`https://dune.com/embeds/3419983/5785629?table_schema_t6f0df=${tableSchema}&table_name_t6f0df=${tableName}`} style={{
  width: '100%',
  height: '500px',
  border: 'none',
  marginTop: '10px'
}} />
    </div>
  </>;

The `prediction_markets.trades` table is the cross-venue per-fill trade table. Grain: one row per individual fill. Prices are normalized to **P(Yes) in \[0, 1]** so trades are directly comparable across venues and outcome sides. The taker's actual fill price is preserved in `taker_fill_price`.

## Table Schema

| Column             | Type        | Description                                                                                                                                                         |
| ------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `venue`            | `VARCHAR`   | `polymarket` or `kalshi`                                                                                                                                            |
| `executed_at`      | `TIMESTAMP` | Timestamp of the fill                                                                                                                                               |
| `block_month`      | `DATE`      | First day of the calendar month of `executed_at` (partition key)                                                                                                    |
| `trade_id`         | `VARCHAR`   | Unique fill identifier within a venue                                                                                                                               |
| `market_id`        | `VARCHAR`   | Polymarket `condition_id` / Kalshi `ticker`                                                                                                                         |
| `event_id`         | `VARCHAR`   | Parent event identifier. Always populated for Kalshi; join `prediction_markets.markets` to retrieve for Polymarket                                                  |
| `outcome_id`       | `VARCHAR`   | Identifier of the side that was traded                                                                                                                              |
| `taker_side`       | `VARCHAR`   | `yes` or `no`, the side the taker bought                                                                                                                            |
| `price`            | `DOUBLE`    | P(Yes) at the time of the fill, in `[0, 1]`                                                                                                                         |
| `taker_fill_price` | `DOUBLE`    | Actual price paid by the taker (`price` when `taker_side='yes'`, `1 - price` when `taker_side='no'`)                                                                |
| `num_contracts`    | `DOUBLE`    | Number of contracts filled (1 contract = \$1 payout)                                                                                                                |
| `amount_usd`       | `DOUBLE`    | USD notional of the fill (`price × num_contracts`)                                                                                                                  |
| `fee_usd`          | `DOUBLE`    | Trading fee in USD. NULL on the small share of Kalshi rows whose series has no `fee_type` configured (\~0.5%)                                                       |
| `outcome_native`   | `VARCHAR`   | Original side label from the venue                                                                                                                                  |
| `is_taker_side`    | `BOOLEAN`   | TRUE on the taker leg of a fill. Filter `WHERE is_taker_side` to get one-sided volume on Polymarket; always TRUE for Kalshi (safe to apply uniformly across venues) |
| `tx_hash`          | `VARCHAR`   | On-chain transaction hash (0x-hex). Polymarket only; NULL for Kalshi                                                                                                |
| `maker_address`    | `VARCHAR`   | Maker wallet address (0x-hex). Polymarket only                                                                                                                      |
| `taker_address`    | `VARCHAR`   | Taker wallet address (0x-hex). Polymarket only                                                                                                                      |
| `_updated_at`      | `TIMESTAMP` | When this row was last written by the pipeline                                                                                                                      |

## Table sample

<TableSample tableSchema="prediction_markets" tableName="trades" />

## Query performance

`block_month` is the partition key. Always include a `block_month` or `executed_at` filter.

```sql theme={null}
-- ✅ Good: time-bounded
SELECT * FROM prediction_markets.trades
WHERE block_month >= DATE '2026-05-01'
  AND venue = 'kalshi'
```

## Example query

```sql theme={null}
-- Top markets by USD volume across both venues (last 7 days)
SELECT
  venue,
  market_id,
  COUNT(*) AS num_trades,
  SUM(amount_usd) AS total_volume_usd
FROM prediction_markets.trades
WHERE executed_at >= NOW() - INTERVAL '7' DAY
GROUP BY 1, 2
ORDER BY 4 DESC
LIMIT 20
```
