What is AMM?
AMM (short for Automated Market Maker) is an automated market creation tool. AMM is understood as a type of decentralized exchange protocol (DEX) based on a mathematical formula for valuing assets. Instead of using the order book like a traditional exchange, assets are valued according to a valuation algorithm.
This formula can bechanged according to each protocol.
For example, Uniswap uses the formula x * y = k.
x and y are paired reserve balance tokens, k is a fixed constant. That means the group’s total liquidity must always remain the same.
Other AMM’s will use other formulas on a case-by-case basis, depending on different goals. However, the similarity between all these tools is that they all determine prices algorithmically.
Traditional market creation is suitable for companies with vast resources and complex strategies. AMM helps you get a good price and tight buy-sell price spread on an order book exchange like Binance. The AMM allows anyone to create a market on the blockchain.
How does AMM work?
AMM works similarly to an order book exchange, which has trading pairs – for example, ETH/DAI. To make a transaction, the user does not necessarily need a second party (other trader), but only interacts with the smart contract.
Therefore, AMM is considered a P2C – peer-to-contract transaction, not a peer-to-peer P2P transaction. The transaction takes place between the user and the contract and there is no order book so there is no partner and no type of order on the AMM. Instead, users on the AMM platform trade with a token pool called a liquidity pool (LP).
>>> Related: Guide to sign up for Binance account update 2022
What is a liquidity pool?
LP is a share fund of tokens that traders can exchange for. By providing liquidity to the protocol, LPs profit from transaction fees. With Uniswap, the LP is worth the equivalent of two tokens – for example, 50% ETH and 50% DAI into the ETH/DAI group.
Anyone can become a market maker and the rewards will be determined by the protocol. For example, Uniswap v2 charges traders 0.3% and directly transfers to the liquidity pool of the providers. Other platforms or forks may charge lower fees to attract more providers.
Due to the way the AMM works, the more liquidity there is in the group, the less large orders can slip, the more volume it can attract to the platform.
Depending on the different AMM, the problem of slippage will also be different but is determined by the rate of change between tokens in the liquidity pool after trading. If the rate changes by a wide margin, there will be a large amount of slippage.
In fact, you can’t buy all the ETH in the ETH/DAI group on Uniswap. Because you’ll have to pay an exponentially higher premium for each additional ether, but still never be able to buy all that money from the tank. why? That’s because of the x*y=k formula. If x or y is zero, that is, without ETH or DAI in the group, the equation will no longer make sense.
What is impermanent loss?
Impermanent loss occurs when the price ratio of deposited tokens changes after being deposited into the liquidity pool. The bigger the change, the greater the impermanent loss. This is why AMM works best with token pairs of similar value, such as stablecoins or tokens. If the price ratio between this token pair is maintained in a small range, the impermanent loss will be negligible.
On the other hand, if this ratio varies much, liquidity providers should hold the tokens rather than add funds to the liquidity pool. Despite this, Uniswap tanks such as ETH/DAI are famous for their impermanent losses but still profit from accumulated transaction fees.
When the asset returns to the price as it was originally deposited, then the loss will be mitigated. However, if the withdrawal is at a different price rate than when deposited, then the loss will be quite significant. In some cases, transaction fees can minimize damage to this, but users should still consider all risks before making any investments.
AMM is a key part of the DeFi space that allows anyone to create a market seamlessly and efficiently. While there are limitations compared to the exchange that uses the order book, the tool brings innovation to the crypto market.
The AMM that we know and use today such as Uniswap, Curve or PancakeSwap often have easy-to-understand designs, but are still quite limited in features. In the future, many new designs for AMM could be created to make fees cheaper and better liquidity for users.
Related: What is Taproot?