Queue Position Estimation via Particle Filters
And testing it live
Estimating queue position is one of those things everyone talks about, but there isn’t much good literature on it. Which makes sense, it’s mostly market maker knowledge that they’d want to keep to themself!
The problem is straightforward: When you post a limit order, you know your price and your size, but you don’t know where you actually sit in the queue and how much volume is ahead of you before you get filled. An order at the front of a 10 BTC queue has a completely different fill probability than one at the back of it.
There is one particular blog post by Rigtop (2013) that proposed splitting observed volume changes proportionally between ahead and behind. It works as a heuristic, but it has a problem: it treats cancellations as events where some volume gets cancelled ahead of you and some behind, but in reality, each cancellation is either fully ahead of you or fully behind you. This means it also only gives you a point estimate of where in the queue you are, with no measure of uncertainty.
We do something more powerful. We maintain a distribution over all possible queue positions using a particle filter, which gives us a whole distribution of where we likely are in the queue.
We derive the framework from scratch, implement it live on Bybit, and show the particle distribution evolving live in real time.
I write about quantitative trading the way it’s actually practised:
Robust models and portfolios, combining signals and strategies, understanding the assumptions behind your models.
Topics I write about include portfolio construction, market making, risk management, research methodology, and more.
If this way of thinking resonates, you’ll probably like what I publish.
What you’ll learn
Why market-by-price data makes queue position a latent variable, and why the naive proportional heuristic isn’t enough.
How to model queue position as a distribution rather than a point estimate, and why that matters for execution and market making.
How to derive a particle filter for queue position from scratch, handling trades, cancellations, and fills correctly.
How to implement it live with Bybit’s WebSocket feed in Python.
What the queue position distribution actually looks like in real life, and how it evolves as the market moves.

