BTC slippage: Sinan's repo vs Alan's repo
Sinan's 0 s TOB markout vs Alan's tracked slippage, on the same trades. The whole difference comes down to which mid each one uses.
Sinan's repo reports $609 of 0 s TOB markout for the day. It measures each trade against the book just after the trade, so the trade's own impact is already priced in and slippage is understated by 70%. Measured against the book just before each trade, the same AWS data gives $2,061. Alan's repo reports $2,472, about 20% above that, because its WebSocket mid is about 200 ms old.
The two repos
Sinan's repo
- Data
- AWS data lake, the exchange's own record
- Measure
- 0 s TOB markout (Markout $ in the dashboard)
- Mid
- AWS book looked up by trade time, which lands just after the trade
- Dashboard
- arcus-dmm-sla.fly.devSLA dashboard. The slippage view runs locally.
Alan's repo
- Data
- Arcus public WebSocket feed
- Measure
- Slippage: fill price vs the mid before the trade
- Mid
- Latest WebSocket snapshot, sent every ~200 ms
- Dashboard
- Slippage dashboard
One formula, used by both
- s
- +1 for a taker buy, −1 for a taker sell
- Mid
- (best bid + best ask) ÷ 2, just before the trade
- Notional
- fill price × size
At 0 s, a markout is the same thing as slippage, so the two compare directly, provided the mid is taken before the trade. Positive means the taker paid more than the mid. Buying at the ask on a one-tick BTC book costs about 0.006 bps.
Before the trade, not after
Each trade is timestamped about 3 ms after the book update it caused. Looking the book up by that timestamp lands on the book the trade has already moved.
| Taker order 5a5a6bbee6204bd7 | Mid | Slippage | $ |
|---|---|---|---|
| Book just before the trade | 80,742.75 | +1.79 bps | $24.45 |
| Book just after (Sinan's repo today) | 80,753.60 | +0.45 bps | $6.09 |
| Alan's repo | 80,742.75 | +1.79 bps | $24.45 |
A $136,617 buy at 80,757.2 on 20 Sep, 21:15:42 UTC. It took the best ask, so the ask moved up and the mid rose $10.85 in the same update. Measured after that move, the taker looks like they paid a quarter of what they did.
The whole day, in dollars
| Mid used | Day total | vs before-trade |
|---|---|---|
| Just before the trade, by sequence number (exact) | $2,061 | — |
| 10 ms before the trade, by clock | $2,069 | +0.4% |
| At trade time, by clock (Sinan's repo today) | $609 | −70% |
| Alan's WebSocket snapshot, ~200 ms old | $2,472 | +20% |
The after-trade lookup changes the mid on 79% of trades, and 58% then look as if the taker gained, which can't happen against a live book. Taking the book by sequence number, or by clock 10 ms earlier, fixes it.
The trades are identical
All 65,052 trades match on every field.
- Trade ID
- Price and size
- Time, to the microsecond
- Side
- Buyer and seller wallets
- Notional: $37,086,281.56
What differs: the age of the mid
From here on, "Sinan" means his AWS data with the mid just before the trade. Alan's mid is the last WebSocket snapshot to arrive.
Slippage, trade by trade
Alan's repo reads high three times as often as low, so the errors don't cancel.
Older snapshot, bigger gap
Slippage by hour
Example trades
Listed by taker order ID, so each can be looked up in either repo. Mid gap = Alan's mid − Sinan's mid. Age = how old Alan's snapshot was.
Biggest overstatements
The two sells at 02:45:04: BTC fell $54 in the 0.4 s before these two sells. Alan's snapshot missed the drop. Each seller paid half a tick, not 6.8 bps.
Biggest understatements
A negative value means a fill better than the mid. That can't happen against a live book, so it points to a stale snapshot.
Costliest trades of the day
On the largest trades the two stay within about $7, except the 15:01:39 buy.
Data
Every trade, both repos, one row each. Files are on Google Drive.