Agent-Based LOB Simulator Calibration for Slippage Stress Testing

2026-02-28 · finance

Agent-Based LOB Simulator Calibration for Slippage Stress Testing

Date: 2026-02-28
Category: research (slippage modeling)

Why this matters

Backtests usually assume a static impact curve and average fill behavior. Real execution risk, however, is generated by interacting agents: market makers widen spreads, toxic flow accelerates cancellations, and latency pockets create bursty adverse selection.

An agent-based limit-order-book (LOB) simulator gives you a way to answer:

This playbook shows how to build a calibrated, decision-useful simulator for execution operations.


1) Modeling goal (don’t simulate for simulation’s sake)

Define the exact production decision first.

Typical decision targets:

  1. Tactic selector (TWAP / POV / opportunistic passive / aggression burst)
  2. Participation cap policy by regime
  3. Kill-switch thresholds (spread blowout, cancel-rate shock, markout tail)
  4. Inventory urgency policy under time-to-close constraints

If the simulator output does not map to one of the above, trim scope.


2) Minimal agent set (practical, not academic maximalism)

Start with 4 agent families:

  1. Liquidity providers (LPs)
    • Quote both sides with inventory-aware skew
    • Pull quotes under toxicity/volatility stress
  2. Noise traders
    • Randomized child orders with intraday intensity curve
  3. Informed/metaorder flow
    • Directional child-order streams with persistence
  4. Your execution agent
    • Candidate policies to evaluate (A/B/C)

This set is usually enough to recreate spread/queue/cancel dynamics relevant to slippage control.


3) State variables and observables

Track simulator state at event time:

Use the same schema as production TCA so model-vs-live comparison is frictionless.


4) Calibration pipeline (offline)

4.1 Stylized-fact constraints

Before fitting parameters, enforce baseline realism:

If these fail, optimization can overfit target KPI while violating market physics.

4.2 Objective function

Calibrate with a weighted distance over diagnostics:

[ \min_\theta ; \sum_k w_k d_k\big(\text{sim}_k(\theta), \text{real}_k\big) ]

Where diagnostics (k):

Practical distance choices:

4.3 Search strategy

Use staged search:

  1. coarse global search (Sobol / random)
  2. Bayesian optimization over top region
  3. local refinement (CMA-ES or Nelder–Mead)

Parallelize by day/session regime (open, lunch, close, event day).


5) Regime conditioning

A single parameter set is fragile. Calibrate regime-conditioned parameter packs:

Regime labelers can be built from live observables:

Execution policy should consume regime probabilities, not hard labels.


6) Stress scenario library (the core value)

Build replayable stress templates:

  1. Cancel storm: synchronized LP quote pullback
  2. One-sided toxicity burst: directional child-flow shock
  3. Latency pocket: delayed acknowledgements + stale routing
  4. Refill failure: depth recovery half-life doubled
  5. Auction transition shock: pre-close imbalance ramp

Each scenario must report:


7) Policy evaluation design

Compare execution policies on both mean and tail:

Recommended composite score:

[ \text{Score} = \mathbb{E}[IS] + \lambda_1 \text{CVaR}_{95}(IS) + \lambda_2 \cdot \text{UnfilledPenalty} ]

Tune (\lambda) from business constraints (urgency, inventory risk, mandate).


8) Online alignment loop (prevent simulator drift)

Simulator quality decays as market microstructure shifts. Add a live loop:

  1. Daily compare live vs simulated diagnostics
  2. Raise drift alerts when thresholds breach:
    • spread KS-stat
    • cancel ratio error
    • 95p slippage gap
  3. Recalibrate parameter subset (not whole model) for stability
  4. Promote only after shadow validation

Use champion–challenger governance:


9) Guardrails to avoid false confidence


10) Production adoption checklist


Quick implementation blueprint


Bottom line

A calibrated agent-based LOB simulator is not just a research toy. It is an execution risk wind tunnel: you test policies against nonlinear liquidity feedback before real capital pays the tuition. The edge is not perfect realism; the edge is reliable policy ranking under stress.