Improving Efficiency in Automated Market Makers
A new approach using sidechains to enhance AMM performance and reduce costs.
― 6 min read
Table of Contents
Automated Market Makers (AMMs) are a type of exchange in the world of cryptocurrencies that allow users to trade tokens without needing a traditional order book. They have gained a lot of popularity, becoming a significant part of decentralized finance (DeFi). Typically, AMMs work by creating Liquidity pools. These pools hold pairs of tokens and allow users to swap between them.
However, the increasing use of AMMs has led to some problems. As the number of users grows, the number of transactions increases, leading to issues related to storage space and transaction costs. This paper discusses a new solution to make AMMs more efficient by reducing the amount of on-chain data they generate.
The Challenge of AMMs
AMMs like Uniswap, Curve, and others have seen huge amounts of trading activity. For example, during the first half of 2023, the AMM industry saw trading volumes reach trillions of dollars, making it clear that AMMs are here to stay. But with great popularity comes issues. More transactions mean larger storage needs on the blockchain and increased Gas Fees, which are the costs associated with processing transactions.
A significant percentage of these issues stems from AMMs generating millions of on-chain transactions. For instance, Uniswap V3 alone accounted for about 20 million transactions in 2023. With so many transactions, the blockchain accumulates large amounts of data, which can slow down processing times and increase costs.
Limitations of Current Solutions
To tackle the scalability problem of AMMs, various solutions have emerged. Some focus on improving the blockchain itself, while others look at secondary layers that process some activities off the main chain. However, these solutions often have their own weaknesses.
For example, while methods like sharding aim to divide the workload to improve efficiency, they can still fall short when it comes to AMMs. These methods often do not effectively reduce storage needs and can affect the performance and security of AMMs.
Similarly, techniques that involve rolling transactions off the main blockchain into Sidechains also face difficulties. They sometimes have lengthy waiting periods and can introduce security risks. A better approach may be needed to address these challenges effectively.
A New Sidechain Approach
Researchers have proposed new ways to use sidechains as a solution for the problems that AMMs are facing. A sidechain is a separate blockchain that runs parallel to the main blockchain. The idea is to shift most of the AMM data processing to this sidechain, while the main blockchain handles essential tasks.
One proposed framework for this is called chainBoost. It enables the sharing of workload between the mainchain and sidechain, which helps in reducing data size and improving overall efficiency.
Introducing the Proposed System
The new system, which will be examined, takes advantage of the chainBoost framework to enhance AMMs. It does so by splitting AMM operations into two parts. The main blockchain will still manage the core functions, like user deposits and keeping track of token balances, while the sidechain will handle the bulk of the Transaction Processing.
This dual system allows the sidechain to manage activities like swaps and liquidity management, reducing the amount of data sent to the main blockchain. The goal is to lessen storage demands, decrease transaction costs, and create a smoother experience for users.
Benefits of the Proposed System
The benefits of using this dual approach in AMMs are noteworthy. The system aims to:
- Reduce Gas Costs: By processing most transactions on the sidechain, total gas costs for users can drop significantly.
- Lower Storage Requirements: The main blockchain will not have to store all transaction details, reducing the overall growth of the blockchain itself.
- Increase Transaction Speed: Since the sidechain can process transactions more quickly, users will experience fewer delays in their trades.
- Maintain Security: The security protocol for the AMM will still be upheld, ensuring that transactions remain safe and valid.
How the System Works
The proposed system organizes the AMM workload in an efficient manner. Here's how it functions:
Two-Part Structure: The AMM is divided into two sections – the base smart contract on the main blockchain and the sidechain that processes transactions.
Transaction Handling: When a user wants to trade tokens, they will first make a deposit on the main blockchain. After that, most of their trading activity is managed on the sidechain, which handles swaps, liquidity additions, and fee collections.
Syncing: At the end of each trading period, the sidechain will send a summary of all its activities back to the main blockchain. This summary will update the state of the AMM, reflecting all changes that have happened during that period.
Pruning Stale Data: Once the summary is confirmed on the main blockchain, unnecessary transaction details can be removed from the sidechain, which helps in managing storage efficiently.
Security Measures
While the system aims to improve efficiency, it also prioritizes security. The sidechain relies on a consensus mechanism to ensure that all transactions are valid and that only authorized parties process transactions.
The consensus protocol used helps to prevent malicious actors from interfering with transactions. If any issues arise, the system can revert to a previous state to ensure that the integrity of the AMM is not compromised.
Performance Evaluation
The proposed system has been tested in various simulated environments, focusing on its performance in terms of gas costs, transaction speed, and overall efficiency.
Experiments show that the new system can achieve a considerable reduction in gas fees compared to standard AMM systems. Users have reported faster transaction times and improved experiences when trading tokens.
Future of AMMs
As the world of cryptocurrencies continues to evolve, so too will the need for more efficient and scalable solutions like the proposed sidechain approach for AMMs. By adopting new technologies and methods, AMMs can maintain their popularity while continuing to serve users well.
In conclusion, AMMs are a vital part of decentralized finance, and optimizing their efficiency through sidechains can provide significant benefits. By reducing storage demands and gas costs while maintaining security, the proposed system aims to enhance the trading experience for users around the world.
Conclusion
The world of decentralized finance is rapidly changing, and with it, the methods by which we trade and manage digital assets. As AMMs grow in popularity, so do the challenges they face. This new approach using sidechains could be the solution to many of those challenges, marking a significant step forward in the evolution of decentralized trading platforms.
Title: ammBoost: State Growth Control for AMMs
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.
Authors: Nicholas Michel, Mohamed E. Najd, Ghada Almashaqbeh
Last Update: 2024-09-28 00:00:00
Language: English
Source URL: https://arxiv.org/abs/2406.17094
Source PDF: https://arxiv.org/pdf/2406.17094
Licence: https://creativecommons.org/licenses/by/4.0/
Changes: This summary was created with assistance from AI and may have inaccuracies. For accurate information, please refer to the original source documents linked here.
Thank you to arxiv for use of its open access interoperability.