neofinance

How perp exchanges derive the mark price

Liquidations and unrealised PnL on perpetual futures run off the mark price, not the last trade. Each graph below rebuilds one venue’s mark live in your browser from its public feeds, step by step, and checks the result against the number the venue publishes.

connecting
Mark (Binance)—
Price Index—
Last trade—
Rule—
Rebuild errorwarming 0/30s

Loading graph…

The rule on Binance

Mark = median( Price 1, Price 2, Contract Price )

Price 1  = Index × (1 + last funding rate × time to next funding / funding period)
Price 2  = Index + MAn( (bid₁ + ask₁)/2 − Index ),  one sample per second
Contract = last traded price on the perpetual

n is 30 samples (30 seconds) for crypto perps and 60 for TradFi perps. Taking the median means no single input — one spiky trade, say — can set the mark on its own.

Live marks, side by side

BinanceOKXHyperliquid
BTC
NVDA

BTC on Hyperliquid and xyz:NVDA are quoted in USDC; the rest in USDT. Tap a cell to open its graph.

Three venues, three philosophies

BinanceOKXHyperliquid
Shapemedian of 3: funding-adjusted index, index + basis MA, last tradeindex + basis MA (no median)median of 3: oracle + basis EMA, book median, other venues’ perps (BTC) or oracle (NVDA)
Smoothingsimple MA, 30 s crypto / 60 s TradFinot published; fits a ~10 s EMA150 s time-weighted EMA
Last trade used?yes, as one median inputnoyes, inside median(bid, ask, last)
BTC referenceweighted avg of 8 spot venuesweighted avg of 5 spot venues (USD pairs converted)weighted median of 7 spot venues, by validators
NVDA referencedxFeed, Kaiko, Pyth Pro ÷ USDT/USD, + own perpPyth, Kaiko, Ondo + Binance’s and Bybit’s indexes, Hyperliquid’s oracle, own perptrade.xyz relayer: external price 24/5, book-driven EWMA when closed
NVDA off-hoursEWMA modes by session; weekends from own bookleans on own contract + other venues; held within 10% of vendor stock priceoracle drifts toward impact prices, τ = 30 min; mark within ±10% discovery bound
Update cadence1 ssub-second pushes~3 s

Right now: US overnight session (read from the New York clock; exchange holidays not applied). Some venues also feed each other: OKX’s NVDA index includes Binance’s index and Hyperliquid’s oracle, and Hyperliquid’s BTC mark includes Binance’s and OKX’s perp prices. Venue fallbacks for missing data (Binance’s “last price protected”, Hyperliquid’s 30 s book EMA when an input is missing) are described but not modelled.