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

# candle

> Live OHLCV candles for one coin: built from live trades

Subscribe with `{"method":"subscribe","subscription":{"type":"candle","coin":"BTC","interval":"1m"}}` (`coin` required; `interval` one of `5s`, `30s`, `1m`, `5m`, `15m`, `30m`, `1h`, `4h`, `1d`, default `1m`). Acknowledgement uses **`subscriptionResponse`** and the current bucket is sent immediately; updates use **`CandleUpdate`** (HL candle shape `{t,T,s,i,o,c,h,l,v,n}`).

## Finality: the `closed` frame

Intermediate updates are pushed on every trade and carry the plain HL fields. About **2 seconds after `T`**, once the last block of the bucket has been applied, one more frame is sent for that bucket with two extra fields:

* **`closed: true`**: this is the final state of the bucket. Treat it as final; do not wait for further updates.
* **`reconciled`**: `true` when `h`, `l`, `v` and `n` were recomputed from the stored trades (deduplicated by trade id, the same source as `candleSnapshot`), `false` when storage was temporarily unavailable and the frame reflects the live state only. `o` and `c` follow the execution order of trades inside each block, as on Hyperliquid; they are taken from storage only when the live stream missed the first or last trade of the bucket.
* **`5s` and `30s`** buckets are always closed with `reconciled: false`: they are final at their `closed` frame, without the storage recount.

```json theme={null}
{"channel":"candle","data":{"t":1789385640000,"T":1789385700000,"s":"BTC","i":"1m",
 "o":"77709.0","c":"77697.0","h":"77717.0","l":"77686.0","v":"7.92148","n":195,
 "closed":true,"reconciled":true}}
```

Rules worth building on:

* A bucket is final when you receive its `closed` frame. If your listener stops considering a bucket at `T`, you will miss the last block: the final update can legitimately arrive up to \~1 s after `T` even before reconciliation, because blocks are timestamped when proposed and applied slightly later.
* A second `closed` frame for the same `t` supersedes the first (a trade that arrived very late on a non-reconciled bucket). Keep the last one.
* Updates for a bucket can still arrive after a newer bucket has opened. They are applied to their own bucket; a newer `t` no longer resets the previous one.
* With `allCandles`, a coin whose trades were entirely missed by the live path still gets a `closed` frame built from stored trades.


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