Market making looks like quoting two numbers — until inventory, adverse selection and rate limits hit you at the same time. We wanted to build a bot that stays profitable and inside the risk limits for a full 48-hour session, not just on a lucky backtest.

What it does Our bot connects to Optiver's Optibook exchange, computes a fair value for each of the 8 tech instruments from the live order book, and continuously quotes bid/ask around it. Quotes are skewed by current inventory so the bot naturally mean-reverts to a flat position, and all order sizes are capped by position and rate limits. It also reacts to simulated news/sentiment events and arbitrage between dual-listed stocks, and streams PnL and inventory to a live dashboard.

How we built it Python + asyncio/websockets for the exchange connection; a fair-value model combining mid-price, microprice and short-window momentum; an Avellaneda–Stoikov-style spread that widens with volatility; inventory-skewed quoting with hard risk caps; a replay/backtest harness so we could test strategies offline before going live; FastAPI + React dashboard for live PnL, fills and exposure.

Challenges we ran into Rate limits forced us to batch and throttle order updates. Early versions got picked off by faster participants (adverse selection), and inventory drifted during one-sided moves. We fixed this with stricter skewing, volatility-scaled spreads and a kill-switch that flattens exposure when drawdown exceeds a threshold.

Accomplishments that we're proud of [X] PnL over the session with [Y] Sharpe, zero limit breaches, [Z]% uptime, and a bot that recovered from a [event] shock without manual intervention.

What we learned Market making is 20% pricing and 80% risk management. Position limits, latency and adverse selection matter more than a fancy fair-value model.

What's next Volatility-adaptive quoting per instrument, a learned sentiment signal for news events, and a proper multi-day backtester with realistic queue positioning.

Built with Python, asyncio, websockets, NumPy, pandas, FastAPI, React, Docker, Optibook

Built With

Share this project:

Updates

Submission history