OHLCV Candle Boundaries and Empty Intervals
Build reproducible market candles with half-open intervals, deterministic trade ordering and clear treatment of empty or late-arriving periods.

Overview
When translating these concepts into an integration, keep the scope described by the wallet history api with the result. The examples in wallet transaction history and smart contract event logs show how the same distinction affects neighbouring data questions.
A candle is an aggregation over a time interval. Open and close depend on ordering, while high, low and volume depend on which trades qualify. These choices belong in the data contract.
Choose interval and order rules
Use a declared time basis and timezone, commonly UTC for technical series. A half-open interval includes its start and excludes its end. Resolve equal timestamps using stable chain position and event order where appropriate. Define volume in a named asset; summing unrelated units produces a number without a meaningful interpretation.
Worked example: a boundary trade
A trade exactly at 12:01:00 belongs to the 12:01 candle under minute intervals of [start,end). It must not also appear in the 12:00 candle. If no qualifying trade occurred at 12:02, report an empty interval or an explicitly carried-forward observation rather than inventing an executed trade.
Version revisions
Late records or corrected canonical events can revise a candle. Preserve whether values are provisional or settled, and recompute affected windows deterministically. Test a single-trade candle, equal timestamps and zero-quantity anomalies. If a chart fills gaps visually, keep that presentation separate from the underlying observed OHLCV series.
A practical acceptance test
Place trades just before and exactly at a minute boundary, including two equal timestamps with different event positions. Assert deterministic open and close and no double inclusion between adjacent candles. Add a late correction to the earlier candle and verify its revision path. An empty interval must retain the chosen gap policy without inventing executed volume.
Questions about the topic
Frequently asked questions
Is an empty candle a zero price?
No. An absence of trades is not an observed zero-valued trade.
Can candles change after initial publication?
Yes, if their declared revision policy admits late or corrected evidence.
Standards & technical documentation