Data Gap Handling

Detect, classify, and recover from gaps before you backtest, alert, or monitor.

Checks
Freshness and continuity
Replay
Gap handling over WebSocket
For
Backtests and monitors

Detect

Use these routes to confirm whether a missing window is expected, degraded, or actually broken.

Route

/v1/data-quality/coverage/{exchange}/{symbol}

Check a symbol window and see whether 0xArchive has already detected missing data.

Route

/v1/data-quality/incidents

See whether the missing window lines up with a known incident before you assume bad ingest.

Route

/v1/data-quality/status

Use system health to separate venue-wide lag from a symbol-specific problem.

Route

/v1/{exchange}/freshness/{symbol}

Read lag in milliseconds and decide whether the stream is still usable right now.

Classify

Read the normal cadence for each data type before you call a quiet window a gap.

Data typeGap thresholdReason
Orderbook2 minutesHistorical books should update far more often than this.
OI / Funding2 minutesThese series normally refresh around once per minute.
Trades60 minutesLow-volume symbols can still have natural quiet periods.
Candles2 minutesCandles roll from trades and should appear on time.
Liquidations60 minutesLiquidations are event-driven and naturally sparse.

Recover

Detect the gap, classify the cause, then decide whether to skip, retry, or annotate the window.

1

Detect the gap

Use coverage, incidents, freshness, or replay gap events to confirm the missing window is real.

2

Classify the cause

Separate known incidents and natural quiet periods from actual continuity failures.

3

Recover or mark it

Retry later, skip the window, or annotate the gap before the data reaches backtests or monitors.

Monitoring rules

Run these checks before the gap reaches monitors, alerts, or backtests.

Incidents first

Read the incident feed before you debug

Known incidents are the fastest way to separate broken ingest from expected venue trouble.

Cadence

Read the normal cadence before you call it a gap

Coverage tells you the usual update interval, which is better than guessing from one quiet window.

Backtests

Pre-check the full target window

Query coverage before the backtest starts so you can skip or mark bad windows up front.

Replay

Handle gap_detected in the main consumer

Replay gap events belong in the same recovery path as the replay data itself.

Completeness

Treat completeness as a guide

Sparse trades can still be valid. Do not treat every quiet series as broken.