IDEAS home Printed from https://ideas.repec.org/p/arx/papers/2606.21784.html

KineticSim: A Lightweight, High-Performance Execution Engine for Real-Time Market Simulators

Author

Listed:
  • Shakya Jayakody
  • Prarthinie Jayakody

Abstract

Simulating financial markets at scale with multi-agent (Agent-Based) models is critical for market design, regulatory stress-testing, and reinforcement learning, but traditional CPU simulators are bottlenecked by sequential processing while vectorized GPU frameworks suffer from kernel-launch overhead and redundant global-memory round-trips. We formalize, analyze, and evaluate a reusable parallel design pattern: persistent, state-carrying clearing for iterative multi-agent reductions. By caching mutable simulation state in thread-block shared memory across step boundaries, aggregating agent actions via shared-memory atomics, and resolving the clearing function cooperatively, the pattern reduces the per-step critical-path depth from Theta(L+A) for sequential clearing (L price-grid ticks, A agents) to Theta(log L + ceil(A/L)) and makes global-memory traffic independent of the step count. We implement this in KineticSim, a lightweight GPU execution engine that simulates massive ensembles of limit-order books in parallel, reaching a peak throughput of over 54.7 billion agent-events per second. On a fixed workload it delivers speedups of 3406x over CPU (NumPy), 27.8x over PyTorch GPU, 42.8x over JAX GPU, and 8.4x over a naive custom CUDA baseline, while using roughly an order of magnitude less GPU memory than PyTorch. Across 53 configurations the two custom CUDA engines produce bitwise-identical order books, and aggregate statistics match the CPU reference to within 0.1%. The pattern generalizes to other iterative multi-agent workloads requiring state-persistent, block-localized reductions.

Suggested Citation

  • Shakya Jayakody & Prarthinie Jayakody, 2026. "KineticSim: A Lightweight, High-Performance Execution Engine for Real-Time Market Simulators," Papers 2606.21784, arXiv.org, revised Jun 2026.
  • Handle: RePEc:arx:papers:2606.21784
    as

    Download full text from publisher

    File URL: https://arxiv.org/pdf/2606.21784
    File Function: Latest version
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Roll, Richard, 1984. "A Simple Implicit Measure of the Effective Bid-Ask Spread in an Efficient Market," Journal of Finance, American Finance Association, vol. 39(4), pages 1127-1139, September.
    2. Glosten, Lawrence R. & Milgrom, Paul R., 1985. "Bid, ask and transaction prices in a specialist market with heterogeneously informed traders," Journal of Financial Economics, Elsevier, vol. 14(1), pages 71-100, March.
    3. Sascha Frey & Kang Li & Peer Nagy & Silvia Sapora & Chris Lu & Stefan Zohren & Jakob Foerster & Anisoara Calinescu, 2023. "JAX-LOB: A GPU-Accelerated limit order book simulator to unlock large scale reinforcement learning for trading," Papers 2308.13289, arXiv.org.
    4. Kyle, Albert S, 1985. "Continuous Auctions and Insider Trading," Econometrica, Econometric Society, vol. 53(6), pages 1315-1335, November.
    5. J. Doyne Farmer & Duncan Foley, 2009. "The economy needs agent-based modelling," Nature, Nature, vol. 460(7256), pages 685-686, August.
    6. LeBaron, Blake, 2006. "Agent-based Computational Finance," Handbook of Computational Economics, in: Leigh Tesfatsion & Kenneth L. Judd (ed.), Handbook of Computational Economics, edition 1, volume 2, chapter 24, pages 1187-1233, Elsevier.
    7. Gode, Dhananjay K & Sunder, Shyam, 1993. "Allocative Efficiency of Markets with Zero-Intelligence Traders: Market as a Partial Substitute for Individual Rationality," Journal of Political Economy, University of Chicago Press, vol. 101(1), pages 119-137, February.
    8. Selim Amrouni & Aymeric Moulin & Jared Vann & Svitlana Vyetrenko & Tucker Balch & Manuela Veloso, 2021. "ABIDES-Gym: Gym Environments for Multi-Agent Discrete Event Simulation and Application to Financial Markets," Papers 2110.14771, arXiv.org.
    9. Mikola Lysenko & Roshan M. D'Souza, 2008. "A Framework for Megascale Agent Based Model Simulations on Graphics Processing Units," Journal of Artificial Societies and Social Simulation, Journal of Artificial Societies and Social Simulation, vol. 11(4), pages 1-10.
    10. Tesfatsion, Leigh, 2006. "Agent-Based Computational Economics: A Constructive Approach to Economic Theory," Handbook of Computational Economics, in: Leigh Tesfatsion & Kenneth L. Judd (ed.), Handbook of Computational Economics, edition 1, volume 2, chapter 16, pages 831-880, Elsevier.
    11. Volodymyr Mnih & Koray Kavukcuoglu & David Silver & Andrei A. Rusu & Joel Veness & Marc G. Bellemare & Alex Graves & Martin Riedmiller & Andreas K. Fidjeland & Georg Ostrovski & Stig Petersen & Charle, 2015. "Human-level control through deep reinforcement learning," Nature, Nature, vol. 518(7540), pages 529-533, February.
    12. Rama Cont & Adrien de Larrard, 2013. "Price Dynamics in a Markovian Limit Order Market," Post-Print hal-00552252, HAL.
    13. R. Cont, 2001. "Empirical properties of asset returns: stylized facts and statistical issues," Quantitative Finance, Taylor & Francis Journals, vol. 1(2), pages 223-236.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Pastushkov, A., 2025. "Evolutionary and agent-based computational finance: The new paradigms for asset pricing," Journal of the New Economic Association, New Economic Association, vol. 66(1), pages 196-222.
    2. Alessio Emanuele Biondo, 2019. "Order book modeling and financial stability," Journal of Economic Interaction and Coordination, Springer;Society for Economic Science with Heterogeneous Interacting Agents, vol. 14(3), pages 469-489, September.
    3. Torsten Trimborn & Philipp Otte & Simon Cramer & Maximilian Beikirch & Emma Pabich & Martin Frank, 2020. "SABCEMM: A Simulator for Agent-Based Computational Economic Market Models," Computational Economics, Springer;Society for Computational Economics, vol. 55(2), pages 707-744, February.
    4. Martin D. Gould & Mason A. Porter & Stacy Williams & Mark McDonald & Daniel J. Fenn & Sam D. Howison, 2010. "Limit Order Books," Papers 1012.0349, arXiv.org, revised Apr 2013.
    5. Biondo, Alessio Emanuele, 2018. "Learning to forecast, risk aversion, and microstructural aspects of financial stability," Economics - The Open-Access, Open-Assessment E-Journal (2007-2020), Kiel Institute for the World Economy, vol. 12, pages 1-21.
    6. Alessio Emanuele Biondo, 2018. "Order book microstructure and policies for financial stability," Studies in Economics and Finance, Emerald Group Publishing Limited, vol. 35(1), pages 196-218, March.
    7. Biondo, Alessio Emanuele, 2017. "Learning to forecast, risk aversion, and microstructural aspects of financial stability," Economics Discussion Papers 2017-104, Kiel Institute for the World Economy.
    8. Martin D. Gould & Mason A. Porter & Stacy Williams & Mark McDonald & Daniel J. Fenn & Sam D. Howison, 2013. "Limit order books," Quantitative Finance, Taylor & Francis Journals, vol. 13(11), pages 1709-1742, November.
    9. Przemys{l}aw Rola, 2025. "Boltzmann Price: Toward Understanding the Fair Price in High-Frequency Markets," Papers 2507.09734, arXiv.org.
    10. Tucker Hybinette Balch & Mahmoud Mahfouz & Joshua Lockhart & Maria Hybinette & David Byrd, 2019. "How to Evaluate Trading Strategies: Single Agent Market Replay or Multiple Agent Interactive Simulation?," Papers 1906.12010, arXiv.org.
    11. Qi Nan Zhai, 2015. "Asset Pricing Under Ambiguity and Heterogeneity," PhD Thesis, Finance Discipline Group, UTS Business School, University of Technology, Sydney, number 1-2015, January-A.
    12. Ledenyov, Dimitri O. & Ledenyov, Viktor O., 2015. "Wave function method to forecast foreign currencies exchange rates at ultra high frequency electronic trading in foreign currencies exchange markets," MPRA Paper 67470, University Library of Munich, Germany.
    13. Hommes, C.H., 2005. "Heterogeneous Agent Models in Economics and Finance, In: Handbook of Computational Economics II: Agent-Based Computational Economics, edited by Leigh Tesfatsion and Ken Judd , Elsevier, Amsterdam 2006, pp.1109-1186," CeNDEF Working Papers 05-03, Universiteit van Amsterdam, Center for Nonlinear Dynamics in Economics and Finance.
    14. V.K., Anand Krishnan & Chalissery, Meera Davi & Thomas, Sony, 2024. "A bibliometric review of Market Microstructure literature: Current status, development, and future directions," Finance Research Letters, Elsevier, vol. 69(PA).
    15. Hommes, Cars H., 2006. "Heterogeneous Agent Models in Economics and Finance," Handbook of Computational Economics, in: Leigh Tesfatsion & Kenneth L. Judd (ed.), Handbook of Computational Economics, edition 1, volume 2, chapter 23, pages 1109-1186, Elsevier.
    16. Alessio Emanuele Biondo, 2020. "Information versus imitation in a real-time agent-based model of financial markets," Journal of Economic Interaction and Coordination, Springer;Society for Economic Science with Heterogeneous Interacting Agents, vol. 15(3), pages 613-631, July.
    17. Lee, Yi-Tsung & Lin, Ji-Chai & Liu, Yu-Jane, 1999. "Trading patterns of big versus small players in an emerging market: An empirical analysis," Journal of Banking & Finance, Elsevier, vol. 23(5), pages 701-725, May.
    18. Attar, Andrea & Mariotti, Thomas & Salanié, François, 2019. "On competitive nonlinear pricing," Theoretical Economics, Econometric Society, vol. 14(1), January.
    19. Qiu, Jiaping & Yu, Fan, 2012. "Endogenous liquidity in credit derivatives," Journal of Financial Economics, Elsevier, vol. 103(3), pages 611-631.
    20. Scheffknecht, Lukas & Geiger, Felix, 2011. "A behavioral macroeconomic model with endogenous boom-bust cycles and leverage dynamcis," FZID Discussion Papers 37-2011, University of Hohenheim, Center for Research on Innovation and Services (FZID).

    More about this item

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:arx:papers:2606.21784. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: arXiv administrators (email available below). General contact details of provider: https://arxiv.org/ .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.