MoonPay logo
0 minsPublished on 11/28/2023

What are liquidity pools in decentralized finance (DeFi)?

Liquidity pools are crucial for peer-to-peer trading in decentralized finance (DeFi). Here’s what they are and how they work.

By Sankrit K

What are liquidity pools in DeFi

Disclaimer: The following is for informational purposes only and should not be construed as financial advice.

Liquidity pools are the lifeblood of most modern-day decentralized finance (DeFi) protocols. They enable many of the most popular DeFi applications (dApps) to function and offer a way for crypto investors to earn yield on their digital assets. At the time of writing, there is estimated to be over $45 billion of value locked in liquidity pools. 

But what are liquidity pools and why do they play such an important role in DeFi?

This article explains what liquidity pools are, how they work, and why they're so crucial to the DeFi ecosystem.

What is a liquidity pool?

A liquidity pool is a collection of digital assets accumulated to enable trading on a decentralized exchange (DEX). They are created when users lock their cryptocurrency into smart contracts that then enables them to be used by others.

Liquidity is the ability of an asset to be sold or exchanged quickly and without affecting the price. In other words, liquidity is a measure of how easily an asset can be converted into cash.

Liquidity pools are an essential part of decentralized exchanges. They provide the liquidity that is necessary for these crypto exchanges to function, a bit like how companies transform money into debt or equity via loans.

Here are some examples of popular liquidity pools and the blockchain network on which they operate:

A table of liquidity pools and their respective blockchain/ecosystem
Popular liquidity pools and their respective blockchain ecosystem

As the name suggests, a DEX is a decentralized exchange that doesn’t rely on a third party to hold users' funds. Instead, DEX users transact with each other directly.

DEXs require more liquidity than centralized exchanges, however, because they don't have the same mechanisms in place to match buyers and sellers.

They use automated market makers (AMMs), which are essentially mathematical functions that dictate prices in accordance with supply and demand.

You can think of liquidity pools as crowdfunded reservoirs of cryptocurrencies that anybody can access. In exchange for providing liquidity, those who fund this reservoir earn a percentage of transaction fees for each interaction by users.

Without liquidity, AMMs wouldn’t be able to match buyers and sellers of assets on a DEX, and the whole system would grind to a halt.

How do liquidity pools work?

Liquidity pools are created when users (called liquidity providers) deposit their digital assets into a smart contract. These assets can then be traded against each other on a DEX.

When a user provides liquidity, a smart contract issues liquidity pool (LP) tokens. These tokens represent the liquidity provider's share of assets in the pool.

An illustration of how liquidity pools work
How liquidity pools work

Unlike traditional cryptocurrency exchanges that use order books, the price in a DEX is typically set by an Automated Market Maker (AMM). When a trade is executed, the AMM uses a mathematical formula to calculate how much of each asset in the pool needs to be swapped in order to fulfill the trade.

The LPTs can be redeemed for the underlying assets at any time, and the smart contract will automatically issue the appropriate number of underlying tokens to the user.

Why are liquidity pools important?

Liquidity pools are at the heart of DeFi because peer-to-peer trading isn’t possible without them. Below are a few reasons why liquidity pools play such an important role.

Liquidity pools enable users to trade on DEXs

Liquidity pools provide the liquidity that is necessary for decentralized exchanges to function. Without them, it would be very difficult to trade digital assets on a DEX.

Liquidity pools provide the liquidity that is necessary for decentralized exchanges to function by allowing users to deposit their digital assets into a pool, and then trade the pool tokens on the DEX.

Liquidity Pools eliminate middlemen and centralized entities

Liquidity pools use Automated Market Makers (AMMs) to set prices and match buyers and sellers. This eliminates the need for centralized exchanges, which can increase privacy and efficiency of transactions.

Liquidity providers get incentives

Liquidity pools pave a way for liquidity providers to earn interest on their digital assets. By locking their tokens into a smart contract, users can earn a portion of the fees that are generated from trading activity in the pool.

This provides an incentive for users to supply liquidity to the pool, and it helps to ensure that there is enough liquidity available to support trading activity on the DEX.

What is the purpose of liquidity pools?

The primary goal of liquidity pools is to facilitate peer-to-peer (P2P) trading on DEXs. By providing a steady supply of buyers and sellers, liquidity pools ensure that trades can be executed quickly and efficiently.

Many people use liquidity pools as a financial tool to participate in yield farming (also called “liquidity mining”). Simply put, yield farming is the process of providing liquidity to a pool in order to earn a portion of the fees that are generated from trading activity.

An image of cows
Yield farming, not to be confused with real farming

Yield farming is often compared to staking but is not the same. Read our in-depth article on the differences between yield farming and staking to learn more.

A slightly more advanced concept to learn is “superfluid staking”. 

As discussed, liquidity providers get tokens (LPTs) when they provide liquidity. With superfluid staking, those LPTs can then be staked in order to earn more rewards. So not only are users earning from the trading activity in the pool, they’re also earning returns from staking the LPTs they receive.

How much do liquidity providers earn from liquidity pools?

The amount a liquidity provider can earn from providing liquidity to a pool can vary based on a number of different factors.

Below is a table of some popular DEXs and corresponding payouts for LPs.

A table of the percentage of trade distributed to liquidity pools
Percentage of trade distributed to liquidity pools

The exact amount earned by any liquidity provider will depend on the size of the pool, the trading activity, and the fees that are charged.

A simple analogy may help you understand.

Suppose you and four of your friends invest $100 each to start a $500 lemonade stand. If you keep the business as is, then each of you would own one-fifth of the business ($500 divided by five people). 

But if you expand the business by buying more lemonade machines, then the percentage ownership of each person would change depending on how much money they invested.

The same principle applies to liquidity pools. The assets in the pool are analogous to the lemonade machines, and the users who supply those assets are like the friends who invested in the business.

An image of a pool
Take a dip in the liquidity pool

The size of a user's share in the pool depends on how much of the underlying asset they have supplied. So, if a pool has $100 worth of assets and a user has supplied 10% of those assets, then that user would own 10% of the pool and would earn 10% of the rewards that are distributed.

Liquidity pool risks

Like any investment, there are always risks involved. This is especially true when it comes to DeFi and we have set out a few risks below that you should know about.

Bugged smart contracts

One of the biggest risks when it comes to liquidity pools is smart contract risk. This is the risk that the smart contract that governs the pool can be exploited by hackers.

If hackers are able to find a bug in the smart contract, they may be able to drain the liquidity pool of all its assets.

For instance, a hacker could borrow a large number of tokens by taking a flash loan and execute a series of transactions that would eventually result in the funds draining, which is what happened in the 2020 flash loan attack on Balancer protocol.

This is why it's highly recommended to only invest in liquidity pools that have been audited by a reputable firm, thus reducing the likelihood of engaging with a vulnerable smart contract.

High slippage due to low liquidity

Another risk to consider is low liquidity. If a pool doesn't have enough liquidity, it could experience high slippage when trades are executed.

What this essentially means is that the price difference between the performed transaction and the executed trade is large. This is because when the liquidity pool is small, even a small trade greatly alters the proportion of assets.

What if you still want to interact with the pool but at the same time not risk an unaffordable slippage?

Fortunately, most DEXs allow you to set slippage limits as a percentage of the trade. But keep in mind that a low slippage limit may delay the transaction or even cancel it.

For instance, if you are minting a hyped NFT collection alongside several others, then you’d ideally want your transaction to be executed before all the assets are bought. In such cases, you could benefit from setting a higher slippage limit.

Frontrunning transactions

Another common risk is frontrunning. This occurs when a user tries to buy or sell an asset at the same time that another user is executing a trade.

The first user is able to buy the asset before the second user, and then sell it back to them at a higher price. This allows the first user to earn a profit at the expense of the second user.

This is mainly seen on networks with slow throughput and pools with low liquidity (due to slippage).

Impermanent loss

Impermanent loss is the most common type of risk for liquidity providers.

It occurs when the price of the underlying asset in the pool fluctuates up or down. When this happens, the value of the pool's tokens will also fluctuate.

If the price of the underlying asset decreases, then the value of the pool's tokens will also decrease.

The reason this is considered a risk is that there is always the potential that the price of the underlying asset could decrease and never recover. If this happens, then the liquidity provider would experience a loss.

An impermanent loss could also occur when the price of the asset increases greatly. 

This causes the users to buy from the liquidity pool at a price lower than that of the market and sell elsewhere. If the user exits the liquidity pool when the price deviation is large, then the impermanent loss will be “booked” and is therefore permanent.

Liquidity pools with assets of low volatility such as stablecoins have historically experienced the least impermanent loss.

View our Bitcoin Price and Ethereum Price pages for live price and market data for these leading cryptocurrencies.

How to create a liquidity pool

In order to create a liquidity pool, you need to deposit an equal value of two different assets into the pool. These are called “trading pairs”.

For example, let's say you want to create a pool that contains the trading pair ETH/USDC. You would need to deposit an equal value of both assets into the pool.

Traditionally, you would have to acquire the equivalent value of assets and then manually put them into the pool.

Some protocols, like Bancor and Zapper, are simplifying this by allowing users to provide liquidity with just one asset. This saves a lot of time and effort for users as they don't have to perform manual calculations or acquire the second asset.

Below are some useful resources if you wish to create a liquidity pool:

Frequently Asked Questions about liquidity pools (FAQs)

What are indicators of a functional liquidity pool?

Some indicators of a functional liquidity pool include one that has been audited by a reputable firm, has a large amount of liquidity, and has high trading volume.

It's also important to consider the fees associated with the pool as well as the risks involved.

Can you make money with liquidity pools?

Yes, you can make money by providing liquidity to a pool. 

This is because you will earn fees whenever a trade is executed in the pool. However, you may also lose money by providing liquidity to a pool, as we have summarized in listing some main risks earlier in this article.

Recent findings also show that several liquidity providers themselves are actually losing more money than they are making.

Bull markets present the best opportunity for earning profits from liquidity pools as there is typically a lot of trading activity during these times and the price of assets may also go up, thus lowering your impermanent loss (as long as one of the assets in the liquidity pair is not a stablecoin).

In a bear market, on the other hand, the risk of impermanent loss could be far greater due to the market downturn. This is only true, however, when the fall in price of one asset  is greater than the pair’s appreciation.

Start providing liquidity with MoonPay

By providing liquidity in DeFi protocols, you can earn interest and grow your crypto portfolio.

To get started on your liquidity pool journey, simply buy crypto via MoonPay using a card, mobile payment method like Google Pay, or bank transfer.

MoonPay's widget offers a fast and easy way to buy BitcoinEthereum, and more than 50 other cryptocurrencies.

MoonPay also makes it easy to sell crypto when you decide it's time to cash out, including several tokens mentioned in this article like ETH and USDC. Simply enter the amount of the token you'd like to sell and enter the details where you want to receive your funds.

Sankrit K
Written bySankrit K

You might also like