header-langage
简体中文
繁體中文
English
Tiếng Việt
한국어
日本語
ภาษาไทย
Türkçe
Scan to Download the APP

History of AMM evolution

Read this article in 40 Minutes
From Uniswap to Solidly, where is the future of AMM
Original title: "The Evolution of AMMs"

Original author: Benny Attar
Original compilation: The Way of DeFi


Since the emergence of the financial concept, there has been a corresponding financial "market". This concept can be traced back to the spice trade in the 17th century. Market makers provide higher liquidity, but today's market makers have changed dramatically. Today, market makers can provide liquidity on stocks, foreign exchange, and even real assets, and buy any asset with open quotations. Financial markets have also evolved rapidly over time, and over the past few years we have witnessed the rapid growth of Decentralized Finance (DeFi) and the rise of automated market making. In this article, I will mainly analyze the development history of automated market making and its impact on the encryption market.


First, I briefly introduce the history of automated market making and how it has evolved; after that I discuss three generations of AMMs and their segmentation in the crypto market application market. Mathematics, application platforms, and smart contracts have grown in complexity over time, and I hope that through this article, blockchain newbies and seasoned users alike will be able to understand the evolution of automated market makers and understand it better development route.


To fully grasp the content of this article, you first need to understand the following definitions:


< /p>

·Blockchain: a decentralized distributed database, each node conducts continuous verification of transactions that cannot be tampered with. Blockchain is also the underlying technology for all encrypted assets, decentralized applications and smart contracts.


Decentralized Finance (DeFi): Financial products based on smart contracts and blockchain technology, DeFi has opened up the democratization of digital finance revolution.


Automated Market Maker (AMM): A decentralized asset trading pool that allows users to seamlessly trade cryptocurrencies through its liquidity.


Decentralized Exchange (DEX): A peer-to-peer platform that allows users to trade encrypted assets without an intermediary, usually using an AMM as its trading pool.


Liquidity Pool: A digital asset "pool" of encrypted assets stored in a smart contract, on which the AMM operates.


·Liquidity Provider (LP): Equivalent to the market maker in AMM, refers to deposit its encrypted assets into the liquidity pool to increase liquidity In return, they will be rewarded with transaction fees generated by the relevant transaction pool.


Contrary to popular belief, automated market makers were not invented purely for the cryptocurrency market. In fact, AMMs have been studied quite intensively in academia for decades. As early as 2002, Robin Hanson mentioned AMM for the first time in his research on logarithmic market scoring rules. Later, the research on AMM mainly focused on information aggregation (2004), prediction market (2006), and Bayesian model (2012). and in non-crypto domains such as the gaming market (2012).


AMM was first referenced in the crypto space in a 2016 Reddit post by Vitalik  Buterin in which he discussed The idea of building a decentralized trading platform is the same way you run a prediction market. Afterwards, Vitalik's idea began to spread in the community and was quickly followed up by a community. Two years later, Vitalik published a follow-up article on AMM, detailing how he sees the development of decentralized trading platforms. A few months later, Hayden Adams announced the launch of the Uniswap protocol, thus starting the history of the first generation of cryptocurrency AMM.




First Generation AMM: Build The Basics


Uniswap revolutionized automated market makers by introducing them to the crypto space in a very practical way. They came up with the Constant Product Market Maker (CPMM) model, a formula to ensure that DEXs maintain continuous liquidity.


1) The Rise of Constant Product Market Maker (CPMM) and Uniswap


Uniswap introduced a constant product market maker formula to ensure constant liquidity in Ethereum Token transactions. The formula is as follows:


Among them, Rx and Ry refer to the reserves of each Token, f is the transaction fee, and k is a constant. The simplified version is written as follows:

where x is Token 1, y is Token 2, and k is a constant.


Essentially, Uniswap combines two assets being traded into one liquidity pool. The goal of Uniswap is to ensure that the asset size of the liquidity pool remains constant regardless of the size of the transaction. Let's make an analogy: Suppose asset x is ETH and asset y is DAI. In order to keep k constant, x (ETH) and y (DAI) can only trade off each other. When you buy ETH, y (DAI) in the pool ) increases, x (ETH) decreases, so the trading pool will become unbalanced, and it will tilt towards the assets flowing into the pool. At this time, arbitrageurs will participate in exchange for profits (Note: When the trading pool tilts, it means Asset prices deviate so there is room for arbitrage), and eventually return to balance.


x*y=k Market Maker, Vitalik Buterin


The Uniswap CPMM model is a paradigm shift for AMMs for several reasons. First of all, it is the first decentralized trading platform that completely removes the middleman. Second, it realizes the combination of liquidity, fast transaction and on-chain mechanism, and can quote at the correct price, which is revolutionary. Of course the most impressive thing is that this was done in about 300 lines of code. Since its launch, Uniswap has been by far the most used DEX.



Data source: Dune Analytics, @hagaetc


Disadvantages of Constant Product Market Maker (CPMM)


< /p>

Although Uniswap and the first generation of CPMM have made great progress in AMM, there are still some defects, such as: slippage, impermanent loss and security risks.


Slippage is the difference between the expected price of an order and the price at which the order is actually executed. Given the volatility of cryptocurrencies, the price of each token will fluctuate due to transaction volume and activity. Most commonly, pools with little liquidity or suddenly facing large volumes are more susceptible to slippage. The slippage percentage shows how much the price of a particular asset has drifted across the transaction, and also represents the user's tolerance for slippage.


The impermanent loss is the change in the price of the asset you have deposited into your liquidity pool. Due to price fluctuations that occur outside the liquidity pool, users (depositors) who have deposited into the liquidity pool will face the loss of potential income. The greater the change in asset prices, the greater the impermanent losses faced by depositors. So stablecoins are much less risky in terms of impermanence loss, which gets its name because losses do happen impermanently, but I prefer to say divergence loss.


Additional risks affecting CPMM arise primarily from inherent security risks in smart contracts, the platform, and its mempool. As the ecosystem matures, so does security and MEV prevention, and in general anyone entering decentralized finance should be prepared to suffer financial losses as the industry is still in its very early stages.


2) Constant Sum Market Maker (CSMM)


And CPMM ( Constant Sum Market Maker) Another model similar to Constant Sum Market Maker (CSMM). In this AMM (Automated Market Maker), it is very suitable for scenarios where the price change in the transaction is close to zero, but it cannot provide unlimited liquidity, they follow the following formula:




where Rx and Ry are the reserves of each Token, f is the transaction fee, and k is a constant. A simpler formula would be:


where x is Token 1, y is Token 2, and k is a constant. According to this formula, a straight line can be drawn as follows.



CSMM visualization (Dmitriy Berenzon )


However, when the off-chain price does not match the Token in the pool, this design will give traders and arbitrageurs the opportunity to consume the pool The reserve fund will destroy the stability of the liquidity pool, and the assets in the liquidity pool will be concentrated in a certain asset, so that the liquidity pool will not be able to function normally. It is also for this reason that CSMM has become a model that AMM is rarely used.



The homogeneous attribute of the automated market maker ( Jensen, Nielsen, Pourpouneh, Ross )


Constant Mean Market Maker (CMMM)

< p>

This type of AMM model is mainly the Constant Mean Market Maker (CMMM) promoted by Balancer  . In this AMM, each liquidity pool can have more asset types than the traditional two assets, and it is different from the classic 50:50 weighting system. In this mode, different assets can be weighted differently, but it needs Finally, the weighted geometric mean of each asset reserve is guaranteed to remain unchanged. CMMM satisfies the following equation:



where R is each asset reserves, w is the weight of each asset, and k is a constant. In an equal liquidity pool with three assets, the equation can be simplified as follows:


where x is Token 1 and y is Token 2, z is Token 3, k is a constant. There is a very detailed introduction in the Balancer documentation.



Source: Balancer White Paper


CMMMs do not solve the problems of the first generation of AMMs, such as impermanent losses and low capital efficiency, despite being able to apply up to eight different assets simultaneously , the first generation of AMMs remains the cornerstone upon which modern AMMs are built.


Second Generation AMM: Improving Flaws


In First Generation AMM , price volatility, impermanent losses, capital efficiency, safety and usability issues have a significant impact on AMMs. Fortunately, society is eager for innovation. Not long after the first generation of AMM appeared, a new generation of AMM was born. It is difficult for us to give the exact time of its appearance, but the summer of DeFi in 2020 is undoubtedly an important catalyst. The most famous of the new generation of AMMs is Curve  's Stableswap.


1) Hybrid CPMM and Curve.Fi


Curve Finance will traditional The combination of CPMM and CSMM creates a hybrid CPMM, also known as Stableswap (Translator's Note: Stableswap has the characteristics of low slippage of constant sum and infinite liquidity of constant product), among which Curve proposes an advanced The formula, which can create exponentially dense liquidity, most of this curve is a linear exchange rate, the specific formula is as follows:




where x is the amount of reserves for each asset, n is the number of assets, D is the invariant (total value in reserves), A is the magnification factor (similar to a "lever", which represents the degree of curvature of the curve).   


Curves Stableswap is a special kind of CSMM, when the flow pool is balanced, it is CSMM, and once the pool becomes unbalanced, it will switch to CPMM , which significantly reduces slippage when trading underlying assets by finding their own market fit.



Curve White Paper


Curve's Stableswap is very suitable for stablecoins, because in this mode it has little impact on the transaction price. The second edition of AMM.


Curve is undoubtedly one of the winners of the second-generation AMM, even in the face of the current bear market, Curve's locked TVL still occupies a large share.



Data source: Dune Analytics, @naings


In addition to Curve, there are many other major achievements of the second generation AMM, and some of these extensions also solve our problems in the first generation AMM. various problems encountered.


2) Other 2nd Generation AMM


Virtual Automated Market Maker (vAMM), Derivatives and Perpetual Agreement


The Perpetual Agreement uses a 100% on-chain model to open perpetual contract transactions, introducing AMM into a new application field. Simply put, a perpetual contract is a derivative similar to a futures contract but without an expiration date. Perpetual protocols use the same AMM formula as Uniswap ( x * y = k ), but without a liquidity pool (k) to store assets. Instead, all assets are stored in smart contracts, which contain all vAMM-enabled assets. As the "virtual" part of vAMM implies, vAMM is not an exchange of real tokens, but is used to exchange virtual synthetic assets, such as derivatives.


Since the launch of Perpetual Protocol, there has been a lot of innovation and hype around on-chain derivatives trading, and many other platforms have emerged such as: Synthetix   ;, GMX, FutureSwap, etc.


Proactive Market Maker (PMM) and  DODO 

< br>

In order to increase the liquidity of the agreement and maximize the utilization rate of funds, DODO introduces a proactive market maker (PMM). In short, PMMs leverage on-chain oracles to gather accurate price data and aggregate liquidity around current market prices. To do this, DODO needs to move the curve of the asset pool in a timely manner to ensure that sufficient liquidity is available and create a flatter curve across the market price. As the curve becomes flatter and liquidity becomes more widespread, users benefit from lower slippage. DODO also implements unilateral liquidity. One transaction corresponds to two independent pools (one buying pool and one selling pool). From some perspectives, PMM is closer to the traditional market maker model.


DODO PMM curve and Uniswap AMM curve (DODO)


Bancor


Bancor is one of the earliest DeFi native projects. The development of Bancor is also full of drama. Bancor is the first and largest AMM launched in the form of TGE in the history of the blockchain. However, centralization and security issues in the first few months hindered the development of Bancor and eventually led to Uniswap Coming from behind to achieve market dominance.


However, Bancor itself had some innovations worth mentioning. The original Bancor protocol invented what is now liquidity pools , back then they called it “relays” and “smart tokens”. Bancor V2 and V2.1 bring impermanence loss protection (after 100 days of asset collateralization) and one-sided liquidity. Bancor 3 introduces instant impermanent loss protection, automatic compounding and double-sided rewards, and various other interesting features. However, in recent months, some design issues with the protocol have hindered its entry into the top DEX ranks.


SushiSwap and Liquidity Mining


In August 2020, an anonymous developer forked the source code of Uniswap and created a project that is more concerned by the DeFi community through governance Token and staking rewards. Through the vampire attack on Uniswap, Sushiswap quickly gained popularity and attracted a large number of users. In the history of DeFi, the first "hostile takeover" on the chain occurred. After the attack, Sushiswap obtained nearly 9% of DEX transaction volume and a large number of Community attention. However, a few days later, the pseudonymous founder Chef Nomi sold the entire development fund for 38undefined000 ETH (approximately $14 million), sparking outrage from the community, Chef Nomi returned the funds and issued an apology message. Since its controversial inception, Sushiswap has developed a highly respected DeFi ecosystem, which includes a set of DeFi tools, including multi-chain DEX, lending market, Token launchpad, liquidity network frame reward system and most recently AMM development framework . Despite a rocky start, Sushiswap has built an awesome reputation for itself.


Aggregator


Although Aggregators are not a core part of the development of AMMs, but during the second generation of AMMs, another innovation worth mentioning emerged: DEX aggregators. In short, DEX aggregators can obtain liquidity from different DEXs and provide users with the best Token exchange rate. The most famous DEX aggregator is 1inch  , others such as: Paraswap, OpenOcean  . Recently, CowSwap has also made some interesting innovations in the aggregator field.


3) Review of the second generation AMM


In the second generation AMM , we saw that the problems that arose in the first generation of AMMs were being solved through complex mathematical equations, unique liquidity pool designs, and the creation of various financial use cases for AMMs.


Third Generation AMM: Contemporary Behemoth


In dissecting the second After the innovations of the first-generation AMMs, one would think that the third-generation AMMs would take these transformations to a higher level with more sophisticated research and solutions, but the third-generation AMMs are mainly composed of two self-innovations from the second generation and Newer behemoths dominate: Uniswap V3 and Curve V2.


In this section, we will analyze their breakthrough innovations, their dominance and how they cornered the market. We will end this chapter with several other AMMs that have brought significant innovations in recent months, from the timeline, the third generation of AMMs started in mid-2021 until the cryptocurrency bear market in recent months.


1) Uniswap V3 and centralized liquidity


Earlier, we discussed The birth of Uniswap and its dominance in the market. In May 2020, Uniswap launched their second version, Uniswap V2, which introduced ERC20 pairs, price oracles, flash swaps, and various other technical improvements. While there are no notable changes to the surface of the platform, it's certainly an innovative step. And Uniswap V3 has created a new paradigm of automated market makers.



Uniswap version source: Kyros Ventures Kyros Ventures


In March 2021, Uniswap announced the third iteration of Uniswap V3. In the update, they introduced two major new features: pooled liquidity and multiple fee tiers. Concentrated liquidity allows LPs to finely control the price range of their capital allocation, thereby significantly improving capital efficiency and reducing slippage, while also preventing any asset flash-downs, and flexible fees give LPs the opportunity to Currency pairs adjust their margins based on expected volatility.




Since the launch of Uniswap V3, They have around $700B in volume, 90% of all Uniswap variants traded, and have the lion's share of the DEX market with over $5.5B in TVL (peaking at $10B in Nov 2021) part.



Data source: Dune Analytics @Bibip


2) Curve V2 and automation


We previously discussed the Hybrid CPMM created by Curve, Stableswap and their future in directly pegged assets The rise of centralized exchanges. A few months after the release of Uniswap V3, Curve announced their Curve V2 rivalry with Uniswap V3.


In Curve V2, Curve expands their Stableswap innovation and enables effective pools for all assets, not just stablecoins . In addition, similar to Uniswap V3, Curve also introduces centralized liquidity, but there is one caveat: LPs cannot choose their liquidity range. Instead, Curve’s internal market-making algorithms and price oracles create liquidity bands that create a passive environment for LPs. Curve believes that centralized liquidity on Uniswap is too difficult for newcomers to DeFi, and Curve V2 is more friendly to novices. In addition to automated pooling of liquidity, Curve also introduces custom pools to suit any LPs on mind (although creating pools is fairly complex).


While centralized liquidity is a groundbreaking invention in automation, it also prevents experienced DeFi users from actively managing their funds. Coupled with Curve's intimidating user experience, more altcoins still choose Uniswap. Having said that, Curve has a better performance than Uniswap in terms of efficiency and price slippage.


Curve does have ~$500M more TVL than Uniswap at the time of writing, though its peak TVL is more than twice that of Uniswap (240 One hundred million U.S. dollars). However, in various other metrics such as volume, revenue, and market cap, Curve consistently ranks behind Uniswap.



Uniswap and Curve over the past 180 days (Source: Token Terminal)


The daily circulating market value of Uniswap, Curve and Balancer in the past 365 days (Source: Token Terminal )


In summary, Curve may appeal to more advanced DeFi users, trends show that Curve's dominance is growing, given their technology is comparable to Uniswap Even stronger, market awareness and application expansion are the main reasons holding back its growth. But in the end, Uniswap V3 and Curve V2 are the two main winners of the third generation of AMMs, and it is worth mentioning other noteworthy AMM innovations in the third generation, although these have not received as much attention as Uniswap and Curve , but their technology should not be underestimated either.


3) Other third generation AMM


Solidly< br>


Solidly is an AMM built on the public chain Fantom  , allowing low-cost, near-zero slippage transactions for related and non-related assets. Although it does not have any significant AMM design innovations, Solidly has a complex token economics mechanism, and the related design encourages rapid growth in transaction volume and asset volume, unlike traditional encrypted AMMs that only incentivize liquidity providers. Solidly rose to fame due to its founder, Andre Cronje. As the father of DeFi, he eventually chose to leave the industry and caused the entire Fantom TVL to plummet, but Solidly also brought a lot of fame to Fantom.




Lifinity

Lifinity


Lifinity is built on the Solana blockchain, extending and combining some AMM mechanisms of Uniswap and DODO: active market making and centralized liquidity sex. Although centralized liquidity improves capital efficiency, the problem of impermanent loss is still prevalent. Therefore, Lifinity adds an active market-making mechanism, the Pyth oracle, to the centralized liquidity. Since Lifinity's liquidity pools do not rely on arbitrageurs to keep prices accurate, the risk of impermanent losses is greatly reduced. Lifinity has also added an automatic rebalancing mechanism to ensure that the value of the two assets in the pool remains the same.


Lifinity uses oracles and centralizes liquidity Active Market Making


The Future of AMM: Solving the Core Problem


In this article we discuss How cryptocurrency AMMs have evolved from simple algebraic equations to innovative ecosystems. Currently, developer interest in DeFi is growing and product usability is improving.


However, the biggest hurdle to overcome right now is in the ecosystem. Active users in decentralized finance are still only a small fraction of the total cryptocurrency users, let alone in the global financial system. To create a new financial paradigm, users are the premise. While addressing issues such as impermanent loss, capital efficiency, and slippage has a positive impact on promoting the global adoption of DeFi, these innovations often make DeFi more complex. A good product may be "DeFi in the back, FinTech in the front" (referring to the underlying backend of the application is decentralized finance, and the user experience can be as seamless as modern financial technology), which is also leading this A necessary condition for a trend.


From the data point of view, Uniswap is currently the largest DEX with 600,000 unique users in its history. On the other hand, Coinbase   The largest CEX with more than 100 million users. This means that even if more than 100 million people are already interested in cryptocurrencies but have not entered the DeFi space, where they can control their asset investments, platforms that facilitate the transition of new crypto users to DeFi will win Victory in the "DEX Wars".


In fact, we have seen this trend on many DeFi platforms. These protocols tend to prioritize well-written documentation, simple layouts, and gamified platforms, making it easier for beginners to enter the world of decentralized finance.


Last week, Trader Joe's, the largest DEX on Avalanche   announced their new AMM liquidity book, which allows liquidity to be priced at a fixed Positions take the idea of concentrating liquidity one step further, and also have an easy-to-use integrated financial ecosystem, which may be the current development trend. Other innovations in recent months include hybrid AMMs, MEV capture AMMs, and increased use cases for Bitcoin in the DeFi environment. The long-awaited merger of ETH next month will also greatly affect the development of decentralized finance, and will also provide greater bandwidth for transactions after Ethereum's energy consumption has been reduced by 99%.


All in all, how decentralized finance can be applied in mainstream scenarios is still the biggest obstacle before us, but through the introduction of this article, I can be sure The best thing is that this industry is improving every day.


Original link


Welcome to join the official BlockBeats community:

Telegram Subscription Group: https://t.me/theblockbeats

Telegram Discussion Group: https://t.me/BlockBeats_App

Official Twitter Account: https://twitter.com/BlockBeatsAsia

Choose Library
Add Library
Cancel
Finish
Add Library
Visible to myself only
Public
Save
Correction/Report
Submit