Definition
It is a median of three prices, not a single quote. The first is the oracle price plus a 150 second exponential moving average of the difference between Hyperliquid's mid price and that oracle price. The second is the median of the best bid, the best ask and the last trade on Hyperliquid. The third is the median of the Binance, OKX, Bybit, Gate IO and MEXC perpetual mid prices, with weights 3, 2, 2, 1 and 1. If exactly two of the three exist, the 30 second exponential moving average of the median of best bid, best ask and last trade on Hyperliquid is added to the inputs.
The documentation calls it an unbiased and robust estimate of the fair perp price, and uses it for margining, liquidations, triggering take profit and stop loss orders, and computing unrealized profit and loss. It is updated whenever the validators publish new oracle prices, so about once every 3 seconds. Trailing stops follow it rather than the book.
The point of a median of several sources is that no single one of them can decide it: a print on one venue, or one thin side of the book, is outvoted. The cost is that it is not the price you see trading. The documentation warns that in volatile times, or on a highly leveraged position, the mark price may be significantly different from the book price, and recommends the exact liquidation formula for precise monitoring. A position is judged on this price, not on the last trade that printed.
Formula
The mark price is the median of three inputs: oracle_price + ema_150s(hyperliquid_mid - oracle_price); median(best_bid, best_ask, last_trade) on Hyperliquid; and the weighted median of the Binance, OKX, Bybit, Gate IO and MEXC perpetual mid prices, with weights 3, 2, 2, 1 and 1.
Example
An example, in round figures. Suppose the three inputs read $100,050, $100,000 and $99,900. Their median is $100,000, and that is the mark price: the highest of the three carries no more weight than the others. A long of 1 BTC entered at $99,000 then shows an unrealized profit of $1,000, and its margin and its distance from liquidation are measured at $100,000 even if the last trade on the book printed at $100,050.