Frey, Li, Nagy, Sapora, Lu, Zohren, Foerster and Calinescu (2023) implement JAX-LOB: thousands of fixed-size LOBs in parallel on GPU, wrapped in gymnax for recurrent PPO execution. ~7× training vs CPU LOB. Plain-language intro. Not investment advice.
Takeaway. CPU order-book simulators (ABIDES, linked-list replay) are serial: one message, one book. JAX-LOB stores each side as a fixed-capacity array of orders so JAX vmap can step thousands of books on one GPU. They wrap it in gymnax and train recurrent PPO on a 30-minute execution task.
JAX-LOB: A GPU-Accelerated limit order book simulator to unlock large scale reinforcement learning for trading (Sascha Frey, Kang Li, Peer Nagy, Silvia Sapora, Chris Lu, Stefan Zohren, Jakob Foerster, Anisoara Calinescu, 2023; arXiv:2308.13289). Oxford / Oxford-Man / FLAIR. LOBSTER messages; example on AMZN April 2021.
Fit for learners: JAX LOBSTER-scale simulator for HFT RL — advanced project if you want GPU-parallel order-book agents.
This Hub note is a plain-language intro. Not investment advice.
HFT RL needs lots of (state, action) pairs because the signal is tiny. Linked lists and red-black trees are fast on one core, but they cannot JIT + vmap. Replay of historical messages also does not react to your agent (no strategic counterparties). JAX-LOB still replays LOBSTER by default, but the matching engine is GPU-native so you can later inject other agents.
vmap turns Python if into select-all-branches. They therefore do not keep the book sorted after every cancel (re-sort would run on every message).A research simulator and a one-day training curve that beats TWAP in-sample. Not a live book.
You see why fixed shapes beat clever data structures on accelerators, and why execution is a better first LOB RL task than “print money with market orders.”
Tiny evening exercise: in NumPy, store 8 orders as an (8, 6) array with −1 padding. Write add that finds the first −1 row. Do not sort. Learning only.
vmap does to branching match logic.Landing: arXiv abs
Not investment advice. This Hub note is educational only. JAX-LOB is an academic GPU matching engine plus a one-day PPO sketch—not a recommendation to run HFT execution with real capital.
Single course CTA: SoloQuant Academy’s Introduction to Python Programming—fixed-shape arrays and loops over padded slots are how this simulator is even writable.