Order-Book Entropy + Cancel-Shock Slippage Early-Warning Playbook
Date: 2026-02-26
Category: Research (Execution / Slippage Modeling)
Scope: Intraday equity execution (KR-focused, but portable)
Why this model exists
Most slippage controllers react too late.
They usually wait for one of these to happen:
- realized spread widening,
- markout deterioration,
- repeated passive misses,
- or quote fade already visible in top-of-book.
By then, the order is often already paying the tax.
This playbook builds an early-warning layer for slippage using two leading signals:
- Order-book entropy collapse (depth becomes concentrated/fragile),
- Cancel shock bursts (visible liquidity evaporates faster than normal replenishment).
Core idea: treat displayed liquidity as perishable inventory. When structure fragility appears before price moves, execution mode should de-risk preemptively.
Conceptual model
We define a latent state variable:
[ S_t \in {\text{Stable}, \text{Fragile}, \text{Toxic}} ]
State transitions are driven by:
- microstructure stress features (entropy, cancellation pressure, imbalance acceleration),
- short-horizon volatility and spread drift,
- local fill-hazard deterioration.
The controller maps state to execution policy:
- Stable → passive-first, queue improvement allowed.
- Fragile → reduce quote persistence, tighten participation caps, avoid overexposure at stale levels.
- Toxic → protect tail (q95/CVaR), prioritize completion certainty over rebate theater.
Signal design
1) Order-book entropy
For each side (bid/ask), take top (L) levels with normalized depth weights:
[ p_{i,t}^{(side)} = \frac{q_{i,t}^{(side)}}{\sum_{j=1}^{L} q_{j,t}^{(side)}} ]
Shannon entropy:
[ H_t^{(side)} = -\sum_{i=1}^{L} p_{i,t}^{(side)} \log p_{i,t}^{(side)} ]
Interpretation:
- High entropy: depth is distributed across levels (more robust shape).
- Low entropy: depth concentrated in few levels (more brittle to cancellations/sweeps).
Use an intraday z-score by symbol-time bucket:
[ Z^H_t = \frac{H_t - \mu_{H, bucket}}{\sigma_{H, bucket}} ]
Focus on entropy drop velocity as an early warning:
[ \Delta H_t^{(k)} = H_t - H_{t-k} ]
Large negative (\Delta H) often precedes slippage bursts.
2) Cancel shock index (CSI)
Define per-window cancel and add flow (message-level or L2 diff based):
- (C_t): canceled displayed volume,
- (A_t): newly added displayed volume,
- (T_t): traded (executed) volume.
A robust shock statistic:
[ CSI_t = \frac{C_t - \lambda A_t}{\epsilon + T_t + \eta A_t} ]
with tuned (\lambda, \eta) to discount healthy replenishment.
Then standardize by bucketed history:
[ Z^{CSI}t = \frac{CSI_t - \mu{CSI,bucket}}{\sigma_{CSI,bucket}} ]
A high positive (Z^{CSI}) means liquidity is being withdrawn disproportionately fast.
3) Coupled fragility score
Construct a composite score:
[ F_t = w_1(-Z^H_t) + w_2 Z^{CSI}t + w_3 |\Delta I_t| + w_4 \Delta s_t + w_5 \hat{\sigma}{short,t} ]
where:
- (\Delta I_t): imbalance acceleration,
- (\Delta s_t): spread widening speed,
- (\hat{\sigma}_{short,t}): short-horizon realized volatility proxy.
This score is a feature (not final decision). Final state should be produced by a probabilistic model.
Modeling stack
A. State classifier (fast path)
Train a 3-class model for (S_t):
- LightGBM/CatBoost for tabular low-latency inference,
- class-balanced focal loss to emphasize rare toxic windows,
- probability calibration (temperature scaling or isotonic).
Output:
[ P_t = \big(P(Stable), P(Fragile), P(Toxic)\big) ]
B. Tail slippage model (risk path)
Separately model conditional tail cost (e.g., next 30-120s expected IS quantiles):
- quantile regression (q50/q90/q95),
- optional EVT tail fit above high threshold for stress windows.
This path gives the controller risk budget updates.
C. Transition smoothing
Avoid mode flapping with a sticky transition filter:
- Hidden Markov smoothing or
- explicit hysteresis rules on calibrated probabilities.
Example:
- enter Toxic if (P(Toxic)>0.62) for 2 consecutive windows,
- exit Toxic only if (P(Toxic)<0.40) for 3 windows.
Labeling strategy
Define slippage target relative to decision/arrival benchmark:
[ Y_{t,h} = \text{IS}_{t \to t+h} \quad (h \in {30s, 60s, 180s}) ]
Label regimes from forward outcomes + local microstructure context:
- Stable: low tail slippage and normal fill hazard,
- Fragile: moderate deterioration, elevated cancellation pressure,
- Toxic: top-decile (or stricter) forward slippage and/or severe fill collapse.
Important: use purged temporal splits to avoid leakage from overlapping horizons.
Online controller
Let (B_t) be remaining slippage budget (bps) for the parent order.
Policy template
- Infer state probabilities and tail forecasts every (\Delta) seconds.
- Update expected budget burn:
[ \hat{b}t = f\big(P_t, \hat{q95}{slip,t}, participation_t\big) ]
- Map to action mode:
Mode A (Stable)
- passive skew enabled,
- wider patience timeout,
- normal participation ceiling.
Mode B (Fragile)
- reduce passive dwell time,
- tighter cancellation/replace thresholds,
- cap participation ramp rate.
Mode C (Toxic)
- prioritize certainty and inventory-risk reduction,
- hard cap on quote lifetime,
- optional venue quarantine if cancel shock is venue-local,
- invoke "tail guard" when projected budget breach probability exceeds threshold.
- If projected (B_t) breach risk > limit, force defensive completion protocol.
Feature table (production minimum)
- Entropy features:
- bid/ask entropy level and slope,
- entropy asymmetry,
- entropy recovery half-life after shock.
- Cancel dynamics:
- cancel/add ratio,
- CSI z-score,
- burst duration and inter-burst interval.
- Book/price coupling:
- microprice drift,
- spread speed,
- imbalance acceleration.
- Execution context:
- own participation rate,
- queue-age of resting orders,
- recent fill hazard and reject rate.
- Session controls:
- open/close auction proximity,
- lunch/low-liquidity bucket,
- venue/session state (KRX/NXT/VI guard).
Evaluation framework
Offline
- Primary: q95 IS reduction vs baseline schedule/router.
- Secondary:
- fill shortfall,
- opportunity-cost drift,
- mode-switch frequency (stability metric),
- calibration error of (P(Toxic)).
Use block bootstrap by day and symbol cohort.
Shadow/live
- Run controller in shadow first (decision logging only),
- compare counterfactual actions via replay where possible,
- then staged capital rollout:
- phase 1: low ADV names excluded,
- phase 2: medium liquidity,
- phase 3: full universe with guardrails.
Hard stop triggers:
- toxic false-negative spike,
- mode-flap explosion,
- unexplained underfill > threshold.
Drift & reliability guards
- Population stability index for key features (entropy, CSI).
- Probability calibration monitor by session bucket.
- Feature-latency SLO: stale feature stream automatically degrades to safe fallback policy.
- Fallback policy must be explicit, deterministic, and tested.
If entropy input is delayed or malformed, do not keep using stale fragility scores.
Practical implementation notes
- Compute entropy from a fixed level depth tensor (e.g., top 5 or top 10); avoid variable-level artifacts.
- Bucket normalization by symbol + time-of-day is mandatory (open/close dynamics differ materially).
- Exclude auction-cross prints from continuous-book feature windows unless intentionally modeled.
- For KR deployment, align with KRX/NXT session boundaries and VI states before acting on signals.
Pseudocode
for each decision_tick t:
x_t = build_features(book, trades, cancels, adds, own_exec)
p_state = clf.predict_proba(x_t) # stable/fragile/toxic
q95 = tail_model.predict_quantile(x_t, q=0.95)
state = hysteresis_filter.update(p_state)
burn = burn_model(state, q95, participation, remain_qty)
if breach_prob(slippage_budget, burn) > TH_BREACH:
mode = "TOXIC_DEFENSIVE"
else:
mode = policy_map(state)
action = execution_policy(mode, market_state, remain_qty)
send(action)
What this improves (if done right)
- Lower p95 slippage in cancellation-driven stress windows,
- fewer late panic transitions,
- better distinction between temporary noise and genuine liquidity withdrawal,
- clearer operator diagnostics ("why did we switch mode?").
This is not a magic predictor. It is a risk-aware timing layer that moves decisions earlier, when adaptation is still cheap.
Next experiments
- Venue-local CSI decomposition to isolate one-venue liquidity failures.
- Cross-impact extension for portfolio baskets (fragility contagion across names).
- Conformal risk envelope around toxic probability for stronger online coverage guarantees.
- Joint optimization of slippage tail + underfill penalty via constrained MPC.
One-line takeaway
If your slippage model only reacts after spread and markout already blow out, you are paying tuition; entropy collapse + cancel shocks let you switch regimes before the bill arrives.