# QLAMMP: A Q-Learning Agent for Optimizing Fees on Automated Market Making Protocols

**Authors:** Dev Churiwala, Bhaskar Krishnamachari  
**arXiv:** [2211.14977](https://arxiv.org/abs/2211.14977)  
**Date:** 2022-11-28  
**Summary page:** https://www.summarizepaper.com/en/paper/2211.14977v1/

## Key points

- Automated Market Makers (AMMs) are important for decentralized finance (DeFi)
- Existing DEXs suffer from invariance and cannot adapt to changing market conditions
- Dev Churiwala and Bhaskar Krishnamachari propose an RL framework that optimizes fees collected on AMM protocols
- Q-Learning Agent for Market Making Protocols (QLAMMP) learns optimal fee rates and leverage coefficients for a given AMM protocol
- QLAMMP outperforms static counterparts consistently across all simulated test scenarios
- QLAMMP outperforms Uniswap's fixed-fee model by up to 40% under various market conditions
- Different parameters affect QLAMMP's performance, which could be optimized further
- RL agents can improve liquidity provision and reduce trading costs for users in DeFi.

## Summary

Automated Market Makers (AMMs) have become a crucial component of the decentralized finance (DeFi) ecosystem. These exchanges enable users to trade assets without relying on centralized intermediaries, and they form the foundation for many decentralized exchanges (DEXs). However, existing popular DEXs are static protocols that suffer from invariance and cannot adapt to rapidly changing market conditions. This limitation can lead to high slippage conditions during intractable market movements, causing traders to avoid these platforms. To address this issue, Dev Churiwala and Bhaskar Krishnamachari propose an RL framework that optimizes the fees collected on an AMM protocol. Specifically, they develop a Q-Learning Agent for Market Making Protocols (QLAMMP) that learns the optimal fee rates and leverage coefficients for a given AMM protocol. By maximizing the expected fee collected under various market conditions, QLAMMP outperforms its static counterparts consistently across all simulated test scenarios. The authors demonstrate the effectiveness of their approach by testing it on Uniswap v2, one of the most popular DEXs in DeFi. They show that QLAMMP outperforms Uniswap's fixed-fee model by up to 40% under various market conditions. Furthermore, they analyze how different parameters affect QLAMMP's performance and provide insights into how these parameters could be optimized further. Overall, this study highlights the potential benefits of using RL agents to optimize AMM protocols' fees dynamically. As DeFi continues to grow rapidly, such approaches could play a crucial role in improving liquidity provision while reducing trading costs for users.
