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

# OHLC Candles

> Per-outcome price candles built from fills, from 1-second to 4-hour buckets

> [!NOTE]
>
> OHLC candles are an **early access** dataset available through [SQL](https://docs.probalytics.io/docs/sql-guide/overview.md). To request access, email [support@probalytics.io](mailto:support@probalytics.io).

## Shape

OHLC candles are served by parameterized SQL views, one per bucket size:

| View | Bucket |
| - | - |
| `ohlc_1s` | 1 second |
| `ohlc_10s` | 10 seconds |
| `ohlc_1m` | 1 minute |
| `ohlc_5m` | 5 minutes |
| `ohlc_15m` | 15 minutes |
| `ohlc_30m` | 30 minutes |
| `ohlc_1h` | 1 hour |
| `ohlc_4h` | 4 hours |

Each view takes one market and a time range:

```sql theme={null}
SELECT *
FROM ohlc_1m(
    market_id = '00000000-0000-0000-0000-000000000000',
    start = '2026-11-01 00:00:00',
    end = '2026-11-02 00:00:00'
)
```

| Parameter | Type | Meaning |
| - | - | - |
| `market_id` | `UUID` | Market to build candles for. Joins to `markets.id`. |
| `start` | `DateTime` (UTC) | Range start. Rounded down to the bucket boundary. Inclusive. |
| `end` | `DateTime` (UTC) | Range end. Exclusive. |

The result has one row per outcome per bucket, ordered by outcome and time. Every bucket in the range is present, including buckets with no trades.

| Field | Type | Values and meaning |
| - | - | - |
| `platform` | `enum` | Source venue. |
| `market_id` | `UUID` | Probalytics market ID. |
| `market_platform_id` | `string` | Venue market ID. |
| `outcome` | `tuple` | Outcome struct, same as `fills.outcome`. |
| `timestamp` | `datetime` | Bucket start in UTC. |
| `traded` | `bool` | `true` if at least one fill happened in this bucket. |
| `open` | `decimal \| null` | First fill price in the bucket. Previous close when `traded` is `false`. |
| `high` | `decimal \| null` | Highest fill price. Previous close when `traded` is `false`. |
| `low` | `decimal \| null` | Lowest fill price. Previous close when `traded` is `false`. |
| `close` | `decimal \| null` | Last fill price, carried forward through untraded buckets. `null` until the outcome's first-ever trade. |
| `volume` | `decimal` | Sum of fill `size`. `0` when untraded. |
| `notional` | `decimal` | Sum of `taker_cash_flow`. |
| `vwap` | `decimal \| null` | `notional / volume`. `null` when untraded. |
| `buy_volume` | `decimal` | Volume where the taker bought. |
| `sell_volume` | `decimal` | Volume where the taker sold. |
| `fees` | `decimal` | Sum of fill fees. |
| `fills` | `integer` | Number of fills. |
| `first_trade_at` | `datetime \| null` | Time of the first fill in the bucket. |
| `last_trade_at` | `datetime \| null` | Time of the last fill in the bucket. |

## Construction

Candles are computed at query time from [fills](https://docs.probalytics.io/docs/datasets/fills.md), so they cover the same venues and history as fills and reflect corrections to fills immediately.

* **Ordering.** Fills with the same timestamp are ordered by on-chain block number and log index where available, so `open` and `close` are deterministic.
* **Carry-forward.** For buckets with no trades, `open`, `high`, `low`, and `close` equal the most recent close, including a close from before `start`. Volume fields are `0` and `vwap` is `null`.
* **Outcomes.** Every outcome of the market gets a row per bucket, even outcomes that never traded (all prices `null`).

## Usage tips

* Pick the largest bucket that answers your question. A day of `ohlc_1s` is 86,400 rows per outcome.
* Use `WHERE traded` to drop filler buckets when you only want real trading activity.
* `close` is a last-trade price, not a book mid. For mid prices use [`top_of_book_*`](https://docs.probalytics.io/docs/datasets/top-of-book).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.