Trusted

DeFi Liquidity Pools: How They Work and What You Need To Know

15 mins
Updated by May Woods
Join our Trading Community on Telegram

Liquidity pools play a major role in how decentralized exchanges (DEX) function. But what exactly are they, and how do they work? Learning how they operate could mean the difference between a good and a bad day in crypto — here’s what to know.

KEY TAKEAWAYS
•Liquidity pools are the backbone of decentralized exchanges (DEXs), allowing for peer-to-peer trading without traditional market makers.
•While they offer fast order execution and on-chain price discovery, liquidity pools also carry risks such as impermanent loss and slippage.
•Beyond trading, liquidity pools are used in other decentralized finance (DeFi) activities like borrowing, lending, yield farming, and decentralized insurance.

What is a liquidity pool?

A liquidity pool is a collection of funds locked in a smart contract. It provides liquidity for trading between different cryptocurrency tokens without the need for traditional market makers.

The liquidity pool concept is closely associated with Automated Market Makers (AMMs). An AMM is a type of decentralized exchange (DEX) protocol. These protocols rely on mathematical formulae to price assets instead of using a traditional order book (like centralized exchanges or CEXs).

Real-world example: Imagine a farmers’ market where everyone contributes fruits to a common basket. Anyone can take fruits from the basket, but they must replace them with an equal value of other fruits. The basket (liquidity pool) is always full, allowing people to trade fruits (tokens) whenever they want.

Liquidity pools are the backbone of AMMs. They enable 24/7 trading by maintaining a pool of tokens that can be swapped automatically.

Why are liquidity pools important in DeFi

Understanding the “liquidity” in liquidity pools is essential to understanding why they are important in DeFi. Liquidity is the ease with which an asset or security is converted into cash without significantly affecting its price.

High liquidity indicates that an asset is bought or sold quickly and with minimal price movement. Conversely, low liquidity means that the asset is not easily sold or bought without a substantial change in price.

liquidity pools liquidity by asset type
Liquidity by asset: ncua.gov

For example, fixed assets (e.g., real estate) are highly illiquid. If you invest in real estate, you cannot buy or sell a property as easily as you could a stock.

If you needed cash at short notice, you wouldn’t be able to sell one of your properties to meet that immediate demand. You would have to find a buyer, fill out mountains of paperwork, and complete many other activities that take time due to regulations and other factors.

Need some help trading liquidity? Check out this thread:

On the other hand, buying or selling a stock or security is easier because there are many buyers and sellers. As a result, securities as an asset class are highly liquid. Without liquidity pools, cryptocurrency traders would have a difficult time buying and selling.

Why do liquidity pools exist?

Liquidity pools address liquidity, volatility, supply and demand, and pricing challenges in decentralized environments. When an asset has low liquidity, the market for that asset typically has high slippage.

Did you know? The difference between the expected price and the actual price at which a trade executes is slippage. For instance, if you have a cryptocurrency with a low market capitalization and few buyers and sellers, a large buy or sell order could create a huge impact.

If there is a large buy order, the price could skyrocket due to increasing demand. When someone else tries to execute another large buy order, but there is not enough crypto to fill their order at the current price, they will buy the next available tokens at a higher price.

This is because prices are set in a liquidity pool by the balance between supply and demand. Liquidity pools provide liquidity but do not necessarily solve the slippage or volatility problem.

Automated Market Makers using liquidity pools provide constant liquidity, as trades always have a counterparty (the pool itself). This model can offer lower slippage in markets with stable and high liquidity but may suffer from higher slippage during large trades.

How do liquidity pools work?

In a liquidity pool, users called liquidity providers (LP) add an equal value of two tokens (or more in some cases) to a pool. Traders can then use them to swap between these tokens.

This mechanism allows for automatic and peer-to-peer trading at prices set by a mathematical formula (e.g., the constant product formula in Uniswap).

To understand how liquidity pools work, you must understand the CFMM (also known as the constant product market maker or CPMM for short). Particularly the constant product function in a liquidity pool.

The Geometry of Constant Function Market Makers by Angeris, G., Chitra et al: Arvix

AMMs, specifically CFMMs, use specific mathematical formulas to determine the pricing of assets within their systems. Notably, exchanges such as Uniswap, SushiSwap, and Curve often adhere to the constant product formula as their primary pricing mechanism.

This formula, notably used by Uniswap and its derivatives, is X * Y = K. “X” is the amount of one type of asset in the pool, while “Y” denotes the amount of the alternate asset. “K” remains a constant, representing the product of “X” and “Y,” and only changes when liquidity is added or removed.

The algorithm raises a token’s price to compensate for the drop in token quantity as transactions take place. Conversely, as an asset’s quantity rises, the AMM lowers its price to compensate. As a result, the formula accordingly adjusts the token’s price to maintain equilibrium.

liquidity pools constant function
Constant product formula visualized: Medium.com

It is important to point out that there are several functions used by different decentralized exchanges to price the assets held in liquidity pools. There are also liquidity pools that use constant sum or mean functions. Curve Finance uses both a constant product and constant sum function, while Balancer uses a constant mean function. Although the most popular is the constant product — perhaps due to the many Uniswap clones.

Types of liquidity pools

Although the DEX liquidity pool is the most known type, there are liquidity pools for many other financial activities.

Borrowing and Lending Pools

Platforms like Aave and Compound use liquidity pools to facilitate borrowing and lending activities. Users supply assets to these pools to earn interest, and these supplied assets are made available for others to borrow. Interest rates are typically determined algorithmically based on the current supply and demand for the underlying assets.

Yield Farming Pools

These liquidity pools are designed to maximize the returns on staked or lent assets through various strategies. Participants might move their assets between different pools (across various protocols) to chase higher yields, often earning additional rewards in the form of governance tokens or other incentives beyond the standard transaction fees or interest rates.

Locating top liquidity pools:

Insurance Pools

Platforms like Nexus Mutual use pools to provide decentralized insurance services. Users can supply assets to these pools and receive payment in the form of premiums from those purchasing insurance coverage. The funds in the pool are used to pay out claims as needed.

Pros and cons of liquidity pools

Still on the fence regarding liquidity pools? Here is a list of pros and cons to help you choose better:

ProsCons
Fast order executionSlippage
Liquidity provisionImpermanent loss
On-chain price discoveryVolatility
Pros
  1. Fast order execution: Pools enable immediate trade execution without the need for a buyer and a seller to match directly. This is because the liquidity is always available from the pool. This ensures that trades complete quickly, which is beneficial in fast-moving markets.
  2. Liquidity provision: By pooling assets from many LPs, AMMs ensure that there is sufficient liquidity available for trading. This reduces the spread (the difference between buy and sell prices) and makes it easier for users to enter and exit positions at as close to the fair market value as possible.
  3. On-chain price discovery: Liquidity pools facilitate price discovery directly on the blockchain. The price of assets in a pool is determined algorithmically. They are based on the ratio of assets in the pool and the trades that occur. This effectively reflects current market conditions without the need for external price feeds.

New developments:

New models, such as dynamic AMMs and multi-token liquidity pools, are gaining traction. These top-shelf inclusions aim to optimize liquidity provision by allowing more flexible token contributions and reducing impermanent loss. For example, platforms like Balancer are experimenting with pools that support multiple tokens with different weights, offering more tailored liquidity solutions​.

Cons
  1. Slippage: In liquidity pools, large orders compared to the total pool size can lead to significant price changes between the time a transaction initiates and executes. This discrepancy can lead to traders receiving less than expected when making large trades in a pool with limited liquidity.
  2. Volatility: High volatility can exacerbate the risks of impermanent loss and slippage in pools. Prices within AMMs are dependent on the ratio of assets in the pool. As a result, sudden market movements can lead to unfavorable conditions for LPs and traders.
  3. Impermanent loss: This is the temporary loss LPs incur when the price of assets in a pool changes. If the prices of the pooled assets diverge significantly from the time you deposited them, the value of the provider’s share of the pool could be less, in comparative terms, than if they had just held the assets outside the pool. This loss is “impermanent” because it’s possible to reverse it if the prices return to their original levels.

How do LPs use liquidity pools?

Liquidity pools are open protocols. As stated previously, they allow anyone to trade in a peer-to-peer fashion by providing liquidity. This is because LPs are incentivized to deposit their idle cryptocurrency into liquidity pools by earning profits on trading fees.

Different DEXs may charge a fixed trading fee on all orders distributed to the LPs. For example, Uniswap has a 0.3% trading fee, while PancakeSwap has a 0.25% trading fee. Of PacakeSwap’s 0.25% fee, 0.17% is distributed to LPs.

However, using liquidity pools comes with risks. The greatest risks you will encounter in most areas of crypto are smart contract risks. Liquidity pools are no exception, as seen in the series of Vyper exploits.

LPs must also keep in mind loss versus rebalancing (LVR). LVR is a concept closely related to impermanent loss. In a nutshell, it is the amount of profit an LP loses out on due to adverse selection, a situation where buyers and sellers have different information. In volatile markets, this can lead to significant discrepancies.

Liquidity pools vs order books

AMMs help decentralized exchanges for digital assets exist. They utilize a specific function that sets preexisting prices depending on the quantities of multiple assets. In contrast to traditional exchanges that operate with order books, traders engage with a collective pool of assets instead of individual counterparts.

Let us take a closer look at the differences:

FeatureLiquidity pools (AMMs)Order books (Traditional exchanges)
Trading modelTraders engage with a collective pool of assetsTrades execute when buy and sell orders match
Price determinationPrices are set by a mathematical formula based on the ratio of assets in the poolPrices are determined by the highest bid and lowest ask in the order book
Asset valuationAssets are valued against each other within the poolAssets are typically valued against a currency or another crypto asset
Execution timeImmediate execution based on the pool’s pricingExecution depends on matching buy and sell orders, which can lead to delays
Order typeNo order types, automatic trades based on pool ratiosSupports various order types, including market and limit orders

Liquidity pool tokens

When you become an LP in a liquidity pool, you receive a proportional fee for supplying liquidity for trades, according to your share in the pool.

As a result, you will need a way to take profit without immediately removing your tokens (the base and quote tokens) from the pool, as some pools may have lock-up periods.

In comes the liquidity provider (LP) or pool token. You should not confuse them with liquid staking tokens. To be clear, there are usually three types of tokens in a DEX model with a liquidity pool. The base token is the one that you can trade or swap for another token, the quote token.

LP tokens represent claims on the amount of profits or interest an LP is entitled to. They are not part of the pool involved with buy-and-sell transactions.

How it works

When you become an LP on a DEX, here’s what typically happens:

  1. You select a specific pool (e.g., ETH/DAI) and deposit equal values of both assets into the pool according to the current price ratio.
  2. Once you deposit your crypto, the smart contract mints LP tokens that correspond to your share of the pool. The number of tokens you receive represents your proportionate share of liquidity in the pool.
  3. As trades occur within that pool, a small fee (e.g., 0.3% on Uniswap V2) is taken from each trade and added to the pool, increasing the total value of the pool’s assets.
  4. If you decide to withdraw your liquidity, you can redeem your LP tokens. The amount of assets you receive back will include a portion of the trading fees, proportional to your share of the pool.

LP tokens have become a coveted type of token unto themselves. As a result, you will notice liquidity pools for LP tokens as well. Many LP tokens on the Ethereum blockchain are ERC-20s. This allows for ease of use when programming pools and DEXs.

What can you do with LP tokens?

The interesting thing about the high demand for LP tokens is that you can take them to other DeFi platforms. You can stake, loan, or engage in yield farming.

Yield farming is when you deposit tokens into a pool (be it for staking, liquid staking, lending, or crypto trading) and take the LP tokens to another platform and deposit them to earn profit. By loaning out or staking your LP tokens on the other platform, you can maximize the profits that you earn at once.

Note that the success of yield farming is typically dependent on market conditions and the performance of the underlying assets. Making informed decisions requires considering these aspects, as well as platform-specific risks and rewards.

What are the best practices for using liquidity pools?

The best practices for using these pools depend on what side of the pool that you are on. If you are buying or selling cryptocurrency from a liquidity pool, you can use a DEX aggregator like 1Inch or Matcha to get the best rate across many pools.

Another thing you should keep in mind is smart contract risk and front running.

Smart contract risk is less of a problem on the buyer and seller side, as many DApps are open source. However, users should still exercise caution.

As for front running, and generally any MEV attacks, you can change the RPC provider in your wallet for MEV protection.

On the other hand, if you are an LP, you may have to do a little more research. It is important to understand the risks involved clearly. Liquidity pools using stablecoins typically have lower volatility and lower risks of impermanent loss. Additionally, make sure that the fees you earn cover impermanent loss, too.

Some AMMs offer additional rewards for providing liquidity, such as liquidity mining or yield farming programs. These can offer additional incentives on top of transaction fees. You should also keep in mind that these models pay via the inflation of new tokens. This model is not profitable in every scenario.

Pool size is also a significant factor. Larger and more active pools typically offer more stable returns and lower risks of large price impacts. However, they might offer lower percentage yields compared to smaller, higher-risk pools.

Here is a quick list of the popular liquidity pool providers

liquidity pools top dexs
Top DEXs: DefiLlama
  1. PancakeSwap: The most popular DEX on the BNB Chain and an Ethereum competitor, PancakeSwap boasts one of the highest transaction volumes in crypto. According to Defi Llama, it has the third-highest TVL for DEX, coming in at $1.85 billion.
  2. Uniswap: The most popular DEX on Ethereum, the Uniswap platform is the nexus of most DeFi activity, including yield farming, arbitrage trading, and crypto swaps. As well as a large total value locked (TVL) of more than $4 billion, Uniswap is present on 13 blockchains.
  3. Curve Finance: A top DEX that provides low fees and slippage, primarily for stablecoins. These features have made it easier for other DeFi services to tap into Curve’s stablecoin liquidity without building their own pools.

Knowledge is power

Now that you have been edified on liquidity pools, you should be more prepared to make informed decisions when you use DEXs. It is important to know the inner workings of crypto protocols. When dealing with a fast-growing asset class such as cryptocurrency, information is power. Ensure you always DYOR and only engage with decentralized ecosystems when you feel confident you are aware of both the risks and how to use them.

Frequently asked questions

How does a liquidity pool work?

How do you make money from a liquidity pool?

What is a liquidity pool in simple words?

Is providing liquidity profitable?

Are crypto liquidity pools safe?

How do I start a liquidity pool crypto?

Can I create my own liquidity pool?

Can anyone create a liquidity pool?

What is an example of a liquidity pool?

How do I join a liquidity pool?

How do I withdraw from a liquidity pool?

What are the fees for liquidity pools?

How do centralised exchanges work?

What is a market maker?

🎄Best crypto platforms in Europe | December 2024
eToro eToro Explore
Wirex Wirex Explore
YouHodler YouHodler Explore
Phemex Phemex Explore
Margex Margex Explore
🎄Best crypto platforms in Europe | December 2024
eToro eToro Explore
Wirex Wirex Explore
YouHodler YouHodler Explore
Phemex Phemex Explore
Margex Margex Explore
🎄Best crypto platforms in Europe | December 2024

Disclaimer

In line with the Trust Project guidelines, the educational content on this website is offered in good faith and for general information purposes only. BeInCrypto prioritizes providing high-quality information, taking the time to research and create informative content for readers. While partners may reward the company with commissions for placements in articles, these commissions do not influence the unbiased, honest, and helpful content creation process. Any action taken by the reader based on this information is strictly at their own risk. Please note that our Terms and Conditions, Privacy Policy, and Disclaimers have been updated.

Ryan1.png
Ryan Glenn
Ryan Glenn is a journalist, writer, and author. Ryan is motivated to educate as many people as possible on the benefits of web3 and cryptocurrency. He has authored “The Best Book for Learning Cryptocurrency,” and runs an educational platform, web3school.us, dedicated to demystifying the crypto space. Ryan built the platform to transition tech-savvy and non-tech individuals into crypto and give everyone a baseline understanding of the different fields in the cryptosphere. Ryan is also an...
READ FULL BIO
Sponsored
Sponsored