Hyperliquid Oracle vs Mark Price: Building a Liquidation Monitor
How a liquidation monitor should combine oracle price, mark price, margin state and live positions without generating misleading alerts.
How a liquidation monitor should combine oracle price, mark price, margin state and live positions without generating misleading alerts.
Use the correct price for each decision
Last trade, mid, mark and oracle prices answer different questions. Preserve each field and its timestamp rather than collapsing them into one generic price.
Recalculate account risk
Track position size, entry, leverage mode, account value, maintenance margin and collateral. A price threshold alone cannot describe liquidation risk across cross-margin or portfolio accounts.
Stream and reconcile
Consume active asset context, user state and liquidation events over WebSocket, then periodically compare with authoritative snapshots. Pause automated action after gaps or mode changes.
Design actionable alerts
Report distance to liquidation, collateral assumptions, stale-data age and the specific position driving risk. Use warning and critical thresholds with hysteresis to prevent notification storms.
Build liquidation infrastructure
TierZero offers a Hyperliquid liquidation bot, risk dashboards and maintenance. The official subscription API provides the required feeds; contact us for implementation.
Need this in production?
Send your current stack, target chain, data providers and operational requirements through the TierZero contact page.
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