Automated market makers (AMMs) are a type of decentralized exchange mechanism that uses a pricing algorithm to allow digital assets to be traded without permission and automatically, using liquidity pools rather than buyers and sellers.
How do Automatic Market Makers (AMMs) work?
For AMMs, arbitrage traders are financially incentivized to find assets that are trading at discounts in liquidity pools and buy them up until the asset’s price returns in line with its market price.
For instance, if the price of ETH in a liquidity pool is down, compared to its exchange rate on other markets, arbitrage traders can take advantage by buying the ETH in the pool at a lower rate and selling it at a higher price on external exchanges. With each trade, the price of the pooled ETH will gradually recover until it matches the standard market rate.
Note that 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. Curve, on the other hand, adopts a mathematical formula suitable for pairing stablecoins or similar assets.
When large orders are placed in AMMs and a sizable amount of a token is removed or added to a pool, it can cause notable discrepancies to appear between the asset’s price in the pool and its market price (the price it’s trading at across multiple exchanges.) For example, the market price of ETH might be $3,000 but in a pool, it might be $2,850 because someone added a lot of ETH to a pool in order to remove another token.
This means ETH would be trading at a discount in the pool, creating an arbitrage opportunity. Arbitrage trading is the strategy of finding differences between the price of an asset on multiple exchanges, buying it on the platform where it’s slightly cheaper and selling it on the platform where it’s slightly higher.
To understand how this works, let us use an ETH/USDT liquidity pool as a case study. When ETH is purchased by traders, they add USDT to the pool and remove ETH from it. This causes the amount of ETH in the pool to fall, which, in turn, causes the price of ETH to increase in order to fulfill the balancing effect of x*y=k. In contrast, because more USDT has been added to the pool, the price of USDT decreases. When USDT is purchased, the reverse is the case – the price of ETH falls in the pool while the price of USDT rises.
When large orders are placed in AMMs and a sizable amount of a token is removed or added to a pool, it can cause notable discrepancies to appear between the asset’s price in the pool and its market price (the price it’s trading at across multiple exchanges.)
To understand how this works, let us use an ETH/USDT liquidity pool as a case study. When ETH is purchased by traders, they add USDT to the pool and remove ETH from it. This causes the amount of ETH in the pool to fall, which, in turn, causes the price of ETH to increase in order to fulfill the balancing effect of x*y=k.
To make sure the ratio of assets in liquidity pools remains as balanced as possible and to eliminate discrepancies in the pricing of pooled assets, AMMs use preset mathematical equations. For example, Uniswap and many other DeFi exchange protocols use a simple x*y=k equation to set the mathematical relationship between the particular assets held in the liquidity pools.
Here, x represents the value of Asset A, y denotes the value of Asset B, while k is a constant.
In essence, the liquidity pools of Uniswap always maintain a state whereby the multiplication of the price of Asset A and the price of B always equals the same number.
Instead of using dedicated market makers, anyone can provide liquidity to these pools by depositing both assets represented in the pool. For example, if you wanted to become a liquidity provider for an ETH/USDT pool, you’d need to deposit a certain predetermined ratio of ETH and USDT.
How do Automatic Market Makers (AMMs) work?
There are two important things to know first about AMMs:
Trading pairs you would normally find on a centralized exchange exist as individual “liquidity pools” in AMMs. For example, if you wanted to trade ether for tether, you would need to find an ETH/USDT liquidity pool.
