ammBoost: State Growth Control for AMMs

Nicholas Michel,Mohamed E. Najd,Ghada Almashaqbeh
2024-09-29
Abstract:Automated market makers (AMMs) are a form of decentralized cryptocurrency exchanges that have attracted huge interest lately. They are considered a prime example of Decentralized Finance (DeFi) applications, a large category under Web 3.0. Their popularity and high trading activity have resulted in millions of on-chain transactions leading to serious scalability issues in terms of throughput and on-chain state size. Existing scalability solutions, when employed in the context of AMMs, are either ineffective due to their large overhead, or suffer from security and centralization issues. In this paper, we address these challenges by utilizing a new sidechain architecture as a layer 2 solution, building a system called ammBoost. Our system reduces the amount of on-chain transactions, boosts throughput, and supports blockchain pruning. We devise several techniques to enable layer 2 processing while preserving the correct and secure operation of AMMs. These include a functionality-split and layer 2 traffic summarization paradigm, an epoch-based deposit mechanism, and pool snapshot-based and delayed token-payout trading. We also build a proof-of-concept of ammBoost for a Uniswap-inspired use case to empirically evaluate performance. Our experiments show that ammBoost decreases the gas cost by 96.05% and the chain growth by at least 93.42%, and that it can support up to 500x of the daily traffic volume observed for Uniswap in practice.
Cryptography and Security
What problem does this paper attempt to address?
The problem that this paper attempts to solve is the scalability issue of automated market makers (AMMs) in decentralized finance (DeFi) applications. Specifically, the high trading activities of AMMs lead to a large number of on - chain transactions, which not only increase the storage burden of the blockchain but also result in high transaction fees and low throughput. Existing scalability solutions are either ineffective due to excessive overhead or have security and centralization problems. ### Core Challenges of the Problem 1. **Large - scale On - chain Transactions**: The high trading activities of AMMs generate a large number of on - chain transactions, which increase the storage burden of the blockchain and lead to high Gas fees. 2. **Low Throughput**: The low throughput of the blockchain (for example, Ethereum processes an average of 12 transactions per second) leads to transaction processing and confirmation delays. 3. **Limitations of Existing Solutions**: - **Sharding**: Although it can reduce cross - shard transactions, it cannot cut storage costs and is not applicable to dApps on smart contract blockchains. - **Layer 2 Solutions**: Such as Optimistic Rollups and ZK - Rollups. Although they can improve performance, they also bring long - term dispute periods and security issues. - **Independent Side Chains**: Although they can improve performance, they will affect the composability with other dApps and transfer the storage cost to the side chains. ### Solution To address these challenges, the author proposes a new system named ammBoost. ammBoost utilizes a new side - chain architecture as a Layer 2 solution, aiming to reduce the number of on - chain transactions, increase throughput and support blockchain pruning. Specific technologies include: - **Function Splitting and Layer 2 Traffic Aggregation**: Divide the functions of AMM into two parts, one running on the main chain and the other on the side chain. - **Cycle - based Deposit Mechanism**: Users need to deposit the expected transaction - required tokens on the main chain to support activities on the side chain. - **Transaction Based on Pool Snapshots and Delayed Token Payments**: The side chain obtains the pool token balance from the main chain to calculate the transaction price. Users can use newly obtained tokens in the transaction, but the actual token payment and deposit refund are synchronized to the main chain at the end of the cycle. ### Experimental Results Through experimental verification, ammBoost can significantly reduce Gas costs (96.05%) and chain growth (at least 93.42%), and can support up to 500 times the daily trading volume of Uniswap. ### Summary This paper aims to solve the scalability problem of AMMs in DeFi applications and proposes a new side - chain architecture, ammBoost, to achieve this goal by reducing on - chain transactions, increasing throughput and supporting blockchain pruning.