> ## 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, and trader addresses.

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.

## Table Schema

| Column               | Type        | Description                                        |
| -------------------- | ----------- | -------------------------------------------------- |
| `block_number`       | `BIGINT`    | Block number                                       |
| `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` | Contract address (CTF exchange or neg risk module) |
| `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                            |
| `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                                      |
| `shares`             | `DOUBLE`    | Number of shares transferred                       |
| `fee`                | `DOUBLE`    | Fees to Polymarket (currently not enabled)         |
| `maker`              | `VARBINARY` | Trader whose order is being filled                 |
| `taker`              | `VARBINARY` | Trader filling the order                           |
| `unique_key`         | `VARCHAR`   | Unique event/market key                            |
| `token_outcome_name` | `VARCHAR`   | Combined token outcome and question                |

## Table sample

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

## Query performance

`market_trades` is a view — always include a `block_time` 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 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
GROUP BY 1, 2
ORDER BY 3 DESC
LIMIT 20
```
