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

# polymarket_polygon.market_trades

> Polymarket trade events — buy/sell orders with prices, amounts, sides, and trader addresses across the v1 and v2 exchanges.

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 `polymarket_polygon.market_trades` table contains trade-level activity across all Polymarket market outcomes on Polygon, covering both the original v1 exchanges (CTFExchange / NegRiskCTFExchange, USDC collateral) and the v2 exchange stack (unified CTFExchange V2, pUSD collateral; rows from April 2026 onward). Trades of Combos (multi-leg parlays) live in [`combo_trades`](/data-catalog/curated/prediction-markets/polymarket/combo_trades).

It includes all market activity: complementary matching (A buys shares from B), MINT matching (the system mints new outcome tokens when there aren't enough sell orders), and MERGE matching (the system matches YES and NO shares to unlock collateral). This is technically correct volume, but not directly comparable to DEX volume — filter `WHERE is_taker_side` for single-counted volume that matches Polymarket's published methodology.

## Table Schema

| Column               | Type        | Description                                                                                                                                                                                                                                                            |
| -------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `block_month`        | `DATE`      | UTC month of the event block time (partition key)                                                                                                                                                                                                                      |
| `block_number`       | `BIGINT`    | Block number in which the transaction was executed                                                                                                                                                                                                                     |
| `block_time`         | `TIMESTAMP` | UTC event block time                                                                                                                                                                                                                                                   |
| `tx_hash`            | `VARBINARY` | Transaction hash                                                                                                                                                                                                                                                       |
| `evt_index`          | `INTEGER`   | Event index within the transaction                                                                                                                                                                                                                                     |
| `action`             | `VARCHAR`   | Type of trade (CLOB or AMM)                                                                                                                                                                                                                                            |
| `contract_address`   | `VARBINARY` | Exchange contract that emitted the trade (v1: CTFExchange or NegRiskCTFExchange; v2: the unified CTFExchange V2 contracts)                                                                                                                                             |
| `condition_id`       | `VARBINARY` | Unique identifier for the YES/NO pair                                                                                                                                                                                                                                  |
| `event_market_name`  | `VARCHAR`   | Overarching question for negRisk markets                                                                                                                                                                                                                               |
| `question`           | `VARCHAR`   | Concrete outcome being bet on                                                                                                                                                                                                                                          |
| `polymarket_link`    | `VARCHAR`   | Link to Polymarket page (may be broken for archived markets)                                                                                                                                                                                                           |
| `token_outcome`      | `VARCHAR`   | YES or NO token outcome                                                                                                                                                                                                                                                |
| `neg_risk`           | `VARCHAR`   | Whether this is a neg\_risk market                                                                                                                                                                                                                                     |
| `asset_id`           | `UINT256`   | ERC1155 token ID                                                                                                                                                                                                                                                       |
| `price`              | `DOUBLE`    | Price of the outcome token                                                                                                                                                                                                                                             |
| `amount`             | `DOUBLE`    | Amount in USD (v2: pUSD treated 1:1 as USD)                                                                                                                                                                                                                            |
| `shares`             | `DOUBLE`    | Number of shares transferred                                                                                                                                                                                                                                           |
| `fee`                | `DOUBLE`    | Per-trade fee in USD. v1: usually 0 (fees were not charged in practice); v2: from the OrderFilled fee field, charged per-market as `fee = C × r × p × (1 − p)`                                                                                                         |
| `maker`              | `VARBINARY` | Trader whose order is being filled                                                                                                                                                                                                                                     |
| `taker`              | `VARBINARY` | Trader filling the order (often a Polymarket exchange contract)                                                                                                                                                                                                        |
| `is_taker_side`      | `BOOLEAN`   | TRUE on the taker leg of a CLOB match (one of the two OrderFilled events per match). Filter `WHERE is_taker_side` for single-counted volume that avoids 2x double-counting                                                                                             |
| `maker_side`         | `VARCHAR`   | Side of the maker's order w\.r.t. `asset_id`: `BUY` if the maker is acquiring outcome tokens, `SELL` if releasing them. Always the inverse of `taker_side`                                                                                                             |
| `taker_side`         | `VARCHAR`   | Side of the taker's leg w\.r.t. `asset_id`: `BUY` or `SELL`. Always the inverse of `maker_side` — read the right side directly from whichever address matches your wallet                                                                                              |
| `contract_version`   | `VARCHAR`   | Exchange contract version: `v1` (original CTFExchange/NegRiskCTFExchange) or `v2` (unified CTFExchange V2, pUSD collateral; rows from April 2026 onward)                                                                                                               |
| `order_hash`         | `VARBINARY` | EIP-712 hash of the filled order, from `OrderFilled.orderHash`. Present on all contract versions; the same `order_hash` recurs across rows when one resting order is filled in multiple matches — group on it to reassemble the partial fills of a single signed order |
| `builder`            | `VARBINARY` | v2 only: builder attribution field (bytes32) embedded in signed orders. NULL for v1 rows                                                                                                                                                                               |
| `metadata`           | `VARBINARY` | v2 only: arbitrary metadata field (bytes32) in signed orders. NULL for v1 rows                                                                                                                                                                                         |
| `unique_key`         | `VARCHAR`   | Unique event/market key                                                                                                                                                                                                                                                |
| `token_outcome_name` | `VARCHAR`   | Combined token outcome and question                                                                                                                                                                                                                                    |
| `_updated_at`        | `TIMESTAMP` | When this row was last inserted or updated by the dbt pipeline                                                                                                                                                                                                         |

## Table sample

<TableSample tableSchema="polymarket_polygon" tableName="market_trades" />

## Query performance

`market_trades` is partitioned by `block_month` — always include a `block_time` or `block_month` filter. For market-specific queries, also filter on `condition_id` or `question`.

```sql theme={null}
-- ✅ Good: time-bounded with market filter
SELECT * FROM polymarket_polygon.market_trades
WHERE block_time >= NOW() - INTERVAL '7' DAY
  AND condition_id = 0x...
```

## Example query

```sql theme={null}
-- Top markets by single-counted trading volume (last 7 days)
SELECT
  event_market_name,
  question,
  SUM(amount) AS total_volume_usd,
  COUNT(*) AS num_trades
FROM polymarket_polygon.market_trades
WHERE block_time >= NOW() - INTERVAL '7' DAY
  AND is_taker_side
GROUP BY 1, 2
ORDER BY 3 DESC
LIMIT 20
```
