What Is An Automated Market Maker (AMM)?
One approach to conceptualize an automated market maker is as a computer program that is constantly ready to provide a price comparison between two assets. Some, like Uniswap, make use of a straightforward formula, while others, like Curve and Balancer, rely on more complex ones.
Not only can you trade trustlessly using an AMM, but you can also become the house by providing liquidity to a liquidity pool. Because of this, almost anybody may participate in the market making activities of an exchange and receive fees for their efforts to provide liquidity.
Because of their user-friendliness and ease of operation, AMMs have successfully established a place for themselves in the DeFi industry. The concept of cryptocurrency is predicated on the decentralization of market making in this manner.
Introduction
During this time, automated market maker protocols like as Uniswap are consistently seeing competitive volumes, strong liquidity, and an expanding number of users.
But how exactly do these transactions take place?
What is an automated market maker (AMM)?
How does an automated market maker (AMM) work?
An AMM works similarly to an order book exchange in that there are trading pairs – for example, ETH/DAI. However, you don’t need to have a counterparty (another trader) on the other side to make a trade. You engage in digital conversation with a smart contract that “creates” the market on your behalf.
Direct transactions between user wallets are what take place when using a decentralized exchange such as Binance DEX. On Binance DEX, if you sell BNB in exchange for BUSD, there will be another user on the opposite side of the deal who will be purchasing BNB using their BUSD. We may refer to this kind of exchange as a peer-to-peer, or P2P, transaction.
On the other hand, you may consider AMMs to be peer-to-contract marketplaces (P2C). Due to the fact that transactions are conducted between users and contracts, there is no need for counterparties in the conventional sense. There are no different order types available on an AMM since there is no order book to begin with. Instead of human judgment, the price that you pay for an item that you wish to purchase or sell is decided by a formula. Nevertheless, it is important to note that certain future designs of AMM may be able to circumvent this constraint.
Therefore, there is no need for counterparties; but, the market must still be established by anyone, right? Correct. Users, who are collectively referred to as liquidity providers, must continue to provide the smart contract with liquidity (LPs).
What is a liquidity pool?
Funds are added to liquidity pools by entities known as liquidity providers (LPs). A liquidity pool is a large pool of money that traders have access to for the purpose of doing transactions against. LPs are eligible to receive fees from any transactions that take place inside their pool as compensation for the liquidity they provide to the protocol. When it comes to Uniswap, Limited Partners (LPs) contribute an amount equal to the value of two tokens, for instance contributing 50% ETH and 50% DAI to the ETH/DAI pool.
Hold on, so everyone wants to can become a market maker, right? Indeed! Adding money to a liquidity pool is a simple and quick process. The protocol decides what the rewards are going to be. For instance, Uniswap v2 assesses a 0.3% fee on trades, all of which is distributed among the LPs. It’s possible that some other platforms or forks will have lower fees in order to get additional liquidity providers to join their pool.
Why is it critical to draw in a sufficient amount of liquidity? Because of the way AMMs are designed to operate, the amount of slippage that may be incurred by big orders is directly proportional to the amount of liquidity that is present in the pool. Because of this, the platform can end up seeing an increase in volume, and so on.
The slippage problems will be different for each distinct design of AMM, but it is definitely something that should be kept in mind. Keep in mind that the price is based on some kind of algorithm. The amount by which the ratio between the tokens in the liquidity pool shifts following a transaction is the primary factor that is considered when determining this. If there is a significant shift in the ratio, there will be a significant amount of slippage in the calculation.
To take this a step further, let’s assume you had the intention of purchasing all of the ETH that was available in the ETH/DAI pool on Uniswap. Well, you couldn’t! You would be required to pay an ever-increasing premium for each extra unit of ether, but you would never be able to purchase all of it from the pool even if you did so. Why? Because of the equation x * y = k, this is the case. In the event that either x or y equals 0, which would indicate that there is no ETH or DAI in the pool, the equation would no longer make sense.
But this isn’t the complete story about AMMs and liquidity pools. You’ll need to keep in mind something else when providing liquidity to AMMs – impermanent loss.
What is impermanent loss?
Impermanent loss happens when the price ratio of deposited tokens changes after you deposited them in the pool. The greater the degree of change, the more significant the temporary loss. AMMs function most well with token pairs that have a value that is comparable to one another. Examples of such token pairings are stablecoins and wrapped tokens. If the price ratio between the pair stays within a reasonably limited range, then the possibility of experiencing impermanent loss is quite low.
If, on the other hand, the ratio undergoes significant shifts, liquidity providers could be better off keeping the tokens in their own possession rather than contributing cash to a pool. Despite this, Uniswap pools such as ETH/DAI, which are more vulnerable to transient loss, have remained lucrative as a result of the trading fees they have accumulated.
Having said that, the term “impermanent loss” is not the most appropriate approach to describe this event. The concept of “permanence” rests on the assumption that if the values of the assets return to where they were when they were first deposited, then the losses will be reduced. However, the losses are extremely likely to be permanent if you withdraw your money at a price ratio that is different from the price ratio at which you placed them. Although the transaction costs could reduce the losses in certain circumstances, it is essential to keep in mind the potential for such losses.
Be careful when depositing funds into an AMM, and make sure you understand the implications of impermanent loss. If you’d like to get an advanced overview of impermanent loss, continue and read our article on it.
Closing thoughts
The decentralized finance sector relies heavily on automated market makers. They make it possible for almost anybody to construct marketplaces in a way that is both simple and effective. Even if they have certain shortcomings in comparison to order book exchanges, the overall innovation that they offer to the cryptocurrency space is quite beneficial.
AMMs have not yet reached their full potential. The AMMs that we are familiar with and use today, such as Uniswap, Curve, and PancakeSwap, have beautiful designs but a rather small set of functions. It is quite possible that in the future there will be a great number of further unique AMM designs. This should result in reduced costs, less friction, and eventually improved liquidity for every customer of a decentralized exchange.