Websocket Reconnects Need an Execution Backfill Boundary

By DX Research Group · · Execution mechanics

Reopening a stream restores transport. A gap fixture combines historical fills, stable economic identity and a coverage-aware account reconciliation.

A restored websocket connection leaves a historical gap to reconcile. We would keep the last economically reconciled event boundary separate from connection health. Hyperliquid documents user fill subscriptions and snapshot behavior. Those messages support stream consumption; the historical coverage check still needs the account’s fill retrieval and state queries, documented in the official information endpoint.

A new connection begins with an unresolved interval

Illustrative case: a runtime reconciles fill 40 at 10:00:00, disconnects, and reconnects at 10:00:08. Fill 41 occurred at 10:00:03. The new stream reports fill 42 and a snapshot containing fill 41. A historical request also returns fills 40 and 41. The correct ledger adds each economic fill once, preserving overlap. A reconnect success marker alone would leave the agent using stale exposure during the gap. Counting every delivered row would overstate it.

Advance coverage after reconciliation

Request an overlapping historical interval, join economic identities, then reconcile open orders, positions and fees. Record requested interval, returned range and API retrieval limits. If history limits leave an uncovered interval, preserve the gap even when current exposure is known. Replay a duplicate snapshot, an empty history response and a reconnect gap longer than retained history. The next turn should distinguish current account certainty from completeness of the execution audit. A truthful partial audit is more useful than an invented uninterrupted record.

Completeness has its own state

The coverage report should show the earliest unresolved time and the oldest available historical fill. API limits can make a full replay impossible even when a fresh state query restores present exposure. In that case, allow only decisions supported by the verified current state and retain the historical completeness limitation in performance reporting. Reconnection latency and audit completeness are different measurements.

Our execution and reconciliation framework provides the broader mandate-to-outcome trace. The state and memory contract explains how the verified result should enter the next decision. These notes narrow those published methods to one execution boundary; the worked amounts above are illustrative and the test is a proposed local fixture. The source inspected for the venue-specific statements is the official Hyperliquid websocket subscriptions.

Sources

Related field notes