AMMs are a sort of decentralized exchange (DEX) that utilize algorithmic “money robots” to make it simple for independent traders to purchase and sell crypto assets. Users trade directly via the AMM rather than with other individuals, as they would with a regular order book. Market makers are companies entrusted with creating liquidity for a traded asset on an otherwise illiquid market. Market makers do this by buying and selling assets on their own accounts with the purpose of profiting from the spread—the difference between the highest purchase offer and the lowest sell offer. Their trading activity generates liquidity, which helps to mitigate the price effect of larger trades. Although various kinds of decentralized exchange (DEX) designs exist, AMM-based DEXs have grown in popularity due to their ability to provide deep liquidity for a broad spectrum of digital assets. In this blog, let’s see the different AMM model kinds.
What is the Work of an Automated Market Maker (AMM)?
An AMM functions similarly to an order book exchange in that there are trading pairings, such as ETH/DAI. To make a transaction, however, you do not need to have a counterparty (another trader) on the opposite side. You engage with a smart contract instead, which “creates” the market for you.
Trades take place directly between user wallets on a decentralized exchange like Binance DEX. If you sell BNB for BUSD on Binance DEX, someone else is purchasing BNB with their BUSD on the opposite side of the exchange. This is referred to as a peer-to-peer (P2P) transaction.
AMMs, on the other hand, may be thought of as peer-to-peer transactions (P2C). There is no need for conventional counterparties since trading takes place between users and contracts. An AMM has no order types since there is no order book. Instead, a formula determines the price you get for an item you wish to purchase or sell. Nonetheless, it is worth mentioning that certain future AMM designs may overcome this constraint.
So there are no counterparties required, but someone must still construct the market, right? Correct. The liquidity in the smart contract must still be given by users known as liquidity providers (LPs).
Additional Read: What are Decentralized Node Infra Providers?
AMM Models Variations
In his initial post advocating for automated or on-chain money markets, Vitalik Buterin underlined that AMMs should not be the sole option for decentralized trade. Instead, since non-AMM exchanges were critical to keeping AMM pricing correct, there needed to be many avenues to trade tokens. What he should have anticipated was the evolution of alternative approaches to AMMs models.
While the DeFi ecosystem is rapidly evolving, three prominent AMM models have emerged: Uniswap, Curve, and Balancer.
- The pioneering concept of Uniswap enables users to construct a liquidity pool using any pair of ERC-20 tokens in a 50/50 ratio. It has become the most durable AMM model on Ethereum. The protocol accomplishes two main goals:
- Prices assets
- Executes trades via smart contracts
As an example, consider exchanging ETH tokens for UNI tokens on Uniswap. After pressing the swap button, the algorithm evaluates how much the transaction affects the liquidity pool’s reserves, and then provides a price quotation.
Upon transaction approval, the AMM puts UNI tokens into the ETH-UNI pool. Finally, it transfers the specified amount of Ethereum from the pool to the customer’s wallet.
AMMs price assets using a constant product formula, which states: x * y = k.
X and y are equal quantities of assets in a liquidity pool, and k is the entire or constant quantity of pool liquidity. Now consider the ETH-UNI exchange through the lens of our new model.
Users must first contribute UNI (y) tokens to the pool in order to purchase ETH (x) on Uniswap. It is worth noting that k requires that the quantity of liquidity stay constant. As a result, adding UNI tokens increases one side of the pool while decreasing the other (removing ETH).
The algorithm divides the entire liquidity of the pool by the new amount of UNI in the pool, then divides that by the new amount of ETH in the pool, yielding (k / y) / x = price. This is how the protocol calculates the price paid for ETH (and other tokens), which rises when more ETH is purchased from the pool.
- Curve specializes in constructing liquidity pools of comparable assets, such as stablecoins, and as a consequence, provides some of the industry’s lowest rates and most efficient transactions while addressing the issue of restricted liquidity. Curve combines the Constant Sum Market Maker (CSMM) with the Constant Product Market Maker (CPMM) to reduce price slippage. This approach may be thought of as adding a constant price component to the Uniswap/Balancer AMM model in order to tie the output function to a certain price.
- Balancer pushes the boundaries of Uniswap by enabling users to establish dynamic liquidity pools of up to eight different assets in any ratio, increasing the flexibility of AMMs. While settling trades, Balancer does not employ order books. Instead, it introduces the idea of ‘balancer pools,’ which are effectively pools of two to eight different cryptocurrencies that offer traders the liquidity they want.
The percentage of the tokens in the pools is established when a balancer pool is initially formed. For example, a pool composed of Ether (ETH), Tether (USDT), and WBTC) at 25%, 25%, and 50% of its entire value might be formed.
The Future of AMMs
Decentralized money and direct transactions sounded incredible a few years ago, and they still do now. Due to increased use and the development of new pricing mechanisms, the AMM model has undergone a massive revolution in crypto finance during the last three years. One of the major problems with previous iterations was that the amount LPs received should always be adequate to entice them to stay in or give additional liquidity. As a result, one of the significant changes was the shift from comprehensive protocol control (in Uniswap v1) to offering flexibility for protocol users (Balancer) to adjust and impose transaction costs.
Balancer has not hit its limit in AMM development, and new, hybrid models are coming. If interest in crypto investments rises, we can anticipate more platforms to provide derivatives for crypto DeFi, therefore Opyn or Perpetual may face competition soon. Moreover, greater utilization and involvement in AMM-based protocols sparked scientific concern about the topic, resulting in a slew of studies and a plethora of novel possibilities being detailed. This helps to broaden one’s knowledge of the mechanism and provides recommendations on how to develop a better CFMM for a particular asset type or volatility resistance.