QUANT_API
UTCSign inGet a key ↗
MICROSTRUCTURE · 6 min read

Microprice vs Mid: A Better Short-Term Fair Value

The midpoint ignores size. The microprice weights bid and ask by opposite-side depth and leans where the mid goes next. How to read microprice_dev, leak-free.

Ask a chart where an asset trades and it gives you the mid — the average of best bid and best ask. The mid is the most quoted and least informative price in the market: it weights a 0.1 BTC bid and a 400 BTC bid identically, throwing away everything the book is saying about pressure. The microprice keeps that information, and on second-to-minute horizons it is the better fair value.

What the microprice is

The microprice weights each side of the book by the opposite side's depth: micro = (Qb·Pa + Qa·Pb) / (Qb + Qa), where Qb and Qa are the resting sizes at best bid and ask. When the bid is stacked and the ask is thin, the microprice sits above the mid — the market is one thin offer away from ticking up, and fair value should already reflect that. The construction follows Stoikov's 2018 micro-price work, which formalises why this size-weighted value is a better short-horizon estimate of where the mid is heading than the mid itself.

  • It uses information the mid discards: resting depth at the touch is a live, costly commitment, not an opinion.
  • It is bounded between bid and ask, so it never invents a price the book could not currently support.
  • It moves before trades happen — depth changes shift the microprice even while the last trade is stale.
  • It equals the mid exactly when the book is balanced, so the deviation itself is a measure of imbalance.

microprice_dev: the deviation as a signal

QUANT_API serves this as orderbook.microprice_dev — defined as (microprice − mid) / mid — computed from L1 book snapshots on Binance and OKX. Raw magnitudes are tiny, so the transforms do the work: orderbook.microprice_dev@1m:zscore asks whether the current lean is unusual, and orderbook.microprice_grad_short tracks the short-horizon drift of the microprice itself. Read them next to orderbook.book_imbalance (the L1 size imbalance that drives the deviation) and orderbook.spread_bps (the spread that bounds it). All four are served signals in the catalog.

bash
# Microprice vs mid for BTC: the deviation, its z-score, and the book context
curl -s -G https://api.quant-api.dev/v1/features/live \
  -H "Authorization: Bearer fk_live_<secret>" \
  --data-urlencode "asset=BTC" \
  --data-urlencode "features=orderbook.microprice_dev@1s:level,orderbook.microprice_dev@1m:zscore,orderbook.microprice_grad_short@1m:level,orderbook.book_imbalance@1m:level,orderbook.spread_bps@1m:level"

A book snapshot is the most perishable data in the market: it exists for milliseconds and cannot be reconstructed from candles after the fact. If a 'microprice' is rebuilt from OHLCV or a resampled feed, it is fiction. QUANT_API computes microprice_dev from the book as it stood, and every historical value is resolved strictly from data with ts <= as_of — the deviation your backtest sees is the one that was on screen.

Where the microprice pays

Two practical uses. First, short-horizon direction: a persistently positive orderbook.microprice_dev with a rising orderbook.book_imbalance says the book is leaning up before the mid has moved — the kind of lead that matters most at the horizons covered in the BTC 5-minute guide. Second, execution: if you must cross the spread, crossing while the microprice is already against you means paying the spread and the lean. The same construction exists for prediction markets as polymarket.pm_microprice — the size-weighted fair value of the YES book.

Then test it instead of trusting it: post your own timestamps to POST /v1/features/historical and measure whether the deviation leads the mid on your assets and your horizons, point-in-time. Request shapes are in the docs; more microstructure walkthroughs in other guides.

Start free — 14-day Signal trial, no card
KEEP READING
Trading the post-liquidation-cascade reversalOrder Flow Imbalance (OFI): Why Aggressive Flow Leads PriceLeak-Free Backtesting: How to Kill Look-Ahead Bias