arb_sim_demo.mp4
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.
Built in Ubuntu (running on WSL) but the app should work on Windows/Mac too.
- Python 3 (
python --version == 3.10.12
) - Node.js and npm (
npm --version == 10.8.1
) - Docker (
docker --version == 26.1.1
)
You will need to run both the frontend and backend locally to fully run the app.
3000
and 8000-8005
must be free.
Run from the root of the repository:
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
.
Run from the root of the repository:
cd frontend
npm install
npm start
Run from the root of the repository:
- Make a new venv:
python -m venv venv
source venv/bin/activate
- Install requirements:
pip install -r backend/requirements.txt
- Run tests
pytest backend
Run from the root of the repository:
cd frontend
npm install
npm test -- --watchAll
GPL-3.0 (see LICENSE).