A2MM: Mitigating Frontrunning, Transaction Reordering and Consensus Instability in Decentralized Exchanges

The asset trading volume on blockchain-based exchanges (DEX) increased substantially since the advent of Automated Market Makers (AMM). Yet, AMMs and their forks compete on the same blockchain, incurring unnecessary network and block-space overhead, by attracting sandwich attackers and arbitrage competitions. Moreover, conceptually speaking, a blockchain is one database, and we find little reason to partition this database into multiple competing exchanges, which then necessarily require price synchronization through arbitrage. This paper shows that DEX arbitrage and trade routing among similar AMMs can be performed efficiently and atomically onchain within smart contracts. These insights lead us to create a new AMM design, an Automated Arbitrage Market Maker, short AMM DEX. AMM aims to unite multiple AMMs to reduce overheads, costs and increase blockchain security. With respect to Miner Extractable Value (MEV), AMM serves as a decentralized design for users to atomically collect MEV, mitigating the dangers of centralized MEV relay services. We show that AMM offers essential security benefits. First, AMM strengthens the blockchain consensus security by mitigating the competitive exploitation of MEV, therefore reducing the risks of consensus forks. AMM reduces the network layer overhead of competitive transactions, improves network propagation, leading to less stale blocks and better blockchain security. Through trade routing, AMM reduces the predatory risks of sandwich attacks by taking advantage of the minimum profitable victim input. AMM also offers financial benefits to traders. Failed swap transactions from competitive trading occupy valuable block space, implying an upward pressure on transaction fees. Our evaluations shows that AMM frees up 32.8% block-space of AMM-related transactions. In expectation, AMM’s revenue allows to reduce swap fees by 90%. We hope that our work engenders further innovation in the space of efficient and censorship-resilient exchanges, which by design democratizes MEV and let the people trade.

[1]  Christian Decker,et al.  Information propagation in the Bitcoin network , 2013, IEEE P2P 2013 Proceedings.

[2]  Donald Beaver,et al.  Cryptographic Protocols Provably Secure Against Dynamic Adversaries , 1992, EUROCRYPT.

[3]  Hubert Ritzdorf,et al.  Tampering with the Delivery of Blocks and Transactions in Bitcoin , 2015, IACR Cryptol. ePrint Arch..

[4]  Arthur Gervais,et al.  High-Frequency Trading on Decentralized On-Chain Exchanges , 2020, 2021 IEEE Symposium on Security and Privacy (SP).

[5]  George Danezis,et al.  SoK: Consensus in the Age of Blockchains , 2017, AFT.

[6]  Jeremy Clark,et al.  SoK: Transparent Dishonesty: Front-Running Attacks on Blockchain , 2019, Financial Cryptography Workshops.

[7]  James Angel,et al.  Fairness in Financial Markets: The Case of High Frequency Trading , 2010 .

[8]  A. Menkveld The Economics of High-Frequency Trading: Taking Stock , 2016 .

[9]  Hubert Ritzdorf,et al.  On the Security and Performance of Proof of Work Blockchains , 2016, IACR Cryptol. ePrint Arch..

[10]  Zekeriya Erkin,et al.  Transaction Propagation on Permissionless Blockchains: Incentive and Routing Mechanisms , 2017, 2018 Crypto Valley Conference on Blockchain Technology (CVCBT).

[11]  Fan Zhang,et al.  Tesseract: Real-Time Cryptocurrency Exchange using Trusted Hardware , 2017, IACR Cryptol. ePrint Arch..

[12]  Benjamin Livshits,et al.  Attacking the DeFi Ecosystem with Flash Loans for Fun and Profit , 2020, Financial Cryptography.

[13]  Fahad Saleh,et al.  Blockchain Without Waste: Proof-of-Stake , 2020, The Review of Financial Studies.

[14]  Pedro Moreno-Sanchez,et al.  SoK: Off The Chain Transactions , 2019, IACR Cryptol. ePrint Arch..

[15]  Andrew Miller,et al.  Measuring Ethereum Network Peers , 2018, Internet Measurement Conference.

[16]  Tom C. W. Lin The New Market Manipulation , 2017 .

[17]  Arthur Gervais,et al.  Quantifying Blockchain Extractable Value: How dark is the forest? , 2021, 2022 IEEE Symposium on Security and Privacy (SP).

[18]  Stephen Taylor,et al.  Arbitrage detection using max plus product iteration on foreign exchange rate graphs , 2020 .

[19]  Fabian Schär Decentralized Finance: On Blockchain- and Smart Contract-Based Financial Markets , 2020, Review.

[20]  Emin Gün Sirer,et al.  Majority Is Not Enough: Bitcoin Mining Is Vulnerable , 2013, Financial Cryptography.

[21]  Ethan Heilman,et al.  Low-Resource Eclipse Attacks on Ethereum's Peer-to-Peer Network , 2020, IACR Cryptol. ePrint Arch..

[22]  Wei Cai,et al.  A Payment Channel Based Hybrid Decentralized Ethereum Token Exchange , 2019, 2019 IEEE International Conference on Blockchain and Cryptocurrency (ICBC).

[23]  T. Maugh Why buy when you can rent? , 1984, Science.

[24]  Jakob Arnoldi,et al.  Computer Algorithms, Market Manipulation and the Institutionalization of High Frequency Trading , 2016 .

[25]  Sebastian Henningsen,et al.  Eclipsing Ethereum Peers with False Friends , 2019, 2019 IEEE European Symposium on Security and Privacy Workshops (EuroS&PW).

[26]  Jiahua Xu,et al.  SOK: Automated Market Maker (AMM) based Decentralized Exchanges (DEXs) , 2021 .

[27]  George Danezis,et al.  Consensus in the Age of Blockchains , 2017, ArXiv.

[28]  Arthur Gervais,et al.  Do you Need a Blockchain? , 2018, 2018 Crypto Valley Conference on Blockchain Technology (CVCBT).

[29]  Robert A. Jarrow,et al.  Market Manipulation, Bubbles, Corners, and Short Squeezes , 1992, Journal of Financial and Quantitative Analysis.

[30]  Cristina Nita-Rotaru,et al.  Under the Hood of the Ethereum Gossip Protocol , 2021, Financial Cryptography.

[31]  Ari Juels,et al.  Flash Boys 2.0: Frontrunning, Transaction Reordering, and Consensus Instability in Decentralized Exchanges , 2019, ArXiv.

[32]  Massimo Bartoletti,et al.  A theory of Automated Market Makers in DeFi , 2021, COORDINATION.

[33]  Emin Gün Sirer,et al.  Decentralization in Bitcoin and Ethereum Networks , 2018, Financial Cryptography.

[34]  Matthew Baron,et al.  Risk and Return in High-Frequency Trading , 2017, Journal of Financial and Quantitative Analysis.

[35]  S. Matthew Weinberg,et al.  On the Instability of Bitcoin Without the Block Reward , 2016, CCS.

[36]  Ethan Heilman,et al.  Eclipse Attacks on Bitcoin's Peer-to-Peer Network , 2015, USENIX Security Symposium.

[37]  Guillermo Angeris,et al.  An Analysis of Uniswap Markets , 2019, Cryptoeconomic Systems.

[38]  Xiaotie Deng,et al.  Approximation and Computation of Arbitrage in Frictional Foreign Exchange Market , 2003, Electron. Notes Theor. Comput. Sci..

[39]  Benjamin Livshits,et al.  On the Just-In-Time Discovery of Profit-Generating Transactions in DeFi Protocols , 2021, 2021 IEEE Symposium on Security and Privacy (SP).

[40]  Massimo Bartoletti,et al.  A Survey of Attacks on Ethereum Smart Contracts (SoK) , 2017, POST.

[41]  Satoshi Nakamoto Bitcoin : A Peer-to-Peer Electronic Cash System , 2009 .

[42]  Jeremy Clark,et al.  SoK: Research Perspectives and Challenges for Bitcoin and Cryptocurrencies , 2015, 2015 IEEE Symposium on Security and Privacy.