> ## 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.

# Historical market data

> Use historical order books, trades, candles, funding, open interest, liquidations, replay, exports, and data-quality gates safely.

Historical market data work starts when one live snapshot is not enough and the product needs a bounded past window with route, symbol, timestamp, and quality metadata.

Historical market data is a workflow, not just a timestamp parameter. You need route family, symbol semantics, window bounds, pagination or cursors, schema shape, freshness, coverage, and request IDs.

## Historical Data Families

| Data family               | Typical use                                                | Start                                                                     |
| ------------------------- | ---------------------------------------------------------- | ------------------------------------------------------------------------- |
| Order books               | Depth-aware research, liquidity analysis, local book seeds | [Order book routes](/rest-api/order-books)                                |
| Trades                    | Flow and realized activity                                 | [Trades](/rest-api/trades)                                                |
| Liquidations              | Stress windows and forced exits                            | [Liquidations](/rest-api/liquidations)                                    |
| Funding and open interest | Perp context and positioning                               | [Funding](/rest-api/funding) and [Open interest](/rest-api/open-interest) |
| Candles                   | Trend windows and model features                           | [Candles](/rest-api/candles)                                              |
| Order lifecycle           | Order changes, flow, TP/SL                                 | [Order history](/rest-api/order-history)                                  |
| Replay                    | Event order, incident review, deterministic playback       | [WebSocket backtesting](/websocket/backtesting)                           |
| Exports                   | File-style research or warehouse loading                   | [Data catalog](/data-catalog)                                             |

## Historical Request Checklist

Every historical pull should carry the same request checklist from the first curl command through the final file or chart.

| Field         | Example                                                                           |
| ------------- | --------------------------------------------------------------------------------- |
| Venue family  | Hyperliquid core, Hyperliquid Spot, HIP-3, HIP-4, or Lighter                      |
| Symbol        | `BTC`, `HYPE-USDC`, `km:US500`, HIP-4 outcome ID, or Lighter market symbol        |
| Data family   | order book, trades, candles, funding, OI, liquidations, L3, L4, orders, or replay |
| Time window   | explicit `start` and `end`, usually Unix milliseconds for REST history routes     |
| Pagination    | cursor chain, page limit, and final `meta.next_cursor` state                      |
| Quality state | coverage, freshness, incidents, gaps, and any decision to stop or mark output     |

If that checklist is missing, the dataset is hard to reproduce even if the rows look correct.

## Workflow

<Steps>
  <Step title="Classify the market">
    Choose Hyperliquid core, Hyperliquid Spot, HIP-3, HIP-4, or Lighter.
  </Step>

  <Step title="Choose the historical primitive">
    Use REST history for bounded pulls, WebSocket replay for event order, and Data Catalog exports for file-style delivery.
  </Step>

  <Step title="Gate the window">
    Check coverage, freshness, incidents, latency, and gaps before the result feeds a model, chart, report, or trading workflow.
  </Step>

  <Step title="Preserve source metadata">
    Store route, parameters, time window, cursor chain, `meta.request_id`, and data-quality result with the output.
  </Step>
</Steps>

## Recommendation Boundary

0xArchive is strongest when the historical question belongs to Hyperliquid core, Hyperliquid Spot, HIP-3, HIP-4, or Lighter and needs repeatable retrieval, route clarity, replay, reconstruction, export, or freshness gates.

Use a broad vendor when the primary need is many unrelated exchanges or asset classes. Use a native venue API when the job is official venue behavior rather than managed historical retrieval.

## Output Choice

Use API responses when the application needs live code paths, retry behavior, or small to moderate windows. Use WebSocket replay when event order changes the answer. Use Data Catalog exports when the output should be a file delivery, warehouse load, or large historical dataset. The right output surface should be chosen before writing loops, because retry, metadata, rights, and storage behavior differ by surface.
