Hyperliquid Fill Reconciliation: Matching Orders, Fills and Positions
Local bot state is a decision cache; the exchange remains authoritative after disconnects and timeouts.
Hyperliquid Fill Reconciliation: Matching Orders, Fills and Positions
Local bot state is a decision cache; the exchange remains authoritative after disconnects and timeouts.
Model the failure correctly
Ingest fills with an overlapping cursor window and deduplicate by stable exchange identifiers.
Collect evidence
Compare desired orders, observed open orders, recorded fills, and authoritative positions.
Build the control path
Apply each fill once in the same database transaction as inventory and PnL projection updates.
Handle edge cases
Treat an absent order as ambiguous until fills or a terminal state explain it.
Recovery procedure
Pause risk-increasing actions when unexplained position divergence exceeds a threshold.
Production metrics
Track oldest unresolved order, ingestion delay, duplicates, position delta, and repair frequency.
TierZero can help implement or review this architecture through our relevant engineering service.
Primary reference
See the official technical documentation and pin the exact API behavior used by your deployment.
Building this for production?
We turn this architecture into tested, non-custodial software with monitoring, documentation and deployment support.
Related technical guides
Hyperliquid WebSocket API Guide: Reliable Low-Latency Bot Setup
Build a production Hyperliquid WebSocket client for books, trades and user events with heartbeats, reconnects, snapshot recovery and latency monitoring.
Read articleCash-and-Carry Basis Trade on Hyperliquid: Step-by-Step
A practical walkthrough of executing a cash-and-carry basis trade using Hyperliquid perps shorted against spot — covering margin requirements, roll timing, and cross-venue execution to lock in the basis spread as near-risk-free yield.
Read articleHow to Capture Funding Rates on Hyperliquid Perps Profitably
A production engineer's guide to running delta-neutral funding-rate capture on Hyperliquid — covering the hourly funding mechanism, pair selection by historical yield, rebalancing triggers, and the real costs that determine whether the trade is worth running.
Read article