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

> Polymarket hourly OHLCV candles per outcome token — markets and Combos — with VWAP, volume, forward-fill, and exact settlement pinning.

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.ohlcv_hourly` table provides hourly OHLCV (Open-High-Low-Close-Volume) candles per Polymarket outcome token — two rows per market or combo, one per side — with VWAP and volume metrics. It covers regular markets **and Combos** (multi-leg parlays) across the full Polygon trading history.

No-trade hours are forward-filled (prices carried forward, volumes zeroed). Settlement is exact: a decided combo's final bar (at its decision hour) and a resolved market's bars past `market_end_time` are pinned to the settlement value — 1/0 per side, 0.5 for 50/50 markets, the payout fraction for `partial` combos — so every candle preserves `low <= {open, close} <= high`.

## Table Schema

| Column              | Type        | Description                                                                                                                                                                                                    |
| ------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `block_month`       | `DATE`      | UTC month partition derived from `hour`                                                                                                                                                                        |
| `hour`              | `TIMESTAMP` | UTC hour bucket for the candle                                                                                                                                                                                 |
| `market_id`         | `VARCHAR`   | ID of the market or combo as a `0x...` string, shared by its two sides: `condition_id` for markets, `combo_condition_id` for combos                                                                            |
| `market_name`       | `VARCHAR`   | Market question text; for combos the generated `combo_name`, NULL unless every leg is labeled                                                                                                                  |
| `outcome`           | `VARCHAR`   | YES or NO token outcome (a combo Yes pays out only if every leg wins)                                                                                                                                          |
| `category`          | `VARCHAR`   | Market category tags from market details; NULL for combos                                                                                                                                                      |
| `open`              | `DOUBLE`    | First trade price in the hour (0–1 scale). Forward-filled for no-trade hours; pinned to the settlement value once decided                                                                                      |
| `high`              | `DOUBLE`    | Highest trade price in the hour. Forward-filled for no-trade hours; pinned to the settlement value once decided                                                                                                |
| `low`               | `DOUBLE`    | Lowest trade price in the hour. Forward-filled for no-trade hours; pinned to the settlement value once decided                                                                                                 |
| `close`             | `DOUBLE`    | Last trade price in the hour (0–1 scale). Forward-filled for no-trade hours; pinned to the settlement value once decided                                                                                       |
| `vwap`              | `DOUBLE`    | Volume-weighted average price. NULL for forward-filled (no-trade) hours                                                                                                                                        |
| `volume_contracts`  | `DOUBLE`    | Total shares traded in the hour. Zero for forward-filled hours                                                                                                                                                 |
| `volume_usd`        | `DOUBLE`    | Total USD notional volume in the hour. Zero for forward-filled hours                                                                                                                                           |
| `trade_count`       | `BIGINT`    | Number of trades in the hour. Zero for forward-filled hours                                                                                                                                                    |
| `market_end_time`   | `TIMESTAMP` | Market end time from market details; for combos the decision time (first lost leg, or last leg resolved), which bounds the fill                                                                                |
| `market_outcome`    | `VARCHAR`   | How it resolved: `yes`, `no`, `50/50` (markets), `partial` (combos with a 50/50 leg); `unresolved`/NULL while open                                                                                             |
| `event_market_name` | `VARCHAR`   | Overarching event name for negRisk markets; NULL for combos                                                                                                                                                    |
| `is_forward_filled` | `BOOLEAN`   | TRUE if this row was generated by forward-fill (no trades in this hour)                                                                                                                                        |
| `token_id`          | `UINT256`   | ID of this outcome token: the CTF token ID for markets, the v3 position ID for combos. Joins `market_details`, `combo_details` and positions on `token_id`, and `market_trades` / `combo_trades` on `asset_id` |
| `_updated_at`       | `TIMESTAMP` | When this row was last inserted or updated by the dbt pipeline                                                                                                                                                 |

## Table sample

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

## Example query

```sql theme={null}
-- Hourly candles for one market's YES side, last 7 days
SELECT
  hour, open, high, low, close, vwap, volume_usd
FROM polymarket_polygon.ohlcv_hourly
WHERE market_name = 'Will X happen by Y date?'
  AND outcome = 'Yes'
  AND hour >= NOW() - INTERVAL '7' DAY
ORDER BY hour
```
