Microstructure guide

Order-Flow Imbalance (OFI), Explained

Order-flow imbalance (OFI) measures the net pressure from changes at the top of the order book — bids and asks being added or pulled — and is one of the strongest short-horizon predictors of price moves.

The intuition

Order-book imbalance is a snapshot — how lopsided the resting liquidity is right now. Order-flow imbalance is the movie: it tracks the flow of changes at the best bid and ask. Bids being added or asks being pulled is buy pressure; bids being pulled or asks piling on is sell pressure. Cont, Kukanov & Stoikov showed that short-horizon price changes line up almost linearly with this flow — often better than trade volume does.

−100 · sell flowbuy flow · +100
+59 Buy pressure · cumulative OFI
bid + +14
+
ask − +12
+
bid + +10
+
ask + -6
+
bid + +16
+
ask − +13
=
OFI +59
● auto

Pick a flow regime — bid adds and ask pulls push OFI positive; bid pulls and ask adds push it negative. The events sum to net pressure.

Order-flow imbalance
OFI = Σ eₙ (over the interval)

Each eₙ is a signed change in best-quote size: a bigger bid or a smaller ask counts positive (buy pressure); a smaller bid or a bigger ask counts negative. Sum them over a window and you get net pressure.

How vyx uses it
live
variable ofi
ofi >= highest(ofi, 30) && imb >= 15

OFI is live as the ofi variable, computed from the depth-diff stream and sampled across the candle. Because its scale varies by symbol, pair it with lookback — ofi >= highest(ofi, 30) flags a 30-candle extreme — and confirm with book imbalance. That is exactly the built-in *OFI Pressure* signal.

See it on the live map
Worked example
  1. 1 Best bid keeps getting refilled while resting asks are pulled.
  2. 2 Each refill/pull adds positive eₙ → OFI climbs.
  3. 3 Net: strong buy-side flow → short-term upward pressure, often before it shows in price.
Honest limits

OFI is a short-horizon edge that decays fast and is noisy sub-second — vyx samples it on the same ~1s cadence as the rest of the book. It is context, not a standalone trade trigger; it shines as one indicator inside a confluence signal.

Further reading

  • Cont, Kukanov & Stoikov — “The Price Impact of Order Book Events” (2014)
  • Cartea, Jaimungal & Penalva — Algorithmic and High-Frequency Trading

Related

FAQ

Is order-flow imbalance the same as order-book imbalance?

No. Order-book imbalance is the static snapshot of how lopsided resting liquidity is. Order-flow imbalance is the flow of changes to that book over time — additions and cancellations at the best quotes.

Why is OFI considered predictive?

Empirically, short-interval price changes track net order-book flow closely (Cont et al.). Liquidity providers reveal intent by adding and pulling quotes before trades print, so OFI can lead price on short horizons.

See it on the live map

Scan order-book pressure across 300+ Hyperliquid markets in real time.

Open vyx