WebSocket backtesting uses replay to support research, reconstruction, and strategy evaluation, not only a generic historical command list. Backtesting needs reproducible inputs. Use REST history when records can be retrieved and ordered after the fact. Use WebSocket replay when event cadence, sequence, local book state, or gap handling is part of the test.Documentation Index
Fetch the complete documentation index at: https://docs.0xarchive.io/llms.txt
Use this file to discover all available pages before exploring further.
REST History Versus Replay
| Need | Better fit |
|---|---|
| Pull trades for a bounded window | REST history |
| Rebuild a local order book in event order | WebSocket replay |
| Test strategy reaction to event cadence | WebSocket replay |
| Compare daily funding or OI values | REST history |
| Reproduce an incident stream | WebSocket replay |
| Generate a static research file | REST history unless sequence matters |
Backtest Input Contract
Name the route family
Store Hyperliquid core, Hyperliquid Spot, HIP-3, HIP-4, or Lighter explicitly with the backtest.
Bound the replay window
Use explicit start, end, channel, symbol, and speed values. Avoid endless replay jobs.
Replay Example
Run Metadata
Store the same metadata with every replay-backed test so results can be compared later.| Field | Example |
|---|---|
| Purpose | btc_orderbook_reaction_test |
| Venue family | hyperliquid_core |
| Symbol and channels | BTC, orderbook, trades |
| Window and speed | 1681516800000 to 1681603200000, speed 10 |
| Quality checks | status, coverage, incidents, and freshness routes run before the replay |
| Gap policy | fail run, mark partial, or rebuild from checkpoint |
| Output location | JSONL, Parquet, notebook artifact, or database table |
| Code version | strategy commit, notebook hash, or generated-client version |