World of DeFi: AMMs

World of DeFi: AMMs
World of DeFi: AMMs | GooseFX

Welcome to the World of DeFi! In this multi-part series, we will be introducing you to multiple blockchain native concepts covering everything there is to it in DeFi! Our first focus will be on Decentralized Exchanges, also known as DEXs, and specifically, the model that runs them, i.e., Automated Market Makers or AMMs. Let's explore what they are and how they operate.

Table of Contents

Market Makers:

In order to understand AMMs, it's important to understand the concept of Market Makers. In simple terms, these companies or individuals help create a market for a particular asset by offering different prices for buying and selling that asset. They do this to profit from the difference between these prices, known as the bid-ask spread.

CLOBS and AMMs:

If you have traded on a traditional, centralized exchange, you may have noticed an Order Book. These exchanges use a Central Limit Order Book (CLOB) model to match buyers and sellers in real-time. This system helps keep things transparent and low-cost and allows users to remain anonymous. However, it also requires an intermediary (in this case, the exchange) to execute the orders.

(Screenshot taken from okotoki.com showing multiple exchanges’ orderbooks)

Decentralized exchanges (DEXs) use a different system called Automated Market Makers (AMMs) to match buyers and sellers. Unlike traditional exchanges, users on a DEX trade directly with a central liquidity pool, eliminating the need for a middleman or counterparty. This improves capital efficiency and removes the need for intermediaries.

Liquidity Pools and Slippages:

Liquidity pools are the foundation of AMMs. They are groups or pools of digital assets combined by different entities called liquidity providers. Having a large liquidity pool is very important because it helps reduce slippage.

Well, what is Slippage? Slippage is the effect on price when someone buys or sells their tokens. If someone wants to buy or sell a large number of tokens compared to the total amount of that token in the pool, it will have a more significant impact on the price, which is known as slippage. This can cause problems like capital inefficiency and lead to losses.

To understand how Liquidity Pools work, let's take an example of the most liquid pool: ETH-USDT on Uniswap. Here, I'm trying to swap 10000 ETH for USDT. Now, in its liquidity pool, it would have two assets; ETH and USDT. So, when I try to swap ETH for USDT, I add ETH to that pool and remove USDT, thereby reducing the price of 1 ETH.

In the image shown below, you can also see the price impact or the slippage I would incur if I executed the trade. The minimum I would receive is 11,740,500 USDT implying that my maximum loss would be 58,700 USDT! (Expected Output-Minimum Received)

(Source: Uniswap. Price Impact is the same as Slippage)

Now, why should one provide Liquidity in these pools? To incentivize them to provide Liquidity, these entities are given a fraction of the fees generated by the AMM. This process is known as Yield Farming. We will be covering Yield Farming in the future.

This brings up another question: What are the risks taken by these LPs when depositing their money, or is there any risk at all when depositing into these pools? In brief, the answer is yes; there are risks associated with such pools.

Let's look at what they are:

Impermanent Loss:

One of the biggest risks for liquidity providers is impermanent loss (IL), which is the difference in value between holding tokens in a Liquidity Pool versus just keeping them in your wallet. To better understand this, let's look at an example:

Let's say there is a liquidity pool with tokens X and Y. To make it simple, let's assume a few things:

  • Their current market price is $10 and $200 respectively.
  • You have 1000 X tokens, so your total value is 1000 * 10 = $10,000. To put them in this liquidity pool, you would need to have an equivalent value of Y tokens, which is 50 Y tokens (50 * 200 = $10,000). This means the total value you are putting in is $20,000.
  • There are 10000 X and 500 Y tokens in the pool, which means you have 10% of the liquidity pool.

Now, let's say the value of token X goes from $10 to $40. When the value increases, some traders will buy and sell to profit off of this since AMMs don't automatically adjust prices. These traders are also known as Arbitrageurs and they help keeping the prices converged across multiple exchanges or locations.

Let's say after these trades, there are 4000 and 1000 X and Y tokens in the pool, respectively.

When you try to withdraw, you will get 10% of the pool, which is 400 and 100 X and Y tokens.

So, your total value now is: 400 * 40 = $16,000 And 100 * 200 = $20,000

So your total value is $16,000 + $20,000 = $36,000.

Now, let's see how much you would have had if you didn't put your tokens in the pool:

The value of your X tokens would be: 1000 * 40 = $40,000 and

The value of your Y tokens would be: 50 * 200 = $10,000.

The total value of your holdings would have been $50,000, which is $14,000 more than your value if you would have deposited your assets in an AMM. This shows that if you had held your tokens, you would have been more profitable than providing liquidity!

Ways to minimize Impermanent Losses:

There are a few ways to reduce your impermanent loss. The easiest way is to only provide liquidity with stablecoins, because IL comes from price changes. Another way is to earn fees for providing liquidity, which can offset or eliminate these losses. Finally, you can use single-sided liquidity (SSL) pools where you only have to provide one token, so there are no impermanent losses. You can read more about them here.

Check out GooseFX SSL pools at 👉 https://app.goosefx.io/farm

Pros of using AMMs compared to CLOBs?

Now that we have covered the risks of using AMMs let's check out the Pros of using them. AMMs have several advantages over centralized limit order books (CLOBs), such as:

  • Liquidity is always available: While CLOBs may have low or high liquidity at different times of the day, AMMs always have sufficient liquidity at any point in time.
  • No single point of failure: Centralized exchanges can freeze your account without your permission, but decentralized exchanges (DEXs) built on self-custodianship cannot. For example, the recent FTX Fiasco, where people could not withdraw money from their accounts is something you won't see happening on any DEX.
  • Anyone can contribute: With DEXs, anyone can become a liquidity provider or market maker without needing a lot of money or expertise. You just need to deposit your tokens into a pool and earn yield, whereas with CLOBs you need to actively manage your position or use an algorithm to provide liquidity.

Top AMMs by Market Capitalization:

We will be listing the top AMMs according to CoinGecko. Since this space is constantly evolving and adding new decentralized apps every day, this list may change when you read it. That being said, let's get started:

  • Uniswap is the largest decentralized exchange and AMM protocol with a market cap of over $4 billion. It is specifically designed for swapping ERC-20 tokens on the Ethereum blockchain. Uniswap has a user-friendly interface and offers a wide range of trading options, making it a popular choice among traders.
  • Pancakeswap is the largest AMM protocol on the Binance Smart Chain (BSC) with a market cap of $594 million and 24-hour volume of $27 million. It offers a wide range of trading options and has a user-friendly interface, making it popular among traders. Pancakeswap also has a strong community and offers rewards for liquidity providers, which has helped it grow rapidly.
  • Osmosis is an AMM built on Cosmos that allows for cross-chain transactions using Inter-Blockchain Communication (IBC). It is currently in third place with a market cap of $490 million and 24-hour volume of over $8 million. Osmosis offers a wide range of trading options and has a user-friendly interface, making it popular among traders. Its focus on cross-chain transactions sets it apart from other AMMs and has helped it grow rapidly.
  • Curve DAO is a protocol similar to Uniswap that allows for swapping tokens. Unlike Uniswap, Curve has multi-chain functionality and can help swap multiple tokens within the same chain. However, it does not act as a bridge for cross-chain swaps. It has a market cap of over $400 million and does a total of $160 million in volume in 24 hours. Curve's multi-chain functionality sets it apart from other AMMs and has helped it grow rapidly.

Within the Solana ecosystem, there are three major AMMs

  • Raydium was the first AMM and liquidity provider built on top of Solana, supporting the Serum decentralized exchange. It is currently the top AMM on Solana with a market cap of $34 million and 24-hour volume of over $16 million.
  • Orca is an AMM-based decentralized exchange similar to Uniswap that claims to be the most user-friendly exchange on Solana. It has a market cap of over $10 million and 24-hour volume of around $250,000.
  • Aldrin is the last AMM on this list, with a market cap of over $1 million. If you want to trade low market cap coins that aren't available on other decentralized exchanges, Aldrin is a good option. Its focus on low market cap coins sets it apart from other AMMs.

Conclusion

AMMs help bring the idea of decentralization to life by eliminating the need for intermediaries during the trading process. As the DeFi space continues to grow, AMMs will continue to play a crucial role in its development. As AMMs and DEXs evolve, we should see a shift from centralized exchanges to DEXs due to lower fees, better liquidity, and a self-custody approach. Overall, AMMs offer a more efficient, transparent, and decentralized trading experience that is better suited to the needs of the modern financial world.

Stay Tuned with #GooseAcademy

Website | Twitter | Telegram | Discord | Docs

Disclaimer: The statements, proposals, and details above are informational only, and subject to change. We are in early-stage development and may need to change dates, details, or the project as a whole based on the protocol, team, legal or regulatory needs, or due to developments of Solana/Serum. Nothing above should be construed as financial, legal, or investment advice.