Hyperliquid mark price and oracle price: how they are calculated
The mark price is the median of three prices: the oracle plus a 150-second average of Hyperliquid's premium, the median of best bid, best ask and last trade on Hyperliquid, and a weighted median of perp prices on other exchanges. The oracle price is a weighted median of spot prices, published by the validators about every 3 seconds. Mark drives margin and liquidations; the oracle drives funding.
Free key14 days of history at 60 requests a minute. Without a key, the API reaches 24 hours back.
By requesting a key you agree to the Terms and API terms; see the Privacy Policy. We may email you when your key keeps hitting its limits; you can opt out at any time.
The answer#
- Oracle price: exchange spot prices, weighted, every 3 seconds. Independent of Hyperliquid's own book.
- Mark price: a median that mixes the oracle, Hyperliquid's book and other perp markets.
- Last trade: only one input of the mark, never used on its own for liquidations.
Oracle price#
Each validator computes a weighted median of spot mid prices:
| Source | Binance | OKX | Bybit | Kraken | Kucoin | Gate IO | MEXC | Hyperliquid |
|---|---|---|---|---|---|---|---|---|
| Weight | 3 | 2 | 2 | 1 | 1 | 1 | 1 | 1 |
The oracle Hyperliquid uses is the median of the validators' prices, weighted by stake. Perps whose spot trades mostly on Hyperliquid leave out outside prices until there is enough liquidity elsewhere; perps whose spot trades mostly elsewhere leave out Hyperliquid's. On HIP-3 markets the deployer sets the oracle, see stock perps.
Mark price#
The median of:
- The oracle price plus a 150-second exponential moving average of (Hyperliquid mid minus oracle).
- The median of best bid, best ask and last trade on Hyperliquid.
- The weighted median of perp mid prices on Binance, OKX, Bybit, Gate IO and MEXC, weights 3, 2, 2, 1, 1.
When only two of the three exist, a 30-second moving average of the second input joins the median. The mark updates whenever the validators publish new oracle prices.
What each one is used for#
| Price | Used for |
|---|---|
| Mark price | Margin, liquidations, take profit and stop loss triggers, unrealized PnL |
| Oracle price | Funding rates; on HIP-3, the price the perp follows |
| Last trade | Candles and fills; one input of the mark |
How funding uses the oracle: Hyperliquid funding rates.
Read both now and in the past#
Hyperliquid returns the current values for every perp in one request:
curl -s https://api.hyperliquid.xyz/info -H 'Content-Type: application/json' \
-d '{"type":"metaAndAssetCtxs"}' | jq '.[1][0] | {markPx, oraclePx, midPx}'
# {"markPx": "73962.0", "oraclePx": "73986.0", "midPx": "73980.5"} (BTC)Ironflow keeps the history: one snapshot every 10 seconds for native perps and every 30 seconds for HIP-3, with the oracle price from 4 September 2026. No key needed for the last 24 hours:
curl "https://api.ironflow.sh/v1/mark-prices?market=BTC-PERP&order=desc&limit=1"
# {"data":[{"market":"BTC-PERP","timestamp":1794317495439,
# "mark_price":"73959","oracle_price":"73985.8", ...}]}The gap between the two in basis points is GET /v1/premium?market=BTC-PERP. On HIP-3 stock perps that is the perp against its underlying.
Questions#
How is the Hyperliquid mark price calculated?#
As the median of three prices: the oracle price plus a 150-second moving average of Hyperliquid's mid minus the oracle; the median of best bid, best ask and last trade on Hyperliquid; and a weighted median of perp mid prices on Binance, OKX, Bybit, Gate IO and MEXC (weights 3, 2, 2, 1, 1).
Which exchanges feed Hyperliquid's oracle price?#
Spot mid prices from Binance, OKX, Bybit, Kraken, Kucoin, Gate IO, MEXC and Hyperliquid, weighted 3, 2, 2, 1, 1, 1, 1, 1. Each validator takes that weighted median, and the final oracle is the stake-weighted median of the validators' prices.
How often does the oracle price update?#
Validators publish oracle prices about every 3 seconds, and the mark price updates each time they do.
Why was I liquidated when the last trade never reached my price?#
Liquidations use the mark price, not the last trade. The mark blends Hyperliquid's own book with the oracle and other exchanges, so it can cross your liquidation price without a trade there.
Where can I get historical mark and oracle prices?#
Hyperliquid's metaAndAssetCtxs request returns the current values. Ironflow's /v1/mark-prices keeps a snapshot every 10 seconds for native perps and every 30 seconds for HIP-3, with the oracle price from 4 September 2026.
Related guides#
- Hyperliquid funding rates: formula, history and API
- Hyperliquid liquidation data: history, levels and API
- Hyperliquid stock perps (HIP-3)
- Hyperliquid API endpoints: which one to use
References#
- Hyperliquid docs: Robust price indices. The mark price inputs and what the mark is used for.
- Hyperliquid docs: Oracle. Sources, weights and the 3-second cadence.
Free key14 days of history at 60 requests a minute. Without a key, the API reaches 24 hours back.
By requesting a key you agree to the Terms and API terms; see the Privacy Policy. We may email you when your key keeps hitting its limits; you can opt out at any time.