In one sentence
VPIN chops matched volume into equal-sized buckets and estimates how lopsided the backing versus laying is in each, as a gauge of how "toxic" or informed the current flow might be.
How it works
Every matched bet has an aggressor: the person who took a price that was already waiting. If a backer takes the price in the blue column, that trade is back-initiated; if a layer takes the price in the pink column, it is lay-initiated. Betfair does not tell you which: the Stream API gives traded volume at each price, so you infer the side from price moves and ladder changes.
When the flow is balanced, the aggressors are probably a mix of opinions. When it is heavily one-way, someone may know something.
VPIN (from Easley, López de Prado and O'Hara) measures flow in "volume time" rather than clock time. Instead of asking what happened in the last minute, it asks what happened in the last £10,000 matched. That way a quiet spell and a frantic spell are compared on the same footing.
A high VPIN means recent buckets were mostly one-sided. For someone offering prices on both sides, that is a warning that they are likely to be picked off by better-informed traders.
The maths
- V: the fixed size of each volume bucket (for example £10,000 matched).
- n: the number of recent buckets you average over.
- VτB: back-initiated volume in bucket τ (inferred, as Betfair does not label it).
- VτL: lay-initiated volume in bucket τ (inferred in the same way).
- The vertical bars mean "size of the difference, ignoring sign".
In plain English: VPIN is the average share of each bucket that was one-way traffic, from 0 (perfectly balanced) to 1 (entirely one side).
Worked betting example
A football Match Odds market before kick-off, five buckets of £10,000 matched each on the home team. The back/lay split in each bucket is inferred from price moves and ladder changes (illustrative figures):
| Bucket | Back-initiated | Lay-initiated | Gap |
|---|---|---|---|
| 1 | £6,500 | £3,500 | £3,000 |
| 2 | £5,200 | £4,800 | £400 |
| 3 | £7,800 | £2,200 | £5,600 |
| 4 | £4,900 | £5,100 | £200 |
| 5 | £8,300 | £1,700 | £6,600 |
Sum of gaps = £15,800. Total volume = 5 × £10,000 = £50,000.
VPIN = 15,800 ÷ 50,000 = 0.316.
If this team's market usually runs around 0.15, a reading of 0.32 says recent flow has been unusually one-sided. A trader offering both sides might widen their spread or step aside until it settles. It does not say which side is right.
Where it's good
- Market making: deciding when to pull or widen your offers.
- Spotting unusual one-way money, such as a team news leak before kick-off.
- In-play football, where faster pictures from the ground can create short bursts of informed flow around goals, penalties and red cards.
- As an input to anomaly detection across many markets at once.
Limitations and pitfalls
- The Stream API gives traded volume by price but not who initiated each trade, so the split must be inferred from price moves and ladder changes, which introduces error.
- The bucket size and number of buckets are arbitrary choices that change the result a lot.
- One-sided flow can be uninformed: a popular favourite attracts steady casual money that is all one way.
- The original research was on equity futures, and whether VPIN predicts anything useful has been disputed even there.
- Set the bucket size per market: £10,000 fills far faster in Premier League Match Odds than in a First Half Goals market.
- It is a warning light, not a trading strategy, and rarely pays on its own.
How to build it
- Record the Betfair stream (betfairlightweight) and classify each change in traded volume as back- or lay-initiated by comparing it with the prior best prices.
- pandas and numpy are enough to form volume buckets and a rolling VPIN.
- Tip: compare VPIN with each market's own typical level rather than using one fixed threshold across leagues and markets.
Related methods
- Informed trader models supply the theory VPIN is built on.
- Weight of money and VWAP summarise flow without asking whether it is informed.
- Order book imbalance looks at waiting money rather than matched money.
- Anomaly detection can flag VPIN spikes across many markets automatically.