Lets understand how the essential component of Decentralized Finance works.
Automated Market Maker is a critical part of various Decentralized Exchanges. It allows the exchange of various assets without needing any intermediary.
Decentralized Exchanges like uniswap do not use the traditional order books to match the buyers and sellers.
AMM enables anyone to trade digital assets without relying on a market of buyers and sellers.
The trade happens between users and smart contracts.
AMM helps the trading of assets that have less liquidity by ensuring 24/7 liquidity. It achieves this with the help of liquidity pools.
AMM is a critical part of the DeFi ecosystem to make the trades Permissionless and Automatic.
Why is it needed?
A centralized exchange platform such as Binance has both buyers and sellers for an asset. Both offer different prices to buy and sell the asset. When the price matches, there is an exchange between them. The matching price then becomes the market price of the asset.
For example, you have 100 USD and want to buy your favourite token in Binance exchange. The exchange finds a trader who is willing to sell that token for 100 USD.
But what if you want to buy a token that no one is selling. Or you want to sell a token that no one is buying. When there are not enough buyers and sellers, it is difficult for the trades to go through.
To solve this liquidity problem of any token, exchanges have to rely on financial institutions or professional traders. These institutions and traders who provide liquidity are called the market makers.
But a decentralized exchange such as uniswap works without any middlemen. The liquidity may be a challenge if there aren’t enough people willing to trade the token.
AMM solves the liquidity issue by providing 24/7 liquidity with the help of liquidity pools.
How does AMM work?
AMM uses liquidity pools.
A liquidity pool is a smart contract having a reserve of various tokens. The buyer interacts with the pool instead of the seller. The assets are exchanged autonomously with the help of the smart contract
IF you want to buy ETH in exchange for USDC then you need to use an ETH/USDC pool to exchange your ETH for USDC.
The price of the assets in the liquidity pools is maintained by various formulas.
The most commonly used formula is x * y = k.
x and y are the value of the tokens and k is the constant value the pool needs to maintain.
The total liquidity within a pool remains constant.
When you purchase ETH, the liquidity pool removes the ETH from the pool and adds USDC.
So the value of ETH in the liquidity pool increases as it is less in quantity now and that of USDC decreases.
But when a large amount of token is added or removed, its price changes significantly. Market price across other centralized exchanges then differs from the pool.
To solve this, the AMM model incentivizes traders known as arbitrage traders to standardize the price of the token in the pool with that of the market.
For example, ETH is $2000 in a liquidity pool and $2200 in exchange. Then the arbitrage traders buy the lesser-priced tokens from the pool and sell them in the exchange. As the quantity of ETH in the pool decreases its price increases to maintain the constant value of the pool.
With each trade, the price moves closer to the market price and ultimately matches with the market.
Advantages of AMM?
Decentralization– There is no need for an intermediary to facilitate the exchange of assets in the Dex. Smart contracts take care of the exchange.
24/7 Liquidity- AMM has 24/7 liquidity as anyone can provide liquidity to the liquidity pools. Liquidity Providers are incentivized from the fees of the transactions executed. This ensures liquidity
AMM is an essential component of decentralized exchanges and the defi ecosystem as a whole. They enable anyone to participate in the market which earlier was restricted to a selected few with large capital.
The AMM model of constant formula pioneered by Uniswap is one of the dominant models.
There are 2 other dominant models of AMM as well, Balancer and Curve.
Uniswap allows users to create a liquidity pool with a 50/50 ratio.
But balancer takes this even further. It allows users to create a liquidity pool of 8 different assets in any ratio.
Curve allows creating a pool of stablecoins or similar assets. It results in a lower rate for the trades.
The way defi space is innovating there should be many more models coming up in the future.