QUANT_API
UTCSign inGet a key ↗
MICROSTRUCTURE · 7 min read

VPIN and Toxic Order Flow in Crypto: A Practical Guide

Understand VPIN crypto and toxic order flow: how flow toxicity spikes ahead of volatility, and how to serve flow.vpin point-in-time as a regime filter.

When liquidity dries up and price gaps, the usual explanation is "a big seller hit the book." The more useful question is why the book was thin in the first place. Often the answer is flow toxicity: the people trading against you knew something you didn't, and the market makers quoting the spread figured that out before you did. VPIN — the volume-synchronized probability of informed trading — is the standard way to put a number on that idea, and it travels surprisingly well from equities into crypto.

What VPIN actually measures

VPIN is descended from the PIN model (probability of informed trading) developed by Easley, Kiefer, O'Hara and Paperman. The original PIN estimates how much of the daily flow comes from informed traders rather than noise traders, but it requires fitting a likelihood model on trade counts. VPIN replaces that estimation with a direct, online computation: it buckets trades into equal-volume buckets instead of equal-time buckets, classifies each bucket's volume as buy- or sell-initiated, and measures the running imbalance between the two. The intuition is clean — in calm markets buys and sells roughly offset inside each bucket, so the imbalance is small; when informed participants lean one way the buckets fill lopsidedly and a high VPIN says the flow is toxic, directionally informed enough that whoever is providing liquidity is likely getting picked off.

  • Volume-clock, not wall-clock: buckets advance when a fixed quantity trades, so VPIN naturally speeds up when activity spikes.
  • It is a flow property, not a price property — VPIN can rise while price is still flat.
  • It is bounded and comparable: you can rank toxicity across assets and across time windows.
  • It is a leading-style signal: toxic flow is the cause, the volatility burst is frequently the effect.

Why flow toxicity precedes volatility

Liquidity providers are not charities. When they detect that recent flow has been one-directional and informed, they widen quotes, pull depth, or step back entirely to avoid being run over by the next informed order. That withdrawal of liquidity is precisely what makes the next shock move price further. So the sequence tends to run: toxic flow first, thin book second, realised volatility third. Measuring the first link gives you a head start on the third.

This is why VPIN is best treated as a regime input rather than a standalone trade trigger. A spike in flow.vpin is telling you the environment has become adverse-selection-heavy — a context in which mean-reversion logic gets steamrolled and tight stops get hunted. It is information about how to size and how to behave, not a buy or sell arrow.

How QUANT_API serves it

Two related signals are in the catalog: flow.vpin itself, and flow.pin_approx, a lighter-weight approximation of the classic informed-trading probability that you can read alongside it for confirmation. Both are addressed the same way as every other feature — category.signal@window[:transform] — so you can request flow.vpin@5m, smooth it with flow.vpin@15m:ewma, or rank its current reading against its own history with flow.vpin@1h:pctrank to ask "how toxic is now versus a typical hour?" The point that matters for research is that every value is computed strictly from data with timestamp <= as_of. When you pull flow.vpin for a past timestamp through POST /v1/features/historical, you get exactly the toxicity reading that was knowable at that instant — not a value quietly back-filled with information that only arrived later. That is what makes a VPIN-gated backtest honest.

A backtest is only as trustworthy as its worst-leaking feature. VPIN is especially easy to leak, because naive volume-bucketing can pull in trades that close after your decision time. QUANT_API computes the value from data with ts <= as_of, so the toxicity you read in a backtest is the toxicity you would have read live.

Building a regime filter

VPIN gets sharper when you stop reading it in isolation. Pair it with two other signals to form a simple, defensible regime gate: regime.regime_score, which summarises the broad market state, and volatility.rv_30m, the realised volatility over the last 30 minutes. The logic writes itself in plain language: when flow.vpin is elevated and regime.regime_score confirms a stressed regime, stand down or cut size — especially before volatility.rv_30m has caught up. Toxic flow with quiet realised vol is the classic "calm before the move" configuration, and it is exactly where a flow-toxicity read earns its keep.

  • Toxicity high, realised vol still low → adverse selection building; tighten risk before the move.
  • Toxicity high, regime score stressed → avoid mean-reversion entries; the book is fragile.
  • Toxicity low across windows → benign flow; normal liquidity assumptions hold.
  • Use pctrank or zscore transforms so thresholds are comparable across BTC, ETH, SOL, XRP and BNB.
bash
curl -s -X POST https://api.quant-api.dev/v1/features/historical \
  -H "Authorization: Bearer fk_live_<secret>" \
  -H "Content-Type: application/json" \
  -d '{
    "asset": "BTC",
    "timestamps": ["2026-06-09T13:00:00Z", "2026-06-09T13:05:00Z"],
    "features": [
      "flow.vpin@5m",
      "flow.vpin@1h:pctrank",
      "flow.pin_approx@5m",
      "regime.regime_score@15m",
      "volatility.rv_30m@30m"
    ]
  }'

That single request returns a point-in-time matrix you can drop straight into a research notebook: toxicity, its percentile rank, the lighter PIN approximation, the regime context and realised vol — all resolved as of each timestamp, all leak-free. From there, POST /v1/backtest lets you test the gate over history, and GET /v1/features/live resolves the same features for the present moment. See the docs for the full request shape and other guides for how these signals combine with funding and liquidation flow.

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