This repository contains research and algorithms for our team, Mystery Shack LLC, in IMC Prosperity 4. Out of 18,803 teams, we placed 763rd globally and 199th in the USA, with an overall score of 257,957 XIREC.
Hedgehogs writeup | Official Discord Server | Official Wiki | Equirag Visualizer
|
Thomas Kennedy 💻 |
Vrishak Vemuri 💻 |
Liam Baird 💻 |
Andre Mao 💻 |
Admin PowerShell:
wsl --installUbuntu:
sudo apt update && sudo apt install -y build-essential git curl
curl -LsSf https://astral.sh/uv/install.sh | sh && exec bash
git clone https://github.com/tksoftw/imc-prosperity-4 && cd imc-prosperity-4
uv sync --extra dev && source .venv/bin/activate
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && . "$HOME/.cargo/env"
cargo install rust_backtester --lockedTrouble connecting to the Internet on WSL? (Cisco AnyConnect / other VPN)
WSL2's default NAT networking breaks while AnyConnect is connected (DNS +
curlfail inside WSL). Switch WSL to mirrored networking by creatingC:\Users\<you>\.wslconfigwith:[wsl2] networkingMode=mirroredThen from PowerShell run
wsl --shutdownand reopen Ubuntu. Verify withcurl -I https://astral.shfrom inside WSL.
xcode-select --install
curl -LsSf https://astral.sh/uv/install.sh | sh && exec zsh
git clone https://github.com/tksoftw/imc-prosperity-4 && cd imc-prosperity-4
uv sync --extra dev && source .venv/bin/activate
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && . "$HOME/.cargo/env"
cargo install rust_backtester --lockedIssues with Python 3.10 dependencies?
Some of our group members had issues involving Python 3.10 requirements on a new WSL2 instance. These bash commands fixed the issue:
sudo apt update sudo apt install -y python3.10 python3.10-dev pkg-config build-essential
Dependency manager and venv, run from the repo root. Basically a pip replacement. Main uses:
source .venv/bin/activateenter the venv (important, cannot use repo without)deactivateexit the venvuv sync --extra devsync packagesuv add <pkg>add a new packageuv remove <pkg>remove a package
Note: We mostly use rank_traders (which uses rust_backtester internally) for quick backtesting. But otherwise, run rust_backtester --help for more information.
Upload a submission .log to visualize trades, fills, and PnL. Also see an unofficial backtest leaderboard. Logs from the rust backtester are located in the runs folder (generated after at least one backtest is run).
The competition only allows the following libraries inside trader files pandas, NumPy, statistics, math, typing, and jsonpickle.
Note: Run all programs in the
.venv
uv run rank
Rank all traders by PnL.
also:
--show-per-productto show PnL by product.
also:
--dayto restrict to a specific day.
also
--carryto carry positions across days AND set infinite order queue priority.
also:
--clean [stale (default), all, or <pattern>]to clean the runs/ directory.
uv run compile --trader trader_X.py
Inline a trader's local ROUND_N (and cross-round) imports into one self-contained submission file under traders/ROUND_N/compiled/.
also:
--all(instead of--trader) to compile every trader in the round (self-contained traders are skipped).
also:
--round Nto override the round (defaults to the highesttraders/ROUND_*/present).
uv run check_overfit --trader trader_X.py
Audit all traders for overfitting risk. Combines four signals into a 0–100 risk score (lower is better).
also:
--all(instead of--trader) to check all traders in the round.
also:
--round Nto override the round (defaults to the highesttraders/ROUND_*/present).
(deprecated) Identify and generate synthetic round data.
uv run gendata
Round 3
python3 tools/round_3_playground.py
headless mode:
python3 tools/round_3_playground.py --no-gui --b1 755 --b2 840 --avg-b2 840
Add the following to your ~/.bashrc file (or ~/.zshrc on macOS):
alias vv="source .venv/bin/activate"Then do source ~/.bashrc. Now you can type vv to activate the venv.
- Open VS Code on Windows
- Press
CTRL+SHIFT+P - Type in
WSL: Connect to WSL
You'll see a green "WSL" indicator in the bottom-left once connected.
Prosperity 3: 2nd overall, very detailed.
Prosperity 3: 9th overall, 2nd US.
Source for the rust_backtester binary.