Skip to main content

Routing MEV in Constant Function Market Makers

  • Conference paper
  • First Online:
Web and Internet Economics (WINE 2023)

Abstract

Miner Extractable Value (MEV) refers to excess value captured by miners (or validators) from users in a cryptocurrency network. This excess value often comes from reordering users’ transactions to maximize fees or from inserting new transactions that front-run users’ transactions. One of the most common types of MEV involves a ‘sandwich attack’ against a user trading on a constant function market maker (CFMM), which is a popular class of decentralized exchange. We analyze game theoretic properties of MEV in CFMMs that we call routing MEV, where an aggregate user trade is routed over a network and potentially sandwich attacked. We present examples where the existence of routing MEV both degrades and, counterintuitively, improves the quality of routing. We construct an analogue of the price of anarchy for this setting and demonstrate that if the impact of a sandwich attack is localized in a suitable sense, then the price of anarchy is constant (The code for all the numerical experiments in this paper can be found at this link: https://github.com/tjdiamandis/mev-cfmm).

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 109.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 139.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    We use ‘miner’ in this paper for consistency with the existing literature, e.g. [8].

  2. 2.

    The existence of such an equilibrium can be established using standard results in nonatomic routing games [18].

References

  1. Angeris, G., Agrawal, A., Evans, A., Chitra, T., Boyd, S.: Constant function market makers: multi-asset trades via convex optimization. In: Tran, D.A., Thai, M.T., Krishnamachari, B. (eds.) Handbook on Blockchain. SOIA, vol. 194, pp. 415–444. Springer, Cham (2022). https://doi.org/10.1007/978-3-031-07535-3_13

    Chapter  Google Scholar 

  2. Angeris, G., Chitra, T., Evans, A.: When does the tail wag the dog? Curvature and market making. Cryptoeconomic Syst. 2(1) (2022)

    Google Scholar 

  3. Angeris, G., Evans, A., Chitra, T.: A note on bundle profit maximization (2021)

    Google Scholar 

  4. Angeris, G., Evans, A., Chitra, T., Boyd, S.: Optimal routing for constant function market makers. In: Proceedings of the 23rd ACM Conference on Economics and Computation, EC 2022, pp. 115–128. Association for Computing Machinery, New York (2022). https://doi.org/10.1145/3490486.3538336. ISBN 9781450391504

  5. Babel, K., Daian, P., Kelkar, M., Juels, A.: Clockwork finance: automated analysis of economic security in smart contracts. arXiv preprint arXiv:2109.04347 (2021)

  6. Bartoletti, M., Chiang, J.H., Lluch-Lafuente, A.: A theory of automated market makers in DeFi. In: Damiani, F., Dardha, O. (eds.) COORDINATION 2021. LNCS, vol. 12717, pp. 168–187. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-78142-2_11

    Chapter  Google Scholar 

  7. Bartoletti, M., Chiang, J.H., Lluch-Lafuente, A.: Maximizing extractable value from automated market makers. arXiv preprint arXiv:2106.01870 (2021)

  8. Daian, P., et al.: Flash boys 2.0: frontrunning, transaction reordering, and consensus instability in decentralized exchanges. arXiv:1904.05234 [cs] (2019)

  9. Diamandis, T., Resnick, M., Chitra, T., Angeris, G.: An efficient algorithm for optimal routing through constant function market makers. arXiv preprint arXiv:2302.04938 (2023)

  10. Flashbots Team. MEV explore (2022)

    Google Scholar 

  11. Goyal, M., Ramseyer, G., Goel, A., Mazières, D.: Finding the right curve: optimal design of constant function market makers. In: Proceedings of the 24th ACM Conference on Economics and Computation, pp. 783–812 (2023)

    Google Scholar 

  12. Heimbach, L., Wattenhofer, R.: Eliminating sandwich attacks with the help of game theory. arXiv preprint arXiv:2202.03762 (2022)

  13. Kulkarni, K., Diamandis, T., Chitra, T.: Towards a theory of maximal extractable value I: constant function market makers. arXiv preprint arXiv:2207.11835 (2022)

  14. CoW Protocol. Cow protocol overview (2022). https://docs.cow.fi/

  15. Qin, K., Zhou, L., Gervais, A.: Quantifying blockchain extractable value: how dark is the forest? arXiv preprint arXiv:2101.05511 (2021)

  16. Qin, K., Zhou, L., Livshits, B., Gervais, A.: Attacking the DeFi ecosystem with flash loans for fun and profit. arXiv preprint arXiv:2003.03810 (2020)

  17. Roughgarden, T.: Intrinsic robustness of the price of anarchy. J. ACM (JACM) 62(5), 1–42 (2015)

    Article  MathSciNet  Google Scholar 

  18. Roughgarden, T.: Selfish Routing and the Price of Anarchy. MIT Press, Cambridge (2005)

    Google Scholar 

  19. Roughgarden, T.: Selfish routing with atomic players. In: Proceedings of the 16th Symposium on Discrete Algorithms (SODA), pp. 1184–1185. Citeseer (2004)

    Google Scholar 

  20. Roughgarden, T., Syrgkanis, V., Tardos, E.: The price of anarchy in auctions. J. Artif. Intell. Res. 59, 59–101 (2017)

    Article  MathSciNet  Google Scholar 

  21. Schlegel, J.C., Kwaśnicki, M., Mamageishvili, A.: Axioms for constant function market makers. Available at SSRN (2022)

    Google Scholar 

  22. Zhou, L., Qin, K., Gervais, A.: A2MM: mitigating frontrunning, transaction reordering and consensus instability in decentralized exchanges. arXiv preprint arXiv:2106.07371 (2021)

  23. Züst, P., Nadahalli, T., Wattenhofer, Y.W.R.: Analyzing and preventing sandwich attacks in Ethereum. ETH Zürich (2021)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Kshitij Kulkarni .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2024 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Kulkarni, K., Diamandis, T., Chitra, T. (2024). Routing MEV in Constant Function Market Makers. In: Garg, J., Klimm, M., Kong, Y. (eds) Web and Internet Economics. WINE 2023. Lecture Notes in Computer Science, vol 14413. Springer, Cham. https://doi.org/10.1007/978-3-031-48974-7_26

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-48974-7_26

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-48973-0

  • Online ISBN: 978-3-031-48974-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics