DLAMM: Unveiling the Future of AMM with iZiSwap
A Brief History of AMM
At the end of 2018, Uniswap came out of nowhere. Uniswap didn't use the order book like other DEXs of the same period, but instead adopted the automated market maker (AMM) model to combat a series of problems, including slow transaction confirmation, caused by the network performance of Ethereum.
While Uniswap has proven the possibilities of AMM in practice, the performance trade-offs have also caused many problems, such as inevitable slippage and impermanent losses, criticism of capital inefficiencies, occasional sandwich attacks, and poor user experience with a single swap order type.
In May 2020, Uniswap v2 was introduced, adding a new token-token swap to v1 and making it harder to manipulate prices. This seemed more like a patch on v1 than an optimization of the AMM model. So a year later, in May of 2021, the Uniswap team launched Uniswap v3, introducing the familiar concentrated liquidity solution.
Specifically, in v1 and v2, when an LP provides liquidity to a liquidity pool, the liquidity will be allocated across all price bands of (0, ∞). Most assets will only trade within a certain price range, so a large portion of the liquidity is never used, making it quite inefficient in terms of capital. In contrast, v3's concentrated liquidity solution allows LPs to choose the price range in which to provide liquidity, and LPs are only rewarded with fees if the assets are traded within the chosen price range. This increases the capital efficiency of AMMs to an unprecedented level. In contrast, slippage, and impermanent losses have been somewhat mitigated.
While Uniswap v3 solved AMM's capital efficiency problem at the moment, there are still a number of other issues that need to be addressed. 2 years have passed since Uniswap v3 went live, and it is reasonable to wonder if the Uniswap team is working on Uniswap v4. While we look forward to Uniswap v4, we also take this opportunity to see what innovations have emerged from AMM in the past 2 years.
In May 2022, iZUMi Finance launched its DEX, iZiSwap, proposing a new AMM model, Discretized-Liquidity-AMM (hereinafter referred to as DLAMM).
Specifically, DLAMM is based on the Constant Product AMM, which discrete a continuous price curve into a finite number of price points. Other than these points, the price of a trading pair does not take any other value during the fluctuation. Liquidity providers can only provide liquidity at these points, and traders can only trade at points.
In DLAMM, the market price will only be at a discreted price point and only the liquidity pool at the market price point will contain two types of tokens. The liquidity pool above the market price point will only contain one token and the liquidity pool below the market price will only contain the other. Trade at any price point directly affects the proportion of the liquidity pool at that price point, but the trade price remains constant until the liquidity at that price point runs out, and the market price will move to the adjacent price point and continue to repeat the process.
Advantages of DLAMM Model
Through careful study, we can find that the underlying logic of the DLAMM model is in fact very similar to the order book model, which we believe is one of the future trends of DEX. Uniswap's introduction of the AMM model was the result of a trade-off between the performance of Ethereum at that time and the convenience of the service for traders. But it also brought various problems. As the infrastructure develops and iterates, the flaws of the AMM model will be gradually optimized, and DEX will gradually move closer to the order book model. In November 2022, Trader Joe v2 was launched, in which Trader Joe also uses the AMM model similar to DLAMM.
The main advantages of the DLAMM model compared to the current DEX are as follows:
- The price points of DLAMM are more accurate than the price curve of the Constant Product AMM. The price curve of the Constant Product AMM is a continuous smooth curve, but the effect of any trade on the price is not smooth. The Constant Product Model can only determine the price before and after the trade occurs by the ratio of the liquidity pool before and after the trade. While the actual price of each trade needs to be calculated based on the change in the liquidity pool after the real trade. For example, when trading on Uniswap, traders need to set the size of the trade, the maximum slippage they can afford, etc. before trading, and Uniswap will estimate an approximate price based on the information submitted by the user. In case of low liquidity, this estimated price may be far from the actual transaction price. On iZiSwap, however, these price points are determined by a discrete price formula calculation, with p representing the relative price of two tokens in a pair. This makes the transaction price more predictable and improves the transparency of the transaction.
- While satisfying traders' need for price accuracy, DLAMM further increases the efficiency of capital utilization. In reality, when describing the price of a token, people often do not describe it very precisely, but are used to having a minimum incremental interval. For example, when the price of $ETH is $1,817.26, it is often necessary to be precise only to the single-digit $1,817 and sometimes even to the tens digit $1,820. Therefore, using a relative minimum price increment interval of 1‱ is sufficient to suit the price sensitivity of traders in most cases. At the same time, this design also allows liquidity within the price point's proximity to the price point to converge on the price point, allowing for further capital utilization. Traders' trades within a given price point conform to the constant sum model, i.e., with sufficient liquidity, trades within a single price point do not even generate slippage.
- Full adaptation to limit orders. Due to the fact that DLAMM determines the price points that will be tradable in advance, it is also possible to adapt limit orders. iZiSwap launched a new version of iZiSwap Pro in December 2022. In this new version, iZiSwap offers on-chain limit orders. Limit orders submitted by traders are added to the liquidity pool at the price point in the form of reverse liquidity, which is hedged against the liquidity provided by LPs to enable limit order trading when market price reach within the trader's order range. In parallel with limit orders, iZiSwap has also introduced a user interface adapted to limit order mode. Users can also switch between the classic AMM DEX trading interface and the limit order interface at any time, allowing traders accustomed to AMM DEX and centralized exchanges to trade smoothly on iZiSwap.
- Compared to the current order book DEXs, the limit order DLAMM is more secure. This is because the order book DEXs are still composed of an off-chain trade aggregation engine, and an on-chain trading record. For example, in order to trade on dYdX, a trader needs to make a deposit to dYdX first. While this deposit transaction is recorded on the blockchain, and every transaction made by a user on dYdX is recorded on the Ethereum mainnet in the form of a Rollup with proof of zero knowledge. While DLAMM is still AMM, traders only interact with the liquidity pool without counterparties and therefore do not need a centralized trade aggregation engine. Traders can just place an order and wait for the market price to reach the order price and then close it. On iZiSwap, users interact without depositing/withdrawing, eliminating the risk of funds custody.
Since its launch in May 2022, iZiSwap has gone through 1 year of development practice and DLAMM has stood the test of traders. At the same time, iZiSwap is constantly being updated to provide a better trading experience for its users. These user-friendly innovations have indeed been seen by users, especially since the launch of zkSync Era, which has seen iZiSwap's TVL rise rapidly to over $100 million.
We believe that innovation based on AMM will not stop. When will the era of Uniswap v4 come? Will it bring us more surprises? It's hard to say, but iZiSwap has already laid another solid foundation on the road to AMM innovation, making the future of AMM even more desirable.