Inspiration
Optiver's historical-data API returned 502 errors from the start, leaving us with zero data to study. So we turned our trading bots into measuring instruments: every run recorded the live market, and every loss became a data point guiding our next iteration.
What it does
A Python market-making and analytics suite for Optibook (v1 → v5):
- Market Maker: Quotes around a damped micro-price fair value, skews by inventory, and enforces soft position limits.
- Adverse-Selection Guard ("Blackout"): Synchronizes with the exchange clock (<1 ms offset) to pull quotes during a recurring danger window where informed flow sweeps the book.
- Jump & Sweep Protection: Checks the local order-book cache every 10 ms to pull quotes on sudden price jumps.
- Jump Follower & Pair Trader: Executes IOC trades on lagging stocks when a correlated leader jumps.
- Request-Budget Planner: Allocates the 25 requests/sec limit only to liquid books where fills actually happen.
- Offline Analytics: Logs JSONL data to Parquet for live dashboards and HTML scorecards without kicking the active exchange connection.
How we built it & Key Finding
We evaluated every fill using 30-second markout (edge + adverse selection). Across 700+ fills, 11.9% occurred inside a narrow clock-tied window and caused over 100% of our losses (−825 vs. +310 outside). By stepping out during that window, danger-window fills dropped to 0.5% and markout per lot flipped from −0.09 to +0.03. Humans and AI agents collaborated via a strict, append-only lab notebook with timestamped evidence.
Challenges & Lessons Learned
- Constraints: Built our own dataset (37 runs, 90k trades) in 2.5 hours while working around the 1-connection and 25-req/s limits.
- Key Takeaways: Market making isn't about spread—it's about avoiding informed flow. In rate-limited markets, optimize fills per request, not orders sent. Always log evidence so humans and AI agents don't repeat mistakes.
What's next
Deploying our unified bot for the 30-minute final, tightening re-entry timing after the blackout guard to regain queue priority, and executing order-book-imbalance signals passively.