Adapting the Actor Model of Concurrency for High-Frequency Trading: Synchronous Message Delivery (fast_send) and a Tick-to-Book Latency Study
Abstract
The actor model - state isolation, data-race freedom, and sequential single-message reasoning - has long been dismissed as unsuitable for high-frequency trading (HFT): actors seem to imply many threads, a mailbox per actor, and a heap-allocated message plus a context switch per interaction, overhead incompatible with a microsecond budget. This paper argues the dismissal is wrong for co-located actors, with a deployed, measured implementation: kaspar-hft, an open-source C++20 framework. Four extensions adapt the model for HFT: fastsend, a synchronous delivery mechanism in which the sending thread runs the receiver's handler inline and returns the reply as a value; actor groups, which co-schedule actors on one thread behind a shared mailbox; per-actor selectable mailbox queues; and a memory pool. fastsend has receiver transparency: the handler is written identically for synchronous and asynchronous delivery and does not depend on which was used or which thread runs it. A grouped synchronous chain runs on one thread, cutting scheduler context switches from O(N) to O(1); a thread-local call-chain test detects cyclic invocation on one thread before any lock is taken, while a cycle spread across threads deadlocks. Microbenchmarks put the synchronous round trip at tens of nanoseconds. On a live CME market-data feed (ES, NQ, ZN futures), when the socket-reader thread decodes each packet and updates the book itself, socket-to-book medians for book updates are 0.8-1.1 microseconds, and a fastsend hop is about 1% of that. The shared-queue group also yields a production/simulation duality: the same actor code runs unchanged in live trading and deterministic backtest.
Create a lesson
Metadata
- Categories
- q-fin.TR, cs.DC
- Comments
- 31 pages, 4 figures. Companion paper on the market-data arrival process in preparation
Related papers
Tracking High-Frequency Trading Activity in China and Its Effects on Market Quality
Shared title terminologyq-fin.TRLi Guo, Frank Weikai Li, Ding Qi et al.
High-frequency intraday trading for battery storages
Shared title terminologyq-fin.TRDavid Schaurecker, David Wozabal, Nils Löhndorf et al.
OpenMarket: A Synchronized Polymarket-Binance Dataset for High-Frequency Prediction-Market Research
Shared title terminologyq-fin.TRGregory Young
Time-dependent weighted directed networks of cryptocurrency interaction from high-frequency returns
Shared title terminologyq-fin.TRShubhangam Shukla, Mahesh Peyyala, Abhijit Chakraborty
Robustness in Sequential Decision Making under Evolving Uncertainty: Evidence from High-Frequency Market Making
Shared title terminologyq-fin.TRYing Chen, Hoa Nguyen, Julian Sester et al.
Volatility Forecasting and Return Prediction under Market Regimes: Evidence from High-Frequency Chinese Equity Data
Shared title terminologyq-fin.TRXinyue Fang, Robert Ślepaczuk