This repository contains Python scripts that simulate a market maker's behavior, focusing on buying and selling assets at prices around a "fair value," with inventory and risk management.
- Cash & Inventory Management: Tracks available funds and manages asset holdings.
- Fair Value & Spread Calculation: Computes asset's fair value and adjusts bid/ask prices based on market volatility.
- Order Placement & Risk Management: Places buy/sell orders and handles inventory risk.
- Code 1: Dynamic spreads based on market volatility.
- Code 2: Fixed spreads with basic risk management.
Install the required libraries:
pip install matplotlib numpy
-
Run the desired script:
python market_maker_code1.py # For dynamic spreads python market_maker_code2.py # For fixed spreads
-
The simulation prints trade details and shows a plot of cash balance over time.
Adjust parameters like initial cash, max inventory, spread, and simulation steps.
MIT License.