Skip to content

Event-driven arbitrage bot simulation for sports betting.

License

Notifications You must be signed in to change notification settings

omarathon/arb-sim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sports Betting Arbitrage Bot Simulation

arb_sim_demo.mp4

Summary

A simulation of an arbitrage bot with a semi-realistic distrubuted backend system, and real-time visualisations on the frontend.

The backend simulates arbs by first generating odds updates according to a distribution, then detecting when odds lead to an arb, and finally simulating executing the bets for an arb by sleeping for a set duration (to simulate the time to execute the bet). In this delay, the bookmaker could've updated their price, causing either an adjustment or a cancellation (if the bookmaker closed the odd).

In a real system, the executor would actually place the bets by talking to real bookmakers, and the scraper would actually scrape bookmakers' sites. Furthermore, the backend would probably be in Rust or C++ to mininise the delay in detecting and executing arbs.

Requirements for running locally

OS

Built in Ubuntu (running on WSL) but the app should work on Windows/Mac too.

Software

  1. Python 3 (python --version == 3.10.12)
  2. Node.js and npm (npm --version == 10.8.1)
  3. Docker (docker --version == 26.1.1)

Workflows

Running locally

You will need to run both the frontend and backend locally to fully run the app.

⚠️ Note: ports 3000 and 8000-8005 must be free.

Backend

Run from the root of the repository:

  1. docker-compose -f docker-compose.yml up --build -d

This will run the backend in detached mode in docker. If you would like to run it in attached mode (e.g. to see the logs), remove the -d.

Frontend

Run from the root of the repository:

  1. cd frontend
  2. npm install
  3. npm start

Testing locally

Backend (28 tests)

Run from the root of the repository:

  1. Make a new venv:
    1. python -m venv venv
    2. source venv/bin/activate
  2. Install requirements:
    1. pip install -r backend/requirements.txt
  3. Run tests
    1. pytest backend

Frontend (15 tests)

Run from the root of the repository:

  1. cd frontend
  2. npm install
  3. npm test -- --watchAll

Architecture

Untitled Diagram (1)

License

GPL-3.0 (see LICENSE).

About

Event-driven arbitrage bot simulation for sports betting.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published