Implementing the BBE Agent-Based Model of a Sports-Betting Exchange

  • Dave Cliff ,
  • James Hawkins,
  • James Keen,
  • Roberto Lau-Soto
  • a,b,c,d Department of Computer Science, University of Bristol, Bristol BS8 1UB, U.K.
Cite as
Cliff D., Hawkins J., Keen J., Lau-Soto R. (2021). Implementing the BBE Agent-Based Model of a
Sports-Betting Exchange. Proceedings of the 33rd European Modeling & Simulation Symposium (EMSS 2021), pp. 230-240. DOI:


In this paper we describe three independent implementations of a new agent-based model (ABM) that simulates a contemporary sports-betting exchange, such as those o ered commercially by companies including Betfair, Smarkets, and Betdaq. The motivation for constructing this ABM, which is known as the Bristol Betting Exchange (BBE), is so that it can serve as a synthetic data generator, producing large volumes of data that can be used to develop and test new betting strategies via advanced data analytics and machine learning techniques. Betting exchanges act as online platforms on which bettors can nd willing counterparties to a bet, and they do this in a way that is directly comparable to the manner in which electronic nancial exchanges, such as major stock markets, act as platforms that allow traders to nd willing counterparties to buy from or sell to: the platform aggregates and anonymises orders from multiple participants, showing a summary of the market that is updated in real-time. In the rst instance, BBE is aimed primarily at producing synthetic data for in-play betting (also known as in-race or in-game betting) where bettors can place bets on the outcome of a track-race event, such as a horse race, after the race has started and for as long as the race is underway, with betting only ceasing when the race ends. The rationale for, and design of, BBE has been described in detail in a previous paper that we summarise here, before discussing our comparative results which contrast a single-threaded implementation in Python, a multi-threaded implementation in Python, and an implementation where Python header-code calls simulations of the track-racing events written in OpenCL that execute on a 640-core GPU – this runs ≈ 1000 times faster than the single-threaded Python. Our source-code for BBE is being made freely available on GitHub. 


  1. Aruajo-Santos, J. P. (2014). A trading agent frame work using plain strategies and machine learning. Master’s thesis, Universidade do Porto. 
  2. Axen, G. and Cortis, D. (2020). Hedging on betting markets. Risks, 8(88). 
  3. Bradley, I. (2002). The representative bettor, bet size, and prospect theory. Economics Letters, 78:409–413. Brown, A. and Yang, F. (2016). Limited cognition and clustered asset prices: Evidence from betting mar kets. Journal of Financial Markets, 29:27–46.
  4. Bunker, R. and Susnjak, T. (2019). The application of machine learning techniques for predicting results in team sport: A review. Arxiv:1912.1176v1. 
  5. Choi, D. and Hui, S. (2014). The role of surprise: Un derstanding overreaction and underreaction to unan ticipated events using in-play soccer betting market. J. Economic Behavior & Organization, 107:614–629. 
  6. Cliff , D. (2021). BBE: Simulating the Microstructural Dynamics of an In-Play Betting Exchange via Agent Based Modelling. 
  7. Cliff , D. and Rollins, M. (2020). Methods matter: A trading algorithm with no intelligence routinely out performs AI-based traders. In Proceedings of IEEE Symposium on Computational Intelligence in Financial Engineering (CIFEr2020). 
  8. de Jong, F. and Rindi, B. (2009). The Microstructure of Financial Markets. Cambridge University Press. Dzalbs, I. and Kalganova, T. (2018). Forecasting price movements in betting exchanges using Cartesian genetic programming and ANN. Big Data Research, 14:112–120. 
  9. Easton, S. and Uylangco, K. (2009). Forecasting out comes in tennis matches using within-match betting markets. International J. of Forecasting, 26:564–575. 
  10. El Emam, K., Mosquera, L., and Hoptro , R. (2021). Practical Synthetic Data Generation: Balancing Privacy and the Broad Availability of Data. O’Reilly. 
  11. Feess, E., Muller, H., and Schumacher, C. (2015). Esti mating risk preferences of bettors with di erent bet sizes. Euro. J. Operational Research, 249:1102–1112. 
  12. Goncalves, R., Ribeiro, V., Pereira, F., and Rocha., A. (2020). Deep learning in exchange markets. Infor mation Economics and Policy, 47:38–51. 
  13. Goodfellow, I., Bengio, Y., Courville, A., and Bach, F. (2017). Deep Learning. MIT Press. 
  14. Gould, M., Porter., M., Williams, S., McDonald, M., Fenn, D., and Howison, S. (2013). Limit order books. Quantitative Finance, 13(11):1709–1742. 
  15. Hawkins, J. (2021). Design and Implementation of a Simulated Betting Exchange: Generating Synthetic Data for Use in Discovering Pro table Betting Strate gies. Master’s thesis, University of Bristol, Depart ment of Computer Science. SSRN: 3876312. 
  16. Hubácek, O., Sourek, G., and Zelezny, F. (2019). Exploit- ˘ ing sports-betting market using machine learning. International Journal of Forecasting, 35:783–796. 
  17. Hubácek, O. and ˘ Sír, G. (2020). Beating ˘ the market with a bad predictive model. 
  18. Ioulianou, M., Christo , I., Talattinis, K., Chalkias, K., and Stephanides, G. (2011). Automatic identi cation of low-risk trading opportunities in sport betting ex change markets. In Kostoglou, V., et al., Proceedings of the 1st International Symposium and 10th Balkan Con ference on Operational Research, volume 1, pp.108–114. 
  19. Kanto, A., Rosenquist, G., and Suvas, A. (1992). On util ity function estimation of racetrack bettors. Journal of Economic Psychology, 13:491–498.
  20. Keen, J. (2021). Discovering transferable and prof itable algorithmic betting strategies within the simu lated microcosm of a contemporary betting exchange. Master’s thesis, University of Bristol, Department of Computer Science. SSRN: 3879677. 
  21. Lau-Soto, R. (2021). An agent-based model of a bet ting exchange via a single-threaded and object oriented implementation. Master’s thesis, University of Bristol, Department of Computer Science; SSRN: 3874192. 
  22. Merz, O., Flepp, R., and Franck, E. (2020). Sonic Thun der vs Brian The Snail: Are people a ected by unin formative racehorse names? Technical Report 384, University of Zurich Dept. Business Administration. 
    PR Newswire (2020). Global gambling industry to reach $647.9billion by 2027. releases/global-gambling-industry-301107436.html. 
  23. Restocchi, V. (2018). It takes all sorts: The complex ity of prediction markets. PhD thesis, University of Southampton Business School. 
  24. Ries, E. (2011). The Lean Startup. Crown Business. Rollins, M. and Cli , D. (2020). Which trading agent is best? using a threaded parallel simulation of a nan cial market changes the pecking-order. In Proc. 32nd Euro. Modeling and Simulation Symposium (EMSS2020). Smith, M. and Vaughan Williams, L. (2008). Betting ex changes: A technological revolution in sports betting. In Hausch, D. and Ziemba, W., editors, Handbook of Sports & Lottery Markets, pp.403–418. North Holland. Suhonen, N., Saastamoinen, J., Kainulainen, T., and Forrest, D. (2018). Is timing everything in horse betting? Economics Letters, 173:97–99. 
  25. Swidler, S. and Shaw, R. (1995). Racetrack wagering and the “uninformed” bettor: A study of market e ciency. Quarterly Review of Economics and Finance, 35(3):305–314. 
  26. Teräsvirta, T. and Zhao, Z. (2010). Stylized facts of re turn series, robust estimates, and three popular mod els of volatility. Applied Financial Economics, 21:67–94.  ings of the 16th IEEE Workshop on High -Level Parallel Programmin Models and Supportive Environments, May, Anchorage, AK, USA.
  27. Tsrimpas, P. (2015). Speci cation and Performance Op timization of Real-Time Trading Strategies for Betting Exchange Platforms. PhD thesis, Imperial College Lon don, Department of Computing. 
  28. Tversky, A. and Kahneman, D. (1992). Advances in prospect theory: Cumulative representation of un certainty. Journal of Risk and Uncertainty, 5:297–323. 
  29. Wheatcroft, E. (2020). A pro table model for predict ing the over/under market in football. International Journal of Forecasting, 36:916–932. 
  30. Wilkens, S. (2020). Sports prediction and betting mod els in the machine learning age: The case of tennis. SSRN: 3506302.