Skip to main content

Understanding Liquidity and Liquidity Pools

What is a DEX?

A Decentralized Exchange (DEX) is a smart contract-based platform that enables users to swap tokens without intermediaries. Unlike centralized exchanges (CEX), where trades go through an order book, DEXs use liquidity pools powered by Automated Market Makers (AMM).

The most popular DEXs on different networks:

  • Ethereum (Uniswap)
  • Binance Smart Chain (PancakeSwap)
  • Base (Uniswap)
  • Solana (Raydium)
  • TON (DeDust, StonFi)

How DEXs Work: The AMM Model

Most modern DEXs operate using an Automated Market Maker (AMM) model. Instead of traditional order books, trades are executed against liquidity pools. The price of assets in the pool is determined algorithmically based on the ratio of tokens in the pool.

Why Create Liquidity Pools?

Liquidity pools are essential for trading on a DEX because they provide the funds necessary for swaps to occur. Without liquidity, a token has no market value. By creating a liquidity pool, we establish a market for our token, allowing users to buy and sell it.

The Importance of Liquidity

Liquidity impacts two key factors:

1. Price Stability

The initial price of a token in a liquidity pool is set by the ratio of assets deposited. However, as trades occur, the price adjusts dynamically. Higher liquidity leads to lower volatility.

For example, if a pool contains only $100, even a small trade can cause a significant price shift. Conversely, a larger pool absorbs trades more smoothly, reducing sudden price swings.

The initial price is determined by the deposit: if we add 100 tokens and $100 worth of base currency, the starting price of 1 token = $1. As users trade, the price fluctuates according to the AMM algorithm.

2. Trade Execution

In traditional AMMs (e.g., Uniswap), a user can buy any amount of tokens regardless of the pool size. Even if the pool contains only $1, someone can attempt to buy $10,000 worth of tokens.

Newer DEXs have introduced purchase limits based on available liquidity. This means that if a pool contains only $100, the maximum buy amount may also be $100. Many DEX platforms allow users to disable this restriction by enabling Expert Mode in their settings.

What Happens After Adding Liquidity?

When liquidity is provided, the liquidity provider receives LP Tokens (Liquidity Provider Tokens). These tokens represent ownership of the liquidity pool and can be used in the following ways:

  • Holding LP tokens allows the provider to withdraw their liquidity at any time.
  • Burning LP tokens permanently locks liquidity, ensuring that it cannot be withdrawn.

How to Remove Liquidity

There are two ways to retrieve liquidity from a pool:

1. Withdrawing Liquidity

If you still hold your LP tokens, you can simply redeem them to withdraw your share of the pool's assets.

2. Selling the Token

If you control a large portion of the token supply, you can sell tokens back into the pool to remove liquidity indirectly. For example, if the pool contains 100 tokens and $100, selling all 100 tokens would allow the seller to retrieve approximately 95% of the liquidity (due to fees and slippage).