Home / Education / Crypto / Trading / Automated Market Makers (AMMs) In Crypto, Explained
Trading
8 min read
easy

Automated Market Makers (AMMs) In Crypto, Explained

Last Updated May 31, 2024 10:10 AM
Andrew Kamsky
Last Updated May 31, 2024 10:10 AM

Key Takeaways

  • Automated Market Makers (AMMs) allow decentralized and permissionless trading of cryptocurrencies and lesser-known altcoins.
  • Liquidity providers may earn fees from transactions made when funding AMM pools.
  • Impermanent loss is a risk for liquidity providers yet cushioned by the generated transaction fee income.
  • Advanced AMM strategies include arbitrage of tokens and yield farming.

Decentralized finance (DeFi) has seen a rise in popularity. It promises to transform how financial services are adopted and executed. However, DeFi presents many challenges, with liquidity being the main one. 

This is where automated market makers (AMMs) come into play. They offer a solution to the liquidity problem in an effort to aid the trading of cryptocurrencies on exchanges..

What Is An Automated Market Maker (AMM)?

The AMMs are protocols used on decentralized exchanges (DEXs) to facilitate the trading of cryptocurrencies without relying on traditional order books. 

With traditional exchanges, where buyers and sellers place orders matched by a central system, AMMs use smart contracts to create liquidity pools. These pools automatically adjust the prices of assets based on supply and demand through algorithms.

AMM involves creating a seamless experience and continuous market for trading pairs. Traders can trade directly with the liquidity pools, funded by users who earn fees for providing liquidity. The system removes the need for counterparties, allowing for 24/7 trading without the limitations of an order book.

Auto Market Makers adopt pricing strategies that can be adjusted to reflect the current market conditions, providing an efficient and decentralized solution for cryptocurrency trading. 

How Do AMMs Work?

Many AMMs use the constant product formula, which ensures that the product of the quantities of two tokens in the pool remains constant. This formula allows for continuous and automatic price adjustments based on trading activity. 

For example, if the liquidity pool has 100 BTC and 10,000 USDT, the AMM ensures that the product of these quantities remains constant. 

If a trader buys 1 BTC, the price in USDT will increase because there are now fewer BTC in the pool. If a trader sells 1 BTC, the price in USDT will decrease as the supply of BTC in the pool increases. 

Step-By-Step Guide On How AMMs Work

Below are the steps on how AMMs work: 

Step 1: Creation Of A Liquidity Pool

The first step involves creating a liquidity pool for a pair of tokens. This liquidity pool gets made on a smart contract on the blockchain and is designed to hold reserves of the two tokens. 

Step 2: Funding The Liquidity Pool

Users, known as liquidity providers, add an equal value of both tokens to the pool. This funding is required because the funding supplies the pool with initial liquidity required for trading

Step 3: Setting The Initial Price

The initial price of the tokens in an AMM pool is then set by the ratio of the quantities of the two tokens provided by the liquidity providers. 

For example, if the AMM adds 10 BTC and 640,000 USDT (with BTC priced at 64,000 USD), the initial price of BTC is (640,000 USDT / 10 BTC) equal to 64,000 USDT per BTC.

Step 4: Trade Execution Via Constant Product Formula

When a trade is executed, the AMM uses a constant product formula. The formula ensures that any trade will adjust the token amounts in such a way that the product of the two quantities remains constant, thereby determining the exchange rate.

 

Building on top of our example in Step 3, if the price of BTC rises to 80,000 USD in one day, it indicates a significant increase in demand for BTC. In the AMM pool, this means that traders are buying more BTC, reducing the quantity of BTC in the pool while increasing the quantity of USDT.

This means, there will now be 8 BTC but an increase in total USDT of 800,000 USD. This means that now the BTC stack is 8 and the USDT has increased by
(800,000 less 640,000) 160,000 USDT. This means the new formula dictates a price of BTC (800,000 USDT / 8 BTC) 80,000 USD.

The formula is:

(X+dX)(YdY)=K

  • Where X is the amount of Token A in the Automated Market Maker (AMM) before the trade.
  • Where dX is the amount of Token A being added to the AMM (since we are selling Token A).
  • Where 𝑌 is the amount of Token B in the AMM before the trade.
  • Where dY is the amount of Token B being subtracted from the AMM (since we are buying Token B).
  • And 𝐾 is a constant representing the product of the quantities of Token A and Token B in the AMM, which remains unchanged before and after the trade.

Step 5: Automated Price Adjustment

The AMM algorithm will continuously adjust the prices of the tokens in the pool based on the supply and demand dynamics which is reflected in the pool’s composition. 

Step 6: Fees And Incentives For Liquidity Providers

Liquidity providers make money because they earn fees made from each trade executed in the pool.

These fees are the incentive for the provision of further liquidity and are typically a small percentage of the trade amount. 

Step 7: Handling Impermanent Loss

Impermanent loss occurs when the value of tokens in the liquidity pool diverges from the value if they were held outside the pool. AMMs address this by allowing liquidity providers to earn trading fees that can offset potential losses. 

If the initial pool was 10 BTC and 640,000 USDT, with a BTC price of 64,000 and in one day the price moved down to 50,000 USD the new amounts in the pool would be approximately 11.31 BTC and 565,500 USDT. 

Trading fees earned during these price changes help offset this loss.

Step 8: Withdrawal by Liquidity Providers

Liquidity providers can withdraw the share of the liquidity pool at any time. 

As the liquidity providers receive initial deposits adjusted for their proportion of the pool’s total value, including accumulated fees

Benefits Of Using AMMs

The advantages of AMMs include:

  • Permissionless trading: Users can trade cryptocurrencies without the need for an account or intermediary, making the process more inclusive and decentralized.
  • Increased access to new tokens: AMMs strategies work by providing a platform for newly launched tokens to gain liquidity and be traded, offering early access to innovative projects.
  • Potential for fairer pricing on less known currencies: Due to the algorithmic nature of Automated Market Maker strategies, prices for lesser known tokens can be more reflective of real-time supply and demand, potentially reducing manipulation.

Challenges Of AMMs

Some of the challenges faced by AMMs are explained below:

  • Impermanent loss: Liquidity providers face the risk of impermanent loss, where the value of deposited assets might decrease compared to simply holding them due to price fluctuations.
  • Limited order types: Unlike traditional exchanges, AMMs generally support basic trade types, lacking advanced options like limit orders and stop losses, which can be a limitation for some traders.
  • Potential vulnerability to price manipulation: Low liquidity pools can be susceptible to price manipulation, as large trades can significantly impact token prices, leading to potential losses for traders and liquidity providers.

Popular AMM Examples

Uniswap

Uniswap is one of the most well-known AMMs, offering a wide range of token pairs and pioneering the use of the constant product formula to facilitate decentralized trading.

SushiSwap

SushiSwap builds on Uniswap’s model but introduces additional features such as staking and rewards for liquidity providers, enhancing user incentives within its ecosystem.

Curve Finance

Curve Finance focuses on stablecoin trading, optimizing its AMM algorithms to minimize slippage and provide efficient trading with low fees for stablecoin pairs.

Popular AMM Strategies

Some popular automated market makers’ strategies that allow participants to earn profits and rewards while contributing to the liquidity and efficiency of decentralized markets include:

  • Liquidity provision: Contributing assets to liquidity pools to earn a share of transaction fees.
  • Arbitrage trading: Exploiting price differences across different AMM platforms to make a profit.
  • Yield farming: Participating in liquidity mining programs to earn additional rewards in the form of native tokens.

The Future of AMMs

The future of automated market makers looks good. Developments such as dynamic fee structures, enhanced algorithmic AMM strategies, with integration with layer-2 solutions are expected to improve efficiency and reduce costs. 

Moreover, advancements in cross-chain compatibility and interoperability are likely to expand the reach and utility of AMMs within the broader DeFi ecosystem. As technology evolves, AMMs will provide decentralized trading solutions, aiding the cryptos industry to grow and mature into a respected asset class.

Conclusion

Automated market makers are slowly enabling a DeFi liquidity platform to be used because they are providing efficient, permissionless trading and liquidity solutions. 

Despite challenges such as impermanent loss and potential vulnerability to price manipulation, AMMs offer benefits including increased access to new tokens and fairer pricing. As adoption increases, the future of AMMs should be promising and advancements in efficiency, reduction of costs, and expansion in the utility of the DeFi ecosystem are expected.

FAQs

Is it legal to be a market maker?

Yes, being a market maker is legal, however market makers are required to follow regulations and comply with the law of the geo-graphic jurisdiction.

Can a market maker lose money?

Yes, market makers can lose money due to market volatility and adverse price movements which ultimately reduce the USD value or worth of the tokens held for trading.

What is the difference between a crypto exchange and a market maker?

A crypto exchange matches buy and sell orders, while a market maker provides liquidity and sets prices.

How to make money with an automated market maker?

An individual can make money by providing liquidity to AMM pools and in return earn transaction fees.

Was this Article helpful? Yes No