Skip to main content
Move one historical Hyperliquid L4 order-book snapshot read from a native venue workflow to 0xArchive, and leave execution, account, and venue-control calls where they are. The example reads a snapshot from one hour ago, inside every plan’s history, including Free’s most recent 30 days.

Before you start

  • Identify one native workflow that reads historical market data.
  • Separate market-data reads from execution, account, wallet, and venue-control operations.
  • Choose one Hyperliquid market type, symbol, timestamp, and output consumer.
  • Load an API key from the runtime environment and check the selected symbol’s quality state.

Inputs

Steps

1

Mark the migration boundary

Move only the historical market-data read. Keep native execution, account state, wallet changes, and venue-control operations where they are.
2

Check the selected window

Check the exact market type, symbol, data family, and timestamp with Data quality before replacing the old read.
3

Call the 0xArchive snapshot route

L4 history starts on 2026-03-11 01:03 UTC. A timestamp older than 30 days needs Build or above, which keep the full retained archive.
4

Adapt only the market-data consumer

Preserve the returned checkpoint and reconstruction metadata. A snapshot-only consumer can use the returned state directly. A continuously updated local book still applies ordered diffs after the checkpoint.

What you get back

The Hyperliquid L4 snapshot endpoint returns an L4 snapshot object in data with checkpoint_timestamp, diffs_applied, last_block_number, bids, and asks. Each resting-order row carries the documented L4 fields, such as oid, user_address, side, price, size, and timestamp. See L4 REST semantics for reconstruction behavior. 0xArchive collects, backfills, and reconstructs the returned snapshot server-side. That removes collection work from this migration, but a consumer that maintains continuously updated state still owns the local checkpoint, ordered-diff, gap, and reconstruction handling. For ordered events instead of a snapshot, use WebSocket replay.

Compare the outputs

Compare one old output and one 0xArchive output for the same market, symbol, timestamp, and depth. Record the route, query, snapshot timestamp, checkpoint timestamp, number of applied diffs, and request ID. Confirm that the consumer does not treat a snapshot as a continuous stream.

If something fails

  • No usable coverage for the timestamp: stop the migration and choose a window that the route and quality response show as covered.
  • 401: repair the key source or header.
  • 404: check the Hyperliquid namespace and symbol format.
  • A reconstruction or gap signal: discard unsafe local state, restart from the returned checkpoint, and apply ordered diffs only after the checkpoint.
  • A mismatch with the old consumer: keep the old market-data path for comparison, inspect the exact route schema, and keep execution and account calls out of this workflow.

Saved run metadata

The zero UUID is a shape placeholder only. Replace it with the UUID returned by the route or client wrapper. native_scope_boundary lists the calls that stay on the native API.

Next step

Keep a local book current after the snapshot by applying ordered diffs with SDK reconstruction.
Last modified on October 6, 2026