How davidteather/imc-prosperity-2024 works
This project is a simulation tool for an algorithmic trading competition (IMC Prosperity 2024). Its primary purpose is to simulate trading rounds by ingesting historical market data (prices and trades) from CSV files and executing trades (either manual or algorithmic) using a simulator module. The repository contains data sets for multiple trading rounds (organized into “datasets” and “datasets_2023”), helper scripts for manual trade executions and optimization routines, and a simulator package that contains both core simulation logic (simulator.py) and tests (simulator_test.py).
Main Components
• Data Sources: Represented by the datasets directories (e.g., “datasets”, “datasets_2023”). These directories contain CSV files with historical prices and trade data for various trading rounds.
• Data Preprocessor: The “preprocess.py” script likely serves to clean, validate, or organize incoming CSV data.
• Core Simulator: The “simulator” package (especially simulator.py) that handles the main simulation logic. This module receives processed data and executes simulation runs.
• Trading Logic / Algorithms: The “helpers” directory contains scripts for manual trading functions and an “optimize.py” that likely assists in strategy optimization. Although the README mentions that they did not have enough time to complete every algorithm for all rounds, these components still represent the trade decision-making aspect.
• Main Application: “main.py” acts as an entry point and leverages the simulator module to run simulations by accepting command-line arguments for data files.
• Testing/Validation: Simulator tests (simulator_test.py) show that there’s a testing component ensuring that simulation logic works as expected.
• Configuration/Build: Files like “requirements.txt”, “Makefile”, and “.gitignore” indicate dependency management and build/setup instructions.
Relationships and Interactions
• Data flows from the Data Sources (CSV files) into the Data Preprocessor, which then feeds validated and possibly cleaned data into the Simulator.
• The Simulator communicates with trading algorithms (from the “helpers” scripts) to determine trade actions based on the processed data.
• The Main Application scripts use the Simulator to drive an end-to-end simulation run by passing file inputs.
• Testing components validate the simulator’s functioning in a controlled environment.
Architectural Patterns & Design Principles
• Modularization: The system splits functionality into distinct modules – data ingestion, preprocessing, simulation core, and trade logic helpers.
• Separation of Concerns: Different directories clearly encapsulate various concerns (data vs. simulation logic vs. helper methods), even though the project notes it’s “fairly disorganized”.
• Command-line Interface (CLI): The README describes CLI commands that drive simulation execution which points to a decoupled input/processing structure.