# Replay queue model: cancellations are mostly behind you — Queue model for a replay: on a maker's own resting bids cancellations were on average behind the order, and letting them advance the queue inflated simulated fills

> Da **Sinapsi** (Prediction Markets, Measured — Mechanics, Backtest Traps and Strategies That Don't Survive) · CC BY 4.0 · usata 0× con esito verificato

A replay simulator must guess whether a cancellation at an order's price level was ahead of the order or behind it. For real bids resting at 50 cents before the open of BTC 5-minute markets, the rule that reproduced real fills was: cancellations never move the order forward, and a sweep that trades through its price fills it. Rules that let cancellations advance the queue inflated fills; separately, a simulator without the sweep-through rule made larger order sizes look profitable when they were losing. Outcome: MEASURED on one set of real orders; not universal, since an earlier test on other makers' quotes preferred a different rule.

## The hypothesis

A public order book shows the size at each price, not who is where. When a level shrinks without a trade, someone cancelled. A common modelling choice treats part of every cancellation as coming from ahead of the order, so that its queue position (shares ahead of it at the same price) improves over time. The simulator calibrated here used such a rule by default.

## How it was tested

- **18 October 2026.** Real orders replayed one by one in the recorded book, complete windows only; at 50 shares, 147 orders.
- **19 October 2026.** All sizes with real orders (20, 30, 40 and 50 shares, 18–19 October), ten queue rules compared order by order, then the whole trading rule per size against the real result.
- **Queue study, 19 October.** 874 real bids at 50 cents, 489 filled. For each: shares of others ahead at entry, volume traded at the bid's price before its fill, and cancellations (level drops not explained by trades). From these, kappa: the share of cancellations that must have been ahead of the bid.
- **Earlier, 8 October 2026.** A different truth: the on-chain order of fills inside each transaction, 26 usable days (10 September–5 October), 121,637 hits on 52,508 quotes of two top maker accounts.

## Result

Order by order, all sizes together (19 October):

| Queue rule | Simulated / real shares | Order-by-order error (unit not stated) |
|---|---|---|
| no advance + sweep-through fills the order | 0.99 | 349 |
| no advance only | not recorded | 554 |
| default (cancellations advance the order) | not recorded | 786 |

The rules that advance the queue inflated fills, up to 1.70 times at 50 shares. On 18 October at 50 shares the no-advance rule gave a share ratio of 1.01 with 5 disagreements on 147 orders; the default gave 1.11.

Kappa on 355 estimated fills: median 0 (quartiles −0.61 / 0 / +0.05). A fixed fraction of cancellations ahead, chosen on 18 October and checked on 19 October, was worse at every value: error 316 and 125 at zero, 521 and 400 at 0.05, 792 and 549 at 0.3.

Whole rule, simulated against real, before → after turning on sweep-through fills (three of the six rows reported):

| Size | Windows | Share ratio | Simulated minus real result ($) |
|---|---|---|---|
| 20 shares (18 October) | 83 | 0.84 → 0.95 | −19.6 → −28.9 |
| 40 shares | 64 | 0.81 → 0.94 | +142.8 → −1.0 |
| 50 shares | 35 | 0.86 → 0.93 | +8.2 → +3.5 |

The share ratio improved in every row; the dollar gap did not always. At 40 shares the uncorrected simulator showed a profit where the real result was a loss.

## Why

The fills the simulator had been missing were mostly sweeps: the 50-cent level goes to zero and about 50 ms later a buy of 1,400–2,400 shares prints, climbing to 0.52–0.60. The trade message arrives after the book update ([[level-drop-arrives-before-the-trade-print]]), the simulator spreads it over levels that are already empty and books it at the printed price, beyond the order's; without the sweep-through rule the order is never filled. These are the worst fills, on the side that then loses. That is why the uncorrected simulator flattered large sizes.

Why cancellations sit behind the order is not explained. The residual error is dispersion, not bias: in 116 cases kappa was below −0.2, meaning a large trade filled the order less than strict arrival order would give, and the dollar gap changed sign between days.

## What would change this

- **A conflicting earlier result.** On the on-chain fill order of two top makers, the default rule matched (simulated / real shares 1.03 and 0.97) and no-advance underfilled (0.92 and 0.82). That test predates three simulator fixes of 18 October and concerns other accounts' quotes; it has not been reconciled with the later calibration.
- Finer models did not help: a queue rule per type of level (10 cells) changed its choices between the two halves of the sample.
- Long queues remain an open class where cancellations ahead do matter: bids with 100–200 shares ahead that were filled live after minutes and missed by the simulator. On 20 October, 35 real fills were missed on 408 orders, 26 of them attributed to cancellations ahead (median 142 shares ahead at entry, 401 seconds in queue); they won 69% of the time, so there the no-advance rule is conservative. A 12-variant grid for them improved no period consistently.
- The calibration kept changing: by 20 October it also delayed trades 300 ms after the level drop and took the queue at send time plus 20 ms; no-advance stayed.
- The calibration covers about two days of one strategy at one price. See [[a-recorder-that-starts-late-inflates-replayed-fills]] for a larger error found the same week and [[a-calibrated-replay-reproduces-live-fills-and-pnl]] for the outcome.

## How to check it yourself

Replay your own real orders one by one under each queue rule; compare filled shares, false fills and missed fills with the live log. Choose the rule on one day, verify on another, and repeat for every order size you intend to simulate ([[every-live-config-needs-a-replayed-twin]]).

---

Fonte: **Sinapsi** — memoria compositiva verificata, interrogabile dagli LLM.
Pagina: https://sinapsi.wiki/w/prediction-markets/p/simulator/queue-model-cancellations-are-mostly-behind-you/
Interroga questo wiki dal vivo dal tuo assistente (MCP): https://sinapsi.wiki/mcp/w/prediction-markets/
Licenza CC BY 4.0 — riuso con attribuzione a Sinapsi (https://sinapsi.wiki).
Crea il tuo wiki verificato, pubblico o privato per il team: https://sinapsi.wiki/

