The concept of Automated Market Makers or AMM was first introduced by Vitalik Buterin (Co-founder of Ethereum) in 2017. Since then, it has caused a huge stir in the cryptocurrency industry due to its ability to create markets via smart contracts and its simplicity and efficiency. Basically, Automated market makers (AMM) enable automated trading using algorithms to price assets in liquidity pools. This means AMM acts as an algorithmic agent that provides liquidity in the market for quick transactions.
Understanding Liquidity Pool
To understand the concept behind AMM it is necessary to understand what a liquidity pool is and what is its relation with AMM
- Liquidity pools can be defined as a pot of tokens or digital assets locked in a smart contract that provide essential liquidity to decentralized exchanges.
- The liquidity in the pool means that when a user wants to trade one of the tokens in it for the other, they will be able to do so based on the already deposited funds, instead of waiting around for a counterparty who would match their trade
- On AMM platforms, instead of trading between buyers and sellers like on centralized exchanges which is the order book mechanism, users trade against these liquidity pools which provides liquidity much faster
Automated Market Makers
As mentioned above, automated market makers help in quick transactions in the liquidity pool. Before jumping into AMM let’s understand what market making is.
- What is market making?
- As the name implies, market-making involves setting asset prices. Market makers contribute to exchange liquidity by encouraging a platform for negotiations between the buyer and the seller. The buyer wants to purchase some of the assets at one price while the seller wants to sell his assets at another. Finding prices and quantities among various buyers and sellers is known as market making.
- To help understand this better, let’s give an example. Consider trader A’s desire to sell one ETH at $2000. The automated system that manages the sale on the centralised exchange locates a buyer, trader B, who is willing to buy ETH at a price of $1600. In this situation, a market maker pushes person A to lower the ordered price to around $1800 while suggesting person B should increase the buying price to $18,00. These demands are registered in an order book. In this way, ETH is sold by finding a common ground between the buyer and the seller. This method of negotiation already exists with centralized exchanges. The reason for market-making is to increase liquidity.
- Why is AMM needed by investors in the first place?
- AMM helps in creating a system of liquidity that anyone can fund. This eliminates any middleman, which lowers transaction costs for investors. For a trading environment to be healthy, there must be high liquidity. A decrease in liquidity may result in slippage (the difference between the expected price of an order and the price when the order actually executes).
How does AMM work?
- AMMs employ predefined mathematical equations to ensure that the ratio of assets in liquidity pools remains as balanced as possible and to get rid of inconsistencies in the pricing of pooled assets. For instance, Uniswap and many other DeFi exchange protocols establish the mathematical relationship between the specific assets held in the liquidity pools using the straightforward x*y=k equation.
- In this case, x stands for the value of Asset A, y for Asset B, and k is a constant
- This means the ratio of the weights of the coins that is there in the pool is 1:1 which remains constant as more and more coins are added in the pool.
- Uniswap’s x*y=k is just one of the mathematical formulas used by AMMs today. For instance, Balancer uses a much more complex form of mathematical relationship that lets users combine up to 8 digital assets in a single liquidity pool.
- AMM Problems
- Impermanent loss – When funds are part of a liquidity pool, they are vulnerable to a loss known as an impermanent loss. When the ratio of the tokens in the liquidity pool becomes unbalanced, this loss frequently happens. This loss is typically calculated by comparing the value of the tokens in the liquidity pool versus the value of simply holding them.
- Huge volatility – One of the main problems in the earlier versions of Uniswap was huge volatility and its direct dependence on arbitrageur’s intervention. Cryptocurrency arbitrage trading is a strategy that allows traders to take advantage of price differences between different exchanges. For example, if Bitcoin sells for $10,000 on one exchange and $9,500 on another, a trader can buy Bitcoin on the cheaper exchange and sell it on the more expensive exchange, pocketing the $500 difference.
- Front Running – The phenomenon of “front running,” which occurs when another user places a similar trade as a prospective buyer but sells it right away, is one of the main drawbacks of AMMs. Others may view the transactions and possibly make offers because they are public and the buyer must wait for them to be added to the blockchain. Front runners don’t try to execute the trade; rather, they are simply identifying transactions and bidding on them to drive up the price so that they can sell back and earn a profit.
- AMM Improvements
To overcome the limitations like these, AMM went through a lot of improvements with the introduction of
- Hybrid CFMM (Constant Function Market Maker) –
As previously discussed, Uniswap deals with unstable and highly volatile variables. In terms of stablecoins, when there is no such problem as volatility, providing liquidity to the traditional CPMM would not bring many profit basically due to a huge slippage in the Uniswap (Slippage is the difference between the expected.
price of an order and the price when the order actually executes).To avoid that, Hybrid CFMM was introduced
- vAMM – In vAMMs, traders deposit collateral to a smart contract rather than relying on a liquidity pool, using the same x*y=k constant product formula. Users can efficiently gain exposure to the price movements of a wide range of crypto assets by trading derivatives rather than the underlying asset.
Since the introduction of AMM technology, the adoption and usage of decentralized exchanges have grown significantly, be it Uniswap which is now one of the top crypto exchanges out there.
Just like any technological innovation, AMM had some limitations which were later improved by advancements in technology. There is now a wide range of AMMs available on several blockchains. Each works in a similar way, but many have unique features or value propositions.
The DeFi universe is an unruly yet imaginative playground where innovations are given plenty of room to flourish One aspect of it is the current expansion we’ve seen with DEXs and AMMs, which will undoubtedly continue to be a key factor in advancing DeFi’s.