Market Making
Reinforcement Learning in Market Making is a project that explores the application of RL techniques to develop market-making strategies, comparing them with baseline approaches and conducting experiments on real-world data.
Install / Use
npx skills add ESkripichnikov/market-makingInstalls into whichever agent you are using.
README
Reinforcement Learning in Market Making
This project focuses on utilizing reinforcement learning techniques to develop market-making strategies.
Overview
- Created a trading simulator that includes execution and market data latencies, providing a more realistic testing environment for various market making strategies.
- Implemented the Avellaneda-Stoikov strategy as a baseline for comparison and designed a deep reinforcement learning strategy using the Actor-Critic (A2C) algorithm.
- Conducted extensive experiments on high-frequency data to demonstrate the effectiveness of the reinforcement learning approach, while also identifying its limitations.
Baselines
- Naive Strategy: At each time step, place buy and sell orders at the best available price level.
- Avellaneda-Stoikov Strategy (paper link)
RL Strategy
Environment State Space
- Price Level Distance to Midpoint
- Cumulative Notional Value at Price Level
- Notional Imbalances
- Order Flow Imbalance
- Custom RSI
- Spread
Agent State Space
- Inventory Ratio
- Total PnL
Action State Space

Reward Function and Training Method
- Positional PnL with inventory penalty

- Advantage Actor-Critic (A2C). The A2C update is calculated as

Function Approximator

Experiments
Environment
- Execution Latency: 10ms
- Market Data Latency: 10ms
- Maker Fee: -0.004%
- All orders are Post-Only type
Methodology
- Data:
- BTC/USDT: HFT data for June 23, 2022 (approximately 2.5 million snapshots)
- ETH/USDT: HFT data from January 2, 2023, to January 4, 2023 (approximately 1.3 million snapshots)
- Train-Test Split:
- BTC/USDT: Train - first three hours of data, Test - remaining 21 hours
- ETH/USDT: Train - first six hours of data, Test - remaining 1 day and 13 hours
Results
- BTC:

- ETH:

Conclusions
- Developed a reinforcement learning-based strategy for market making.
- Evaluated the effectiveness of the strategy on real-world data compared to two classical approaches: naive strategy and Avellaneda-Stoikov strategy.
- Limitations of the RL approach include the need for algorithm training, which requires significant time and computational resources, a large number of hyperparameters that impact the final results and need to be tuned, and the inference speed of the RL strategy.
Related Skills
mcp
Use the `mcp_perplexity-ask_perplexity_search` tools to answer questions. You should use this instead of the `web_search` tool because it is a lot more accurate.
practical-power-systems-synthesis
This skill enables synthesis in the domain of power-systems (engineering). It represents research-level-level expertise and is designed for production use in research, industry, and educational contexts. Use this skill when you need to perform synthesis operations related to power-systems.
semi-supervised-optogenetics-testing
This skill enables testing in the domain of optogenetics (neuroscience). It represents intermediate-level expertise and is designed for production use in research, industry, and educational contexts. Use this skill when you need to perform testing operations related to optogenetics.
data-mining-interpretation-fundamental
This skill enables interpretation in the domain of data-mining (data-science). It represents fundamental-level expertise and is designed for production use in research, industry, and educational contexts. Use this skill when you need to perform interpretation operations related to data-mining.
