What Are Liquidity Pools in DeFi and How Do They Work?

DATE PUBLISHED: DEC 14, 2021
13 MIN
DATE UPDATED: OCT 3, 2023

Start Trading on 3Commas Today

Get full access to all 3Commas trading tools with free trial period

Liquidity pools play a significant role in the formation of DeFi. They are crucial in automated market-making, borrowing/lending, yield farming, and many gaming projects. But what is a liquidity pools in crypto exactly?

This article explains the idea behind the liquidity pools concept, discusses how they work, and shares why major crypto projects leverage pools. Without further ado, let's have a look at how DeFi has refined the idea of liquidity pools.

Liquidity pools explained

In 2023, the concept of a liquidity pool remains fundamentally simple, yet increasingly vital in the rapidly evolving world of decentralized finance (DeFi). Essentially, a liquidity pool is a repository where market participants deposit their assets, creating a large reserve of liquidity to facilitate asset exchange. While in traditional financial systems, big banks serve as these liquidity pools—holding large deposits and even possessing the ability to create additional money—the crypto world offers a more decentralized approach.

A crypto liquidity pool consists of a cache of tokens securely locked in a designated smart contract account. Prominent decentralized exchanges (DEXs) rely on these liquidity pools to enable seamless trading activities. Although Bancor was one of the pioneers in introducing liquidity pools, it was Uniswap that truly popularized the concept. Another standout example in this context is Binance's liquidity solution, known as Binance Liquid Swap.

Fast forward to 2023, and liquidity pools have undergone further innovation, becoming integral parts of complex DeFi products and services. They are now often used in yield farming strategies, token swaps, and even in decentralized lending platforms. Newer blockchain projects are also adopting liquidity pools as a fundamental building block, recognizing their utility in providing depth and stability to the market. Given the expanding use-cases and the need for efficient asset exchange in the burgeoning crypto space, liquidity pools are expected to continue playing a pivotal role in the decentralized financial ecosystem.

The Role of Liquidity Pools

A liquidity pool is token storage that provides trading a particular currency pair. Farmers provide liquidity in return for remuneration from the project, depending on the share they have invested. Reliable farming is provided by smart contracts (contracts based on software code), which act as digital agreements to fulfill the conditions of all parties. A liquidity pool is a smart contract filled with cash. 

Decentralized Exchanges (DEX) set orders to buy or sell crypto. The project's smart contract distributes a strictly defined amount of tokens to farmers, depending on their share of the investment. The model is called automated market-making (AMM).

So, if "X" invested $20,000 and "Y" invested the same pair, but at a rate of $10,000, then the total pool is $30,000. The share of the first — 66%, the second — 33%. The exchange allows farmers to buy and sell tokens within the pool at the expense of token liquidity. The higher the demand for the token, the more profitable deal farmers can grab. 

Liquidity and Market Makers

Most centralized exchanges (CEX) are based on a limited order book approach, just like traditional stock exchanges. They rely on market makers to adjust the price gap—the bid-ask spread for a limited order book.

Decentralized exchanges (DEX) typically use a liquidity pool mechanism; they have programmed an automatic market maker in a smart contract to provide balanced liquidity in the pool. DEX prefer liquidity pools, mainly because every time you place an order in a limited order book, there will be a gas charge on the Ethereum network. 

Frequently placing and canceling orders in the order book, just like on traditional exchanges, will significantly increase the commission per transaction for DEX users. However, by applying a liquidity pool, DEX investors can complete a transaction at a minimal cost.

Market makers (MM)

Liquidity is the property of assets to be sold quickly and close to the market price.

Money is the most liquid asset, it’s common, and you can exchange it for any goods, services, or assets at any time. 

Market makers are organizations that facilitate trading by constantly buying or selling a particular asset, boosting liquidity. So users can trade without waiting for another counterparty to appear. The crypto exchange would be illiquid and unusable for users without market makers.

However, MM model is slow and expensive. Market makers usually keep track of the current value of an asset by constantly changing their prices. This leads to a huge number of orders and cancellations. There is a gas fee for every interaction with a smart contract on the Ethereum network, so market makers need a lot of money, constantly updating their orders. 

These and other reasons make exchanging assets using the "order book" model unviable. It was necessary to develop and implement a new working mechanism to ensure liquidity at the exchange. This problem was solved utilizing decentralized finance and liquidity pools.

How liquidity pools work?

A DeFi liquidity pool contains two tokens and thus creates a new market to exchange these assets. More often than not, liquidity pools crypto are provided in two tokens in a 50/50 ratio. One famous example is the DAI/ETH exchange market based on Uniswap. The user receives a portion of the commissions from all exchanges going through the pool by providing liquidity. 

When a new pool is created, the first liquidity provider sets a starting rate for exchanging assets within the pool. Each liquidity provider must deposit an equal amount of both tokens into the pool. Suppose the starting exchange rate within the pool is very different from current global prices. This immediately creates the possibility for arbitrage, which can mean a loss of capital for the liquidity provider. The concept of delivering tokens at the right ratio remains true for all subsequent providers who want to send their funds into the pool.

What are lp tokens?

After sending tokens to the pool, the provider receives special tokens (LP tokens)  —  in proportion to how much liquidity they have provided. When a transaction in which the pool participates occurs, the decentralized exchange charges a commission of 0.3% of the transaction. It distributes that commission to all participants in the pool, in proportion to their share. Thus, there are earnings from the provision of liquidity. If a provider wants to get back the invested funds from the pool (along with the accrued income), they must conduct a burn of their LP tokens.

Using the liquidity pool, each exchange of tokens causes the exchange rate to move according to a unique algorithm. This mechanism is also called Automatic Market Maker (AMM), and liquidity pools of different protocols may use slightly different algorithms.

Uniswap’s Pool

Basic lp pool, such as Uniswap's, use a constant, calculated as the product of the number of both tokens in the pool. That way, the pool can always provide liquidity. Simply, the fewer tokens A remains, the more expensive they become, and the cheaper tokens B become. 

It turns out that if a user buys a lot of ETH in an ETH/DAI pair, user reduces the ETH stock and increases the DAI stock, which is immediately reflected in the exchange rate. The larger the pool volume relative to the transaction size, the less this transaction affects the price.

Larger pools of liquidity create a more stable environment where each transaction has almost no effect on the shift in the exchange rate. This is the ultimate goal of both market participants and liquidity providers (they make money on commissions from transactions, more transactions mean more income). 

Liquidity mining pools are the reason why protocols such as Balancer motivate liquidity providers to invest their tokens in certain small pools. This process is called liquidity mining. The idea is simple enough. Still, it’s tricky within the world of trading and exchanges, as it allows to refuse order books and market makers, distributing revenue from trading activity among all pool participants.

Types of liquidity pools

The Uniswap protocol pools we've just described are a basic type of pool. Other open-source projects have continued to work on this technology and have proposed new pooling schemes.

For example, Curve was the first to realize that the mechanism offered by Uniswap was not well suited for exchanging assets whose price should not change, depending on supply or demand. That's because they are backed by real assets, like the U.S. dollar. This type of asset, in particular, includes stabelcoins such as USDT, TUSD, USDC, and others. Curve pools work on a modified algorithm that reduces sensitivity to each transaction, and the exchange rate remains more stable.

Another idea for developing liquidity pools crypto came from the Balancer protocol: the creators of the project realized that developers should not limit themselves to a pair of tokens in a pool, so Balancer allows up to 8 tokens within one pool.

Benefits of liquidity pools

  • Great interest per annum

However, the interest per annum in DeFi is not constant and depends on many factors. First of all, the interest depends on the size of the liquidity pool itself  —  as the pool increases, the interest per annum will fall.

  • Independence from centralized exchanges, third parties, and no account verification (KYC)

DeFi functions on smart contracts, which means no one can stop interacting with them.

  • Successful investing in DeFi 

It involves constant analysis of new pools, platforms, and redistribution of funds between them, so the skills learned can come in handy many times in the future.

Risks of liquidity pools

Potentially big profits entail potentially big risks. In addition to the standard DeFi risks, such as smart contract bugs, system risks, and admins' keys, investors and traders get two new types of risks  —  impermanent loss and liquidity pool hacks. 

A DeFi investor's funds are locked into the pool's smart contract and are not on the exchange. This means that the investor will not use classic exchange functionality and order system, so he will not set stop-losses and take-profits.

Despite the perceived danger, a much smaller disadvantage of participating in DeFi is the Impermanent Loss phenomenon. This concept refers to the difference in asset value when simply holding in a wallet versus participating in a liquidity pools crypto. 

Not sure what impermanent losses are? Check out our thorough guide about impermanent losses.

In most cases, the impermanent loss is not a significant factor, and if there is enough time to participate in the pool, it’s compensated by the rewards. However, the impermanent loss may increase significantly. 

Smart contracts also involve higher risks. Namely, risks associated with interacting with a fraudulent smart contract due to negligence and the risk of hacking the pool smart contract itself by attackers. No one is immune to the latter, and in the event of hacking, you stand to lose your money completely.

Conclusions

The idea of liquidity pools and mining is straightforward. At the same time, it completely changes the world of crypto-trading and the work of exchanges, as it allows to abandon the traditional order book, distributing traders' commissions among pool members.