Skip to content

tksoftw/imc-prosperity-4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

125 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mystery Shack LLC

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.

Quick Links

Hedgehogs writeup | Official Discord Server | Official Wiki | Equirag Visualizer


Contents


The Team

tksoftw
Thomas Kennedy

💻
FluffyCube9343
Vrishak Vemuri

💻
LOB628
Liam Baird

💻
Andre-Mao
Andre Mao

💻

Quickstart

Windows

Admin PowerShell:

wsl --install

Ubuntu:

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 --locked
Trouble connecting to the Internet on WSL? (Cisco AnyConnect / other VPN)

WSL2's default NAT networking breaks while AnyConnect is connected (DNS + curl fail inside WSL). Switch WSL to mirrored networking by creating C:\Users\<you>\.wslconfig with:

[wsl2]
networkingMode=mirrored

Then from PowerShell run wsl --shutdown and reopen Ubuntu. Verify with curl -I https://astral.sh from inside WSL.

macOS

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 --locked
Issues 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

Tools we used

Dependency manager and venv, run from the repo root. Basically a pip replacement. Main uses:

  1. source .venv/bin/activate enter the venv (important, cannot use repo without)
  2. deactivate exit the venv
  3. uv sync --extra dev sync packages
  4. uv add <pkg> add a new package
  5. uv 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).

Submission Libraries

The competition only allows the following libraries inside trader files pandas, NumPy, statistics, math, typing, and jsonpickle.


Tools we built

Note: Run all programs in the .venv

General tools

uv run rank

Rank all traders by PnL.

also: --show-per-product to show PnL by product.

also: --day to restrict to a specific day.

also --carry to 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 N to override the round (defaults to the highest traders/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 N to override the round (defaults to the highest traders/ROUND_*/ present).

(deprecated) Identify and generate synthetic round data.

uv run gendata

By round

Round 1

python3 tools/orderbook.py

Round 2

uv run uvicorn tools.allocation_webviz.server:app --reload --port 8001

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

Round 4

python3 tools/exotics/websim.py

Round 5

python3 tools/prosperity_news_optimizer.py

Optional additions

Create a venv alias

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.

Use WSL in VS Code/Cursor

  1. Open VS Code on Windows
  2. Press CTRL+SHIFT+P
  3. Type in WSL: Connect to WSL

You'll see a green "WSL" indicator in the bottom-left once connected.

Editor extensions

Edit CSV

Data Wrangler


Writeups & reference repos

Prosperity 3: 2nd overall, very detailed.

Prosperity 3: 9th overall, 2nd US.

Source for the rust_backtester binary.

About

Mystery Shack LLC team repository for IMC Prosperity 4

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors