IMC Prosperity 4 Review
IMC Prosperity 4 algorithmic trading retrospective: strategies, backtester, market microstructure analysis, and round-by-round research notes. Top 0.5% overall.
Install / Use
npx skills add Leo-Hawking/IMC-Prosperity-4-ReviewInstalls into whichever agent you are using.
README
IMC Prosperity 4 — Algorithmic Trading Retrospective
<div align="center"> <a href="https://prosperity.imc.com/leaderboard"> <img src="https://img.shields.io/badge/Official-Leaderboard-1A1B27?style=for-the-badge&logo=google-analytics&logoColor=white" height="45"> </a> <a href="https://prosperity.imc.com/leaderboard"> <img src="https://img.shields.io/badge/Algo_Rank-96th-FFD700?style=for-the-badge" height="45"> </a> <a href="https://prosperity.imc.com/leaderboard"> <img src="https://img.shields.io/badge/Overall_Rank-93rd-blue?style=for-the-badge" height="45"> </a> </div>This is a methodology-showcase repository, not a champion's highlight reel. Our final overall rank was 93rd, algorithmic-trading rank 96th — Top 0.5% (see the rank summary below). The purpose of open-sourcing this is not to flaunt rankings but to fully document how we approached an unfamiliar market from scratch — observing, hypothesizing, modeling, backtesting, and reviewing — including which steps we got right and which alphas we missed because of preconceived assumptions.
If you're short on time, jump directly to the Round 1 and Round 5 retrospectives. Round 5 is especially worth reading: we independently verified the mathematical structure of a microstructure phenomenon through three different methods, yet judged it "no alpha here" because of two ingrained assumptions. Post-result reconstruction suggests that deploying this single lattice-reversal signal would likely have moved our algorithmic rank from 96th into the Top-15 range.
About the Competition
IMC Prosperity 4, hosted by IMC Trading, is divided into algorithmic and manual trading. This repository focuses on the algorithmic trading portion.
The rules: based on three days of microstructure data (order book snapshots and trade records) provided by the organizers, write a Python strategy file and submit it to the official matching engine to run online, with the goal of maximizing PnL.
The format: 1 Tutorial round + 5 official rounds. Phase 1 (Rounds 1–2, 72 hours each) and Phase 2 (Rounds 3–5, 48 hours each), with rankings reset between phases.
A total of 18,803 teams participated.
Official materials: https://imc-prosperity.notion.site/prosperity-4-wiki
<div align="center"> <img src="prosperity/assets/images/competition_scale.jpeg" alt="Competition Scale and Overview" width="100%"> </div>🌌 Team
<div align="center"> <a href="prosperity/assets/images/DarkForestHunter_TeamName.png"> <img src="prosperity/assets/images/DarkForestHunter_TeamName.png" alt="Dark Forest Hunter Team Logo" width="100%"> </a> </div> <details> <summary align="center"> <b>🏹 [CLICK TO VIEW TEAM POSTER]</b> </summary> <p align="center"> <br> <img src="prosperity/assets/images/DarkForestHunter_Poster.png" width="85%" alt="Dark Forest Hunter Poster"> <br> <i>"The universe is a dark forest. Every civilization is an armed hunter..."</i> </p> </details> <br> <table> <tr> <td width="180" align="center"> <img src="prosperity/assets/images/leo_photo.png" width="140" style="border-radius:50%"/><br/> <b>Haoqing Liu (Leo)</b> </td> <td> <b>Strategy Design · Backtesting Framework · Retrospective Visualization</b><br/><br/> Responsible for overall strategy design, microstructure analysis, the in-house backtesting framework and hyperparameter search, the retrospective visualization module, and the bulk of the statistical modeling work.<br/><br/> 🔗 <a href="https://www.linkedin.com/in/haoqing-liu-2232b2293/">LinkedIn</a> · 📧 liuhaoqing.leo@gmail.com · 💻 <a href="https://github.com/Leo-Hawking">GitHub</a> </td> </tr> <tr> <td width="180" align="center"> <img src="prosperity/assets/images/mike_photo.jpg" width="140" style="border-radius:50%"/><br/> <b>Zhuoqin Peng (Mike)</b> </td> <td> <b>Data Analysis · Cross-Asset Relationship Mining</b><br/><br/> Responsible for the statistical exploration and validation of cross-asset relationships. The core discoveries of Round 5 — the negative-correlation structure within the PEBBLE group and the positive/negative-correlation and reversal relationships within the SNACK group — were primarily driven by his analysis of the 50-asset return correlation matrix.<br/><br/> 🔗 <a href="https://www.linkedin.com/in/mike-peng-244237245/">LinkedIn</a> </td> </tr> </table>Rank Summary
| Round | Market Theme | Algo Rank | Key Takeaway | |---|---|---|---| | Round 0 | Tutorial (matching-engine probing) | — | Confirmed via probe orders that "no queue, bots only hit best, taker can cross" — the foundational mechanics | | Round 1 | Single-asset trend + single-asset mean reversion | 170 | Two-layer fair-price correction took shape; we didn't load up on ASH's extreme-deviation regions, where top teams' hard-coded logic widened the gap | | Round 2 | Same as Round 1 + sealed-bid auction game | 77 | Bidding hedged uncertainty; ASH's mean drifted, and our conservative position management turned out to be advantageous | | Round 3 | Options (10 strikes) + spot | 95 | Abandoned vol/pairs approaches in favor of unified mean reversion across all assets — interpretability over precision | | Round 4 | Same market as Round 3 + bot names disclosed | 132 | Bucketing analysis identified Mark 14 / Mark 55 as informed bots; strategy-migration inertia caused a slip | | Round 5 | 50 assets, complex cross-asset structure | 96 | Confirmed the "inner/outer orders are generated separately" hypothesis; missed the high-frequency mean-reversion alpha in round-100 jump regions |
⚠️ Artifact Status
This repository preserves the competition-time research and implementation artifacts as closely as possible. Some scripts may require path or dependency adjustments before running out of the box.
For employers or collaborators, the main value of this repository is the strategy reasoning, research notes, backtesting framework, retrospective visualization tools, and round-by-round methodological narrative. I am happy to walk through implementation details, design trade-offs, and reproducibility issues in interviews.
Table of Contents
Workflow
We drew inspiration from publicly shared writeups of past competitions (mainly TimoDiehm/imc-prosperity-3). Our overall flow is a loop of "probe → visualize → hypothesize → spec doc → implement → backtest & retrospect":
-
Probe strategy — At the start of each round, we submit a few empty strategies and mechanical grid-quoting orders to map out the current market's matching mechanics (queueing, tick size, cross-price behavior, etc.). Code in
prosperity/round0trade/. -
High-density visualization — Once we have the data, the first thing we do in a notebook is overlay multiple layers of information (order book, trades, our own quotes and fills, inner/outer spreads) on a single chart. We use
plotlybecause it lets us zoom into microstructure-level time scales. Research notebooks live inprosperity/research_round12/,prosperity/round3research/,prosperity/round4research/, andprosperity/round5research/. -
Hypothesis verification — Intuitive observations from the charts are then verified statistically from multiple angles (e.g., in Round 1, we used AR(1) fitting + ACF half-life cross-checking to verify the OU hypothesis), to minimize "see-and-tell" statistical illusions.
-
Spec docs before code — Once an idea is confirmed, I iterate with an AI to manually write the strategy rules into
.mddocuments (every module's details, edge cases, and fallback paths spelled out clearly). The point of this step is to force myself to articulate every branch of the strategy and the source of every parameter — this is the foundation of strategy interpretability and debuggability. Implementation is delegated to Claude Code, given the time pressure.- Examples:
prosperity/round1trade/strategy_unified.md,prosperity/round5trade/PEBBLES_做市与对冲算法规范.md
- Examples:
-
Backtest & retrospective — Each version is run through our in-house backtest framework (
prosperity/backtest/) to produce a fill log, then the retrospective visualization module (prosperity/review_plot/) plots fills, PnL attribution, edge scatter, etc. Based on these, we decide between iterating the version or hyperparameter optimization (which we do by preferring parameter plateaus over global maxima, for robustness).
The limitations of this workflow were also fully exposed during the competition — see the Overall Retrospective. In short: a two-person discussion (human + AI) easily reaches consensus around mistaken beliefs (Round 5 was exactly this), and breaking out of that requires more independently-alpha-generating people in adversarial discussion.
Repository Map
A note on naming: filenames mix Chinese and English, and several rounds contain duplicated
final.py / v2 / v3naming. This is mainly due to (a) time pressure and (b) the fact that strategy iteration was tree-shaped rather than linear (we explored multiple d
Related Skills
ai-context-hierarchy
10Three-level context hierarchy for AI coding agents — featured in Graphify v5.0 roadmap. Stop re-explaining your codebase every session. Works with Claude Code, Cursor, Codex, Gemini CLI, Claude Desktop.
sm
🌊 **Scrum Master** | Facilitator > Use for user story creation from PRD, story validation and completeness checking, acceptance criteria definition, story refinement, sprint planning, backlog grooming, retrospectives, daily standup facilitation, and local branch management (create/switch/list/delet…
product-manager-skills
138PM skill for Claude Code, Codex, Cursor, and Windsurf: diagnose SaaS metrics, critique PRDs, plan roadmaps, run discovery, and coach PM career transitions.
openclaw-4656-a-b-rollout-governance
A/B Rollout Governance for product management execution
