Exploiting Concurrency in Domain-Specific Data Structures: A Concurrent Order Book and Workload Generator for Online Trading

  • Raphaël P. BarazzuttiEmail author
  • Yaroslav Hayduk
  • Pascal Felber
  • Etienne Rivière
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9944)


Concurrent programming is essential to exploit parallel processing capabilities of modern multi-core CPUs. While there exist many languages and tools to simplify the development of concurrent programs, they are not always readily applicable to domain-specific problems that rely on complex shared data structures associated with various semantics (e.g., priorities or consistency). In this paper, we explore such a domain-specific application from the financial field, where a data structure—an order book—is used to store and match orders from buyers and sellers arriving at a high rate. This application has interesting characteristics as it exhibits some clear potential for parallelism, but at the same time it is relatively complex and must meet some strict guarantees, notably w.r.t. the ordering of operations. We first present an accurate yet slightly simplified description of the order book problem and describe the challenges in parallelizing it. We then introduce several approaches for introducing concurrency in the shared data structure, in increasing order of sophistication starting from lock-based techniques to partially lock-free designs. We propose a comprehensive workload generator for constructing histories of orders according to realistic models from the financial domain. We finally perform an evaluation and comparison of the different concurrent designs.


Limit Order Order Book Market Order Status Flag Match Operation 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


  1. 1.
    Ende, B., Uhle, T., Weber, M.C.: The impact of a millisecond: measuring latency effects in securities trading. In: Wirtschaftsinformatik Proceedings, Paper 116 (2011)Google Scholar
  2. 2.
    WIRED: Raging bulls: how wall street got addicted to light-speed trading (2012).
  3. 3.
    Leber, C., Geib, B., Litz, H.: High frequency trading acceleration using FPGAs. In: International Conference on Field Programmable Logic and Applications, FPL (2011)Google Scholar
  4. 4.
    Preis, T.: Ökonophysik - Die Physik des Finanzmarktes. Springer, Wiesbaden (2011)CrossRefGoogle Scholar
  5. 5.
    Maslov, S.: Simple model of a limit order-driven market. Phys. A Stat. Mech. Appl. 278(3), 571–578 (2000)CrossRefGoogle Scholar
  6. 6.
    Maslov, S., Mills, M.: Price fluctuations from the order book perspective - empirical facts and a simple model. Phys. A Stat. Mech. Appl. 299(1), 234–246 (2001)CrossRefzbMATHGoogle Scholar
  7. 7.
    Lea, D.: Concurrent Programming in Java: Design Principles and Patterns. Addison-Wesley, Boston (1996)zbMATHGoogle Scholar
  8. 8.
    Bartolozzi, M.: Price variations in a stock market with many agents. Eur. Phys. J. B 78(2), 265–273 (2010)MathSciNetCrossRefzbMATHGoogle Scholar
  9. 9.
    Bak, P., Paczuski, M., Shubik, M.: Price variations in a stock market with many agents. Phys. A Stat. Mech. Appl. 246(3–4), 430–453 (1997)CrossRefGoogle Scholar
  10. 10.
    Gabaix, X.: Power laws in economics and finance, Technical report. National Bureau of Economic Research (2008)Google Scholar
  11. 11.
    Bouchaud, J.-P., Mézard, M., Potters, M.: Statistical properties of stock order books: empirical results and models. Quant. Finan. 2(4), 251–256 (2002)CrossRefGoogle Scholar
  12. 12.
    Khanna, K., Smith, M., Wu, D., Zhang, T.: Reconstructing the order book, Technical report. Stanford University (2009)Google Scholar
  13. 13.
    Singla, A., Chandrasekaran, B., Godfrey, P.B., Maggs, B.: The internet at the speed of light. In: 13th ACM Workshop on Hot Topics in Networks, HotNets (2014)Google Scholar
  14. 14.
    Thompson, M., Farley, D., Barker, M., Gee, P., Stewart, A.: Disruptor: high performance alternative to bounded queues for exchanging data between concurrent threads. White paper (2011).
  15. 15.
    Shetty, Y., Jayaswal, S.: The order-matching engine. In: Practical .NET for Financial Markets. Apress, pp. 41–103 (2006)Google Scholar
  16. 16.
    Huang, W., Lehalle, C.-A., Rosenbaum, M.: Simulating, analyzing order book data: the queue-reactive model. J. Am. Stat. Assoc. 110(509), 107–122 (2013)MathSciNetCrossRefGoogle Scholar
  17. 17.
    Cont, R., Stoikov, S., Talreja, R.: A stochastic model for order book dynamics. J. Am. Stat. Assoc. 58(3), 549–563 (2010)MathSciNetzbMATHGoogle Scholar
  18. 18.
    Kercheval, A.N., Zhang, Y.: Modelling high-frequency limit order book dynamics with support vector machines. Quant. Financ. 15(8), 1315–1329 (2015)MathSciNetCrossRefGoogle Scholar

Copyright information

© Springer International Publishing AG 2016

Authors and Affiliations

  • Raphaël P. Barazzutti
    • 1
    Email author
  • Yaroslav Hayduk
    • 1
  • Pascal Felber
    • 1
  • Etienne Rivière
    • 1
  1. 1.University of NeuchâtelNeuchâtelSwitzerland

Personalised recommendations