Hyperliquid Mark Prices & Price Updates API
In short: the Hyperliquid mark price is what the exchange uses for margin, liquidations, TP/SL triggers and unrealized PnL. It updates about every 3 seconds and is the median of three prices:
- The oracle price plus a 150-second EMA of (Hyperliquid mid price − oracle price)
- The median of best bid, best ask and last trade on Hyperliquid
- A weighted median of Binance, OKX, Bybit, Gate and MEXC perp mid prices
That formula is for native perps. HIP-3 markets (builder-deployed perps such as tokenized stocks, commodities and indices) get their oracle and mark price inputs from the market's deployer.
This page covers the MarkPrices and PriceUpdates cubes: the current mark price, and the oracle / mark price feed behind it. Both carry HIP-3 markets only. For native perps, spot and outcome markets, take the price from Candles (the last bar's Close) or from the latest Trades. The oracle, mark and external perp prices of every perp market, native ones included, are also on SnapshotMarkets, once per snapshot (about every 12.5 minutes).
To query or stream data outside the Bitquery IDE, you need an API access token.
Follow the steps here: How to generate Bitquery API token ➤
Mark prices
MarkPrices is a state cube: one row per HIP-3 market with the latest mark price and the block it was last updated at — tokenized stocks (mkts:AAPL, xyz:GOOGL), commodities and indices. It is query-only (no subscription); for a live feed, subscribe to PriceUpdates with Kind mark.
Run it in the IDE: Hyperliquid Mark Prices ➤
query {
Hyperliquid {
MarkPrices(limit: {count: 100}, orderBy: {descending: LastTime}) {
LastBlock
LastTime
Mark
Market { Symbol Kind IsPerp Protocol CoinRaw }
}
}
}
Get one market with where: {Market: {CoinRaw: {is: "xyz:AAPL"}}}. Filter on CoinRaw, not Symbol: the same symbol is listed by several deployers (xyz:AAPL, km:AAPL, mkts:AAPL), and Symbol: "BTC" here matches HIP-3 BTC markets, not the native BTC perp. A deployer keeps publishing a mark for markets that no longer trade, so a fresh LastTime does not mean the market is active — check Trades or Candles for that.
Price updates
PriceUpdates is the event feed the mark prices are built from: every HIP-3 oracle update, one row per market and price kind. Kind is oracle, mark or extPerp for the resulting prices, and markInput, spotInput or extPerpInput for the inputs the deployer submitted; DailyPx carries the daily reference price when present. UpdateClass is Normal for prices the deployer pushes and Fallback for fallback updates; whole deployer DEXes (for example hyna, flx, km) are currently priced through fallback updates only.
Run it in the IDE: Hyperliquid Price Updates Stream ➤
subscription {
Hyperliquid {
PriceUpdates {
Block { Time }
PriceUpdate {
Kind Price DailyPx UpdateClass UpdateTime
Market { Symbol Kind }
}
}
}
}
The same shape works as a query with limit, orderBy: {descending: Block_Time} and a where filter for historical lookups, for example where: {PriceUpdate: {Kind: {is: "mark"}, Market: {CoinRaw: {is: "xyz:AAPL"}}}}. API history goes back about 30 days (for older data, ask about a Data Store export); a query without a Block: {Time: ...} filter covers the last 24 hours.
For tradeable OHLCV rather than oracle prices, and for markets outside HIP-3, use Candles: 1-minute, 5-minute, 15-minute and 1-hour bars built from taker fills, where Open and Close are the first and last fill of the bar in execution order.
Ready to run this in production?
Get an API key and run these queries in minutes, or talk to us about plans and enterprise delivery.