IDEAS home Printed from https://ideas.repec.org/p/arx/papers/2603.02844.html

Optimal Routing across Constant Function Market Makers with Gas Fees

Author

Listed:
  • Carlos Escudero
  • Felipe Lara
  • Miguel Sama

Abstract

We study the optimal routing problem in decentralized exchanges built on Constant Function Market Makers when trades can be split across multiple heterogeneous pools and execution incurs fixed on-chain costs (gas fees). While prior routing formulations typically abstract from fixed activation costs, real on-chain execution presents non-negligible gas fees. They also become convex under concavity/convexity assumptions on the invariant functions. We propose a general optimization framework that allows differentiable invariant functions beyond global convexity and incorporates fixed gas fees through a mixed-integer model that induces activation thresholds. Subsequently, we introduce a relaxed formulation of this model, whereby we deduce necessary optimality conditions, obtaining an explicit Karush-Kuhn-Tucker system that links prices, fees, and activation. We further establish sufficient optimality conditions using tools from generalized convexity (pseudoconcavity/pseudoconvexity and quasilinearity), yielding a verifiable optimality characterization without requiring convex trade functions. Finally, we relate the relaxed solution to the original mixed-integer model by providing explicit approximation bounds that quantify the utility gap induced by relaxation. Our results extend the mathematical theory for routing by offering no-trade conditions in fragmented on-chain markets in the presence of gas fees.

Suggested Citation

  • Carlos Escudero & Felipe Lara & Miguel Sama, 2026. "Optimal Routing across Constant Function Market Makers with Gas Fees," Papers 2603.02844, arXiv.org.
  • Handle: RePEc:arx:papers:2603.02844
    as

    Download full text from publisher

    File URL: http://arxiv.org/pdf/2603.02844
    File Function: Latest version
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Guillermo Angeris & Akshay Agrawal & Alex Evans & Tarun Chitra & Stephen Boyd, 2022. "Constant Function Market Makers: Multi-asset Trades via Convex Optimization," Springer Optimization and Its Applications, in: Duc A. Tran & My T. Thai & Bhaskar Krishnamachari (ed.), Handbook on Blockchain, pages 415-444, Springer.
    2. Johannes Jahn, 2020. "Introduction to the Theory of Nonlinear Optimization," Springer Books, Springer, edition 4, number 978-3-030-42760-3, August.
    3. Capponi, Agostino & Jia, Ruizhe & Wang, Kanye Ye, 2025. "Maximal extractable value and allocative inefficiencies in public blockchains," Journal of Financial Economics, Elsevier, vol. 172(C).
    4. Guillermo Angeris & Tarun Chitra & Alex Evans & Stephen Boyd, 2022. "Optimal Routing for Constant Function Market Makers," Papers 2204.05238, arXiv.org.
    5. Alberto Cambini & Laura Martein, 2009. "Generalized Convexity and Optimization," Lecture Notes in Economics and Mathematical Systems, Springer, number 978-3-540-70876-6, March.
    6. Agostino Capponi & Ruizhe Jia, 2021. "The Adoption of Blockchain-based Decentralized Exchanges," Papers 2103.08842, arXiv.org, revised Jul 2021.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. C. Escudero & F. Lara & M. Sama, 2024. "Optimal Trade Characterizations in Multi-Asset Crypto-Financial Markets," Papers 2405.06854, arXiv.org.
    2. Fabi, Michele & Prat, Julien, 2025. "The economics of Constant Function Market Makers," Journal of Corporate Finance, Elsevier, vol. 91(C).
    3. Castillo León, Jaime & Lehar, Alfred, 2026. "What data have told us about decentralized finance," Journal of Corporate Finance, Elsevier, vol. 96(C).
    4. Philippe Bergault & Louis Bertucci & David Bouba & Olivier Gu'eant, 2022. "Automated Market Makers: Mean-Variance Analysis of LPs Payoffs and Design of Pricing Functions," Papers 2212.00336, arXiv.org, revised Nov 2023.
    5. Sebastian Jaimungal & Yuri F. Saporito & Max O. Souza & Yuri Thamsten, 2023. "Optimal Trading in Automatic Market Makers with Deep Learning," Papers 2304.02180, arXiv.org.
    6. Agathe Sadeghi & Zachary Feinstein, 2026. "Liquidation Dynamics in DeFi and the Role of Transaction Fees," Papers 2602.12104, arXiv.org.
    7. Marcello Monga, 2024. "Automated Market Making and Decentralized Finance," Papers 2407.16885, arXiv.org.
    8. Boualem Alleche & Vicenţiu D. Rădulescu, 2017. "Further on Set-Valued Equilibrium Problems and Applications to Browder Variational Inclusions," Journal of Optimization Theory and Applications, Springer, vol. 175(1), pages 39-58, October.
    9. Annetta Ho & Cosmin Cazan & Andrew Schrumm, 2024. "The Ecology of Automated Market Makers," Discussion Papers 2024-12, Bank of Canada.
    10. Chengqi Zang & Zhenghui Wang & Weitong Zhang, 2026. "A Dynamic Equilibrium Model for Automated Market Makers," Papers 2603.08603, arXiv.org.
    11. Sorin-Mihai Grad & Felipe Lara, 2022. "An extension of the proximal point algorithm beyond convexity," Journal of Global Optimization, Springer, vol. 82(2), pages 313-329, February.
    12. Alberto Del Pia & Robert Hildebrand & Robert Weismantel & Kevin Zemmer, 2016. "Minimizing Cubic and Homogeneous Polynomials over Integers in the Plane," Mathematics of Operations Research, INFORMS, vol. 41(2), pages 511-530, May.
    13. A. Kabgani & F. Lara, 2023. "Semistrictly and neatly quasiconvex programming using lower global subdifferentials," Journal of Global Optimization, Springer, vol. 86(4), pages 845-865, August.
    14. Giorgio, 2019. "On Second-Order Optimality Conditions in Smooth Nonlinear Programming Problems," DEM Working Papers Series 171, University of Pavia, Department of Economics and Management.
    15. Li, Ruihai & Chan, Ya-Lan & Chang, Chun-Tao & Cárdenas-Barrón, Leopoldo Eduardo, 2017. "Pricing and lot-sizing policies for perishable products with advance-cash-credit payments by a discounted cash-flow analysis," International Journal of Production Economics, Elsevier, vol. 193(C), pages 578-589.
    16. R. Cambini & R. Riccardi & D. Scopelliti, 2023. "Solving linear multiplicative programs via branch-and-bound: a computational experience," Computational Management Science, Springer, vol. 20(1), pages 1-32, December.
    17. Maxim Bichuch & Zachary Feinstein, 2022. "Axioms for Automated Market Makers: A Mathematical Framework in FinTech and Decentralized Finance," Papers 2210.01227, arXiv.org, revised Feb 2025.
    18. Kock, Anders Bredahl & Preinerstorfer, David & Veliyev, Bezirgen, 2023. "Treatment recommendation with distributional targets," Journal of Econometrics, Elsevier, vol. 234(2), pages 624-646.
    19. Chemaya, Nir & Liu, Dingyue, 2024. "The suitability of using Uniswap V2 model to analyze V3 data," Finance Research Letters, Elsevier, vol. 59(C).
    20. Al-Amin Khan, Md. & Shaikh, Ali Akbar & Konstantaras, Ioannis & Bhunia, Asoke Kumar & Cárdenas-Barrón, Leopoldo Eduardo, 2020. "Inventory models for perishable items with advanced payment, linearly time-dependent holding cost and demand dependent on advertisement and selling price," International Journal of Production Economics, Elsevier, vol. 230(C).

    More about this item

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:arx:papers:2603.02844. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: arXiv administrators (email available below). General contact details of provider: http://arxiv.org/ .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.