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 +3 more
8/25/2023
q-fin.TRcs.AIcs.CE

No official code found. Best implementation: KangOxford/AlphaTrade (142 stars, JAX, last commit 2026-03-16). 2 more below.

Abstract

Financial exchanges across the world use limit order books (LOBs) to process orders and match trades. For research purposes it is important to have large scale efficient simulators of LOB dynamics. LOB simulators have previously been implemented in the context of agent-based models (ABMs), reinforcement learning (RL) environments, and generative models, processing order flows from historical data sets and hand-crafted agents alike. For many applications, there is a requirement for processing multiple books, either for the calibration of ABMs or for the training of RL agents. We showcase the first GPU-enabled LOB simulator designed to process thousands of books in parallel, with a notably reduced per-message processing time. The implementation of our simulator - JAX-LOB - is based on design choices that aim to best exploit the powers of JAX without compromising on the realism of LOB-related mechanisms. We integrate JAX-LOB with other JAX packages, to provide an example of how one may address an optimal execution problem with reinforcement learning, and to share some preliminary results from end-to-end RL training on GPUs.

View on arXivView PDF

Code Implementations(3)

JAX

JAX-LOB: A GPU-Accelerated limit order book simulator to unlock large scale reinforcement learning for trading

14226Shell, PythonApr 21, 20227 months ago
executionjaxlobrl
limberc/TorchLOBCommunity73%

A GPU-Accelerated limit order book simulator to unlock large scale reinforcement learning for trading with PyTorch

00Python, Jupyter NotebookDec 26, 20259 months ago
KangOxford/jax-lobCommunity72%

JAX-LOB: A GPU-Accelerated limit order book simulator to unlock large scale reinforcement learning for trading

566Python, DockerfileOct 20, 20233 years ago

Cite this paper

@article{frey2023jaxlob,
  title  = {JAX-LOB: A GPU-Accelerated limit order book simulator to unlock large scale reinforcement learning for trading},
  author = {Sascha Frey and Kang Li and Peer Nagy and Silvia Sapora and Chris Lu and Stefan Zohren and Jakob Foerster and Anisoara Calinescu},
  year   = {2023},
  eprint = {2308.13289},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2308.13289v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2308.13289.svg)](https://codeofpaper.com/paper/2308.13289)

Discussion