TL;DR

Liquidity pools are one of the foundational technologies behind today's DeFi ecosystem, playing a critical role in automated market makers or automated market makers (AMM), lending and lending protocols, yield farming, synthetic assets, on-chain insurance, blockchain gaming – and there are many more, the list goes on.

On its own, the idea is very simple. Liquidity pools are basically funds pooled together in large piles in the digital world. What can you do with this stack in a permissionless environment, where anyone can add liquidity to it? Let's explore how DeFi implements the idea of ​​liquidity pools.


Introduction

Decentralized Finance (DeFi)  has created an explosion of on-chain activity. DEX volume can now compete with volume on centralized exchanges. As of December 2020, there was nearly 15 billion dollars of value locked in DeFi protocols. The ecosystem is growing rapidly with various types of new products.

But what makes all this expansion possible? One of the core technologies behind all these products is liquidity pools.


What is a liquidity pool?

A liquidity pool is a collection of funds locked in a smart contract. Liquidity pools are used to facilitate decentralized trading, lending, and many other functions which we will discuss later.

Liquidity pools are the backbone of most decentralized exchanges (DEXs), such as Uniswap. Users called liquidity providers (LPs) add the equal value of two tokens in a pool to create a market. In return for providing funds, they earn a share of the trading fees incurred in the pool in question, proportional to their share of the total liquidity.

Since anyone can become a liquidity provider, AMMs have made the market more accessible.

One of the first protocols to use liquidity pools was Bancor, but the concept is gaining more attention due to the popularity of Uniswap. Some other popular exchanges that use liquidity pools on Ethereum include SushiSwap, Curve, and Balancer. The liquidity pools on these venues contain ERC-20 tokens. Similar exchanges on the Binance Smart Chain (BSC) are PancakeSwap, BakerySwap, and BurgerSwap, where the pools contain BEP-20 tokens.


Liquidity pools vs. order book

To understand the differences in liquidity pools, let's look at a fundamental part of electronic trading – the order book. Simply put, an order book is a collection of orders that are currently open to the market.

A system that matches one order with another is called a matching machine. Together with the matching engine, the order book is the core of any centralized exchange (CEX). This model is very useful for facilitating efficient exchange and enabling the creation of complex financial markets.

However, in DeFi trading involves execution on-chain, without a centralized party holding funds. This will cause problems in the order book. Each interaction with the order book costs gas, which makes transactions much more expensive to execute.

This also makes the work of market makers, traders who provide liquidity to trading pairs, very expensive. But most importantly, most blockchains are unable to handle the throughput required to trade billions of dollars each day.

This means that on a blockchain like Ethereum, on-chain order book exchange is practically impossible. You can use a sidechain or layer-2 solution, and these are still being developed. However, the network is unable to handle the throughput in its current form.

Before we go any further, it's worth noting that there are DEXs that work well with on-chain order books. Binance DEX is built on Binance Chain, and is specifically designed for fast and cheap trading. Another example is Project Serum which is built on the Solana blockchain.

That said, since most assets in the crypto world are on Ethereum, you can't trade them on other networks unless you use some kind of cross-chain bridge.


How do liquidity pools work?

Automated market makers (AMM) have changed the game. AMM is a major innovation that allows on-chain trading to take place without the need for an order book. Because no direct counterparty is required to execute a trade, traders can enter and exit positions on token pairs that would likely be highly illiquid in the exchange's order book.

You can think of order book exchanges like peer-to-peer, where buyers and sellers are connected by an order book. For example, trading on Binance DEX is peer-to-peer because trading occurs directly between users' wallets.

AMM is a little different. You can think of trading on AMM as peer-to-contract trading.

As discussed previously, a liquidity pool is a collection of funds deposited into a smart contract by a liquidity provider. When you trade on AMM, you do not have a counterparty in the traditional sense. Instead, you trade with liquidity in a liquidity pool. In order for buyers to buy, there does not need to be a seller at that time, just liquidity in the pool.

When you buy the newest food coin on Uniswap, there is no seller in the traditional sense. Instead, your activity is managed by an algorithm that regulates everything that happens within the pool. Apart from that, pricing is also determined by this algorithm based on the trading that occurs in the pool. If you want to know more about how it works, read our AMM article.

Of course, liquidity must be on either side, buyer or seller, and anyone can be a liquidity provider, so they can be seen as your counterparty. However, this is not the same as the order book model, because in an AMM, you interact with the contracts that govern the pool.


What are the benefits of liquidity pools?

So far, we've mostly discussed AMMs, which are the most popular use of liquidity pools. However, as previously mentioned, pooling liquidity is a very simple concept, so it can be used in a variety of ways.

One of them is yield farming or liquidity mining. Liquidity pools are the basis of automated yield generating platforms like yearn, where users add their funds into a pool which is then used to generate yield.

Distributing new tokens in the hands of the right people is a very difficult problem for crypto projects. Liquidity mining is one approach that is quite successful. Basically, tokens are distributed algorithmically to users who put their tokens into a liquidity pool. Then, the newly created tokens are distributed proportionally to each user section in the pool.

However, please remember; these can even be tokens from other liquidity pools called token pools. For example, if you provide liquidity into Uniswap or lend funds to Compound, you will earn tokens representing your share in the pool. You may be able to deposit those tokens into another pool to make a profit. These chains can be very complex, as protocols integrate token pools from other protocols into their products, and so on.

We can also view governance as a use case. In some cases, there are very high token thresholds required for voting to submit formal governance proposals. If funds are pooled together, participants can unite behind a common goal that they consider important to the protocol.

Another emerging DeFi sector is insurance against smart contract risks. Many of the implementations are also supported by liquidity pools.

Another, even more sophisticated use of liquidity pools is tranching. This is a concept borrowed from traditional finance that involves dividing financial products based on risk and return. As you probably already know, this product allows LPs to choose a customized risk and return profile.

Minting synthetic assets on the blockchain also relies on liquidity pools. Add some collateral into a liquidity pool, connect it to a trusted oracle, and you'll get a synthetic token pegged to whatever asset you want. OK, in reality, it's a more complicated matter than that, but the basic idea is that simple.

What else? There may be many more uses for liquidity pools yet to be revealed, it all depends on the ingenuity of DeFi developers.


➟ Want to own cryptocurrency? Buy Bitcoin (BTC) on Binance!


Liquidity pool risk

If you are providing liquidity into an AMM, you should be aware of a concept called impermanent loss. In short, impermanent loss is a loss in dollar value compared to HODLing as long as you provide liquidity.

If you provide liquidity into an AMM, you risk impermanent loss. Sometimes it can be small amounts; sometimes it can be very large. Be sure to read our article on this topic if you are considering depositing funds into a two-sided liquidity pool.

Another thing to pay attention to is smart contract risks. When you deposit funds into a liquidity pool, those funds stay in the pool. So, while there is technically no intermediary holding your funds, the contract itself can be considered a custodian of those funds. For example, if there is a bug or some kind of exploit through a flash loan, your funds could be lost forever.

Additionally, be wary of projects where the developer has permission to change the rules controlling the pool. Sometimes, developers may have admin keys or some other privileged access in the smart contract code. This could allow them to potentially do dangerous things, such as taking control of the funds in the pool. Read our DeFi scams article to best avoid rug pulls and exit scams.


Conclusion

Liquidity pools are one of the core technologies behind the current DeFi technology stack. This platform allows decentralized trading, lending, yield farming, and much more. The smart contracts in it are the energy source for almost all parts of DeFi.

Do you still have questions about liquidity pools and Decentralized Finance? Check out our question and answer platform, Ask Academy, where the community will answer your questions.