Price Oracles
Every perpetual market is priced by an external oracle that produces a mark price and index price. These drive margin and liquidation — they are deliberately decoupled from the last trade on the order book so that thin-book activity cannot distort risk calculations.
Funding is the deliberate exception: it is priced off the perp reference price (the volume-weighted median of recent trades on our book) measured against the index, because measuring against the mark — which is 95% index by construction — would understate the perpetual's real deviation by roughly 20×. See Funding Rates.
Sources
The oracle aggregates external reference prices for every live market (the configured set expands to 32):
Hyperliquid index feeds, polled approximately once per second, are the primary source for the markets configured to use them.
Pyth covers the rest, either as a market's single configured source or as one side of a failover pair.
Each market's mark price is published into the engine through an internal oracle service; the engine itself never makes outbound network calls on the trading path.
Freshness and deviation guards
Each market is configured with two protective thresholds (per-market, in the engine config):
Staleness
oracle_staleness_seconds = 30
A feed older than the threshold is treated as stale.
Deviation
oracle_deviation_threshold = 0.1 (10%)
A single update that jumps more than the threshold is rejected as anomalous.
A monotonic timestamp guard (ts ≥ last_update_time) rejects out-of-order updates, so a delayed packet cannot overwrite a newer price.
Fail-closed direction
The oracle is being hardened to fail closed: when a feed is stale or fails its guards, the safe behavior is to pause new risk-increasing actions in that market rather than trade on a suspect price. Staleness handling and multi-source fallback are being strengthened across the current release gates.
Status: oracle integration is live on testnet with the guards above. Formal multi-source aggregation and circuit-breaker policy are still being finalized; values and behavior may change between gates.
Last updated

