
What is an Automated Market Maker or AMM?
Welcome to Soldex Academy, your number one source for DeFi and crypto education.
In this article, we will talk about what Automated Market Makers or AMMs are, how they work, some of their benefits and disadvantages.
An Automated Market Maker is an underlying decentralized exchange protocol that pools liquidity from users and uses a mathematical formula to price the assets in the pool. Unlike CeFi or traditional exchanges that rely on an order book to price assets, AMMs use algorithms to price assets in a pool. AMMs were first used in the early 1990s by Shearson Lehman Brothers and ATD to avoid the manipulations and issues caused by human market makers. AMMs use smart contracts to determine the prices of assets and to provide liquidity.
How do AMMs work?
AMMs are similar to order books. The only difference is that you don’t need another trader to complete your trade. Instead of interacting with other traders, you interact with a smart contract. So with AMMs, it is more of a peer-to-contract interaction and not a peer-to-peer arrangement. AMMs work like robots that execute trades between you and a liquidity pool. They achieve two things:
- Pricing of assets
- Execution of trades
Different decentralized exchanges use different formulas to calculate the prices of assets. However, they all have one thing in common: they use algorithms to determine the prices. One of the simplest formulas used is that of Uniswap. Uniswap uses a constant product formula to price assets, which states:
x * y = k
Where x and y are equal amounts of a liquidity pool’s assets. While k is the total or constant amount of pool liquidity. In this formula, k is fixed, which means that despite the different prices of x and y, the pool’s total liquidity must always remain the same. For instance, imagine you want to trade $SOLX in a $SOLX-USDC liquidity pool.
After clicking the swap button, the pool’s algorithm calculates how much impact the trade will have on the liquidity pool’s reserves. After this calculation, a price quote for $SOLX is given. Immediately after approving your transaction, the AMM deposits the USDC into the pool and sends $SOLX from the pool to your wallet.
Now using the formula
x * y = k
You must deposit USDC (y) into the pool to buy $SOLX (x). Since the amount of liquidity (k) must remain constant, by adding USDC, you increase one side of the pool and decrease the other by removing $SOLX. The AMM then divides the pool’s total liquidity by the new amount of USDC in the pool and then divides that by the new amount of $SOLX.
That is, (k/y)/x equals price.
This is how the AMM determines the price of $SOLX.
Note that this price will increase the more $SOLX is bought from the pool.
Advantages of AMMs
AMMs have some advantages over traditional exchanges. Some of them are:
Non-custodial
You can easily interact with the AMM of a DEX from your crypto wallet while still retaining total control of your assets.
AMMs are completely decentralized
The ownership of both the DEX and its assets are transferred to the users.
AMMs are permissionless
Anyone can trade, swap, and provide liquidity to an AMM.
No manipulation or risk of human errors
With AMMs, there is no risk of human manipulation or errors. This is because a smart contract and an algorithm control everything.
Downsides of AMMs
Unfamiliar interface
One major downside of AMMs is that it is still fairly new and unfamiliar to the average trader compared to centralized exchanges.
Impermanent loss
Impermanent loss is the loss in the total value of your assets when you provide liquidity to an AMM compared to when you hold your assets in your wallet.
So what do you think of AMMs?
Let us know in the comment section.
And if you still have questions on AMMs, drop a comment too.
Stay tuned for more crypto and DeFi content, and don’t forget to check out our other videos on Soldex academy.
In this article we talked about:
- What an automated market maker is
- How automated market makers work
- Advantages of automated market makers
- Downsides of automated market makers.