ammBoost: State Growth Control for AMMs
TL;DR
ammBoost is a novel sidechain architecture designed to scale Automated Market Makers (AMMs) by offloading high-frequency trading activity to a specialized Layer-2 (L2) while keeping core asset security on the mainchain. It achieves a staggering 96% reduction in gas costs and a 93% reduction in blockchain state growth, allowing AMMs to handle up to 500x the traffic of current platforms like Uniswap.
What Problem Does This Paper Address?
Automated Market Makers (AMMs) are the backbone of Decentralized Finance (DeFi), but they are victims of their own success. High trading volumes lead to two major bottlenecks:
- High Gas Fees: Every swap, mint, or burn requires an on-chain transaction, making trading expensive during periods of congestion.
- State Bloat: Blockchains are becoming massive because they store the entire history of every small trade. This "state growth" makes it harder and more expensive for individuals to run nodes, threatening decentralization.
Existing solutions like sharding or standard rollups often struggle with AMMs because liquidity pools require sequential processing, or they introduce long "challenge periods" (up to 7 days) before a user can withdraw their funds. The authors sought a way to scale AMMs without compromising security, speed, or the ability for the AMM to interact with other apps on the mainchain (composability).
Methods
The authors introduce ammBoost, which utilizes a "dependent sidechain" architecture. Key innovations include:
- Functionality Split: Core asset management stays on the mainchain in a contract called
TokenBank. The heavy lifting—calculating prices for swaps and managing liquidity positions—is offloaded to the ammBoost sidechain. - Epoch-Based Summarization: Instead of sending every single trade to the mainchain, the sidechain processes trades in "epochs." At the end of each epoch, the sidechain committee produces a single Sync transaction that summarizes the net changes (payouts and new balances) and updates the mainchain.
- Blockchain Pruning: Because the mainchain only needs the summary, the bulky transaction history on the sidechain can be safely deleted (pruned) once the Sync transaction is confirmed.
- Sync Authentication (TSQC): To ensure security, the system uses a combination of Quorum Certificates and Threshold Signatures. This ensures that the mainchain only accepts updates from a verified, elected committee of sidechain miners.
- Delayed Token-Payout: While users can trade "instantly" on the sidechain using their deposited balances, the actual movement of tokens on the mainchain happens at the end of the epoch.
Datasets
The researchers evaluated ammBoost using:
- Uniswap V3 Traffic Analysis: They used Dune Analytics to extract and analyze 20 million Uniswap V3 transactions from 2023 to create a realistic traffic model.
- Proof-of-Concept (PoC): A custom implementation built using Go-Ethereum and Solidity.
- Ethereum Sepolia Testnet: Used as the mainchain for empirical performance testing.
- Baseline Comparison: They compared ammBoost against a standard Uniswap V3 deployment and an "Optimism-inspired" rollup (referred to as ammOP).
Key Insights and Ideas
- The "Net Result" Philosophy: The core "aha" moment is that the mainchain doesn't need to know who traded with whom at 2:01 PM. It only needs to know the final balances at the end of the hour. By treating the sidechain as a high-speed calculator for these final states, they eliminate massive amounts of redundant data.
- Maintaining Composability: Unlike many L2 solutions that "silo" an app on a different chain, ammBoost keeps the
TokenBankon the mainchain. This means other mainchain dApps can still interact with the AMM's state. - Solving the Verifier's Dilemma: By using a PBFT-based consensus on the sidechain with cryptographic proofs of election (VRFs), they provide a more immediate security guarantee than the week-long waiting periods required by Optimistic Rollups.
Key Results
The empirical results demonstrate massive efficiency gains:
- Gas Efficiency: Reduced gas costs by 96.05% compared to standard Uniswap deployments.
- Storage Savings: Reduced mainchain state growth by at least 93.42%.
- Throughput: The system achieved a throughput of 138.06 transactions per second, which is roughly 500x the average daily volume of Uniswap.
- Latency: Compared to an Optimism-style rollup, ammBoost showed a 99.94% reduction in transaction finality time (seconds vs. days for final payouts).
Limitations and Future Work
- Flash Loans: Currently, flash loans are still handled on the mainchain because they require "instant" token access within a single block. Consequently, they don't benefit from the sidechain's scaling.
- Withdrawal Latency: While trading is fast, users must wait until the end of an epoch (which the authors suggest could be around 140 seconds to a few minutes) to withdraw "real" tokens back to the mainchain for use in other applications.
- Future Directions: The authors suggest that this "summarization" paradigm could be extended to other DeFi applications beyond AMMs and could eventually incorporate privacy-preserving techniques like Zero-Knowledge proofs.
Summary updated