Batching Trades on Automated Market Makers

Authors Andrea Canidio , Robin Fritsch

Thumbnail PDF


  • Filesize: 0.69 MB
  • 17 pages

Document Identifiers

Author Details

Andrea Canidio
  • CoW Protocol, Lisbon, Portugal
Robin Fritsch
  • Cow Protocol, Lisbon, Portugal
  • ETH Zürich, Switzerland


We are grateful to Felix Leupold and Martin Köppelmann for initial discussions on batch trading on AMM that led to the writing of this paper. We also thank Haris Angelidakis, Eric Budish, Agostino Capponi, Felix Henneke, Fernando Martinelli, Ciamac Moallemi, Andreas Park, and Anthony Lee Zhang for numerous comments and suggestions.

Cite AsGet BibTex

Andrea Canidio and Robin Fritsch. Batching Trades on Automated Market Makers. In 5th Conference on Advances in Financial Technologies (AFT 2023). Leibniz International Proceedings in Informatics (LIPIcs), Volume 282, pp. 24:1-24:17, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2023)


We consider an automated market maker (AMM) in which all trades are batched and executed at a price equal to the marginal price (i.e., the price of an arbitrarily small trade) after the batch trades. We show that such an AMM is a function maximizing AMM (or FM-AMM): for given prices, it trades to reach the highest possible value of a given function. Competition between arbitrageurs guarantees that an FM-AMM always trades at a fair, equilibrium price, and arbitrage profits (also known as LVR) are eliminated. Sandwich attacks are also eliminated because all trades occur at the exogenously-determined equilibrium price. Finally, we show that our results are robust to the case where the batch has exclusive access to the FM-AMM, but can also trade on a traditional constant function AMM.

Subject Classification

ACM Subject Classification
  • Applied computing → Economics
  • Arbitrage profits
  • Loss-vs-Rebalancing (LVR)
  • MEV
  • Sandwich attacks
  • AMM
  • Mechanism design
  • Batch trading


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. Jun Aoyagi. Liquidity provision by automated market makers. working paper, 2020. URL:
  2. Lorenz Breidenbach, Phil Daian, Florian Tramèr, and Ari Juels. Enter the hydra: Towards principled bug bounties and Exploit-Resistant smart contracts. In 27th USENIX Security Symposium (USENIX Security 18), pages 1335-1352, 2018. Google Scholar
  3. Eric Budish, Peter Cramton, and John Shim. The high-frequency trading arms race: Frequent batch auctions as a market design response. The Quarterly Journal of Economics, 130(4):1547-1621, 2015. Google Scholar
  4. Andrea Canidio and Vincent Danos. Commitment against front running attacks, 2023. URL:
  5. Andrea Canidio and Robin Fritsch. Arbitrageurs' profits, lvr, and sandwich attacks: batch trading as an amm design response, 2023. URL:
  6. Agostino Capponi and Ruizhe Jia. The adoption of blockchain-based decentralized exchanges, 2021. URL:
  7. Chainlink. What is the blockchain oracle problem? Retrieved from on May 24, 2023, 2020. Online forum post.
  8. Nicolás Della Penna. Mev minimizing amm (minmev amm). Retrieved from on May 24, 2023, september 1 2022. Online forum post.
  9. Matheus V. X. Ferreira and David C. Parkes. Credible decentralized exchange design via verifiable sequencing rules, 2023. URL:
  10. Joshua S Gans and Richard T Holden. A solomonic solution to ownership disputes: An application to blockchain front-running. Technical report, National Bureau of Economic Research, 2022. Google Scholar
  11. Lioba Heimbach and Roger Wattenhofer. Sok: Preventing transaction reordering manipulations in decentralized finance. In Proceedings of the 4th ACM Conference on Advances in Financial Technologies, AFT '22, pages 47-60, New York, NY, USA, 2023. Association for Computing Machinery. URL:
  12. Josojo. Mev capturing amm (mcamm). Retrieved from on May 24, 2023, august 4 2022. Online forum post.
  13. Mahimna Kelkar, Fan Zhang, Steven Goldfeder, and Ari Juels. Order-fairness for byzantine consensus. Cryptology ePrint Archive, Paper 2020/269, 2020. URL:
  14. F. Leupold. Cow native amms (aka surplus capturing amms with single price clearing). Retrieved from on May 24, 2023, november 1 2022. Online forum post.
  15. Jason Milionis, Ciamac C. Moallemi, and Tim Roughgarden. Automated market making and arbitrage profits in the presence of fees, 2023. URL:
  16. Jason Milionis, Ciamac C. Moallemi, Tim Roughgarden, and Anthony Lee Zhang. Automated market making and loss-versus-rebalancing, 2023. URL:
  17. Andreas Park. Conceptual flaws of decentralized automated market making. Technical report, Working paper, University of Toronto, 2022. Google Scholar
  18. Kaihua Qin, Liyi Zhou, and Arthur Gervais. Quantifying blockchain extractable value: How dark is the forest? In 2022 IEEE Symposium on Security and Privacy (SP), pages 198-214. IEEE, 2022. Google Scholar
  19. Geoffrey Ramseyer, Mohak Goyal, Ashish Goel, and David Mazières. Augmenting batch exchanges with constant function market makers, 2023. URL:
  20. Jan Christoph Schlegel, Mateusz Kwaśnicki, and Akaki Mamageishvili. Axioms for constant function market makers, 2023. URL:
  21. Christof Ferreira Torres, Ramiro Camino, et al. Frontrunner jones and the raiders of the dark forest: An empirical study of frontrunning on the ethereum blockchain. In 30th USENIX Security Symposium (USENIX Security 21), pages 1343-1359, 2021. Google Scholar