This program serves as a simplified illustration of MM models and is not intended to be used in production.
Given order book and trade data, the sample market maker is able to update fair prices and generate quotes. The main algorithms are implemented in market_maker.py/MarketMaker. The demonstration and presentation are available on notebook.py. Below are some highlighted features.
- MidPrice: Update fair value based on the market mid price
- KalmanFilter: The observed mid-prices are dynamic and noisy. So we can apply a Kalman filter for better fair value estimation.
- VWAP: Calculate fair value based on trade data using VWAP
- RefOverride: Override fair price using reference price. Reference prices may come from other exchanges with better liquidity
- A simple symmetric quoting algo
- Using Avellaneda & Stoikov’s strategy to find the optimal bid/ask spreads and taking inventory risk into consideration.