TL;DR

Liquidity pools are one of the fundamental technologies behind the current DeFi ecosystem. They are an essential part of automated market makers (AMM), lending protocols, yield farming, synthetic assets, on-chain insurance, blockchain gaming – the list is long.

The idea is quite simple. A liquidity pool is basically a reserve of funds stored in a large digital 'package'. And what is this package for in a permissionless environment, where anyone can add liquidity to it? Let's explore how DeFi has iterated on the idea of ​​liquidity pools.


Introduction

The Decentralized Finance (DeFi) sector has created an explosion of on-chain activity. DEX volumes are capable of competing with the volume of centralized exchanges. As of December 2020, there was nearly $15 billion of value locked in DeFi protocols. The ecosystem is expanding rapidly with many new types of products.

But what makes this expansion possible? One of the main technologies behind the new products is the liquidity pool.


What is a liquidity pool?

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

The liquidity pool is the main component of many decentralized exchanges (DEX) such as Uniswap. Users called liquidity providers (LP) add an equal value of two tokens into a pool to create a market. In exchange for providing their funds, they receive trading fee amounts on the trades that take place in the pool. The value is proportional to your share of total liquidity.

Since anyone can be a liquidity provider, AMMs have made market making more accessible.

One of the first protocols to use liquidity pools was Bancor, but the concept gained more attention with the popularization of Uniswap. Some other popular exchanges that use liquidity pools on Ethereum are: SushiSwap, Curve, and Balancer. The liquidity pools on these platforms contain ERC-20 tokens. Equivalent projects 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 how liquidity pools are different, let's look at the main component of building electronic trades – the order book. Basically, the order book is a set of open orders available in a given market.

The system that matches orders together is called a matching mechanism. Along with the matching engine, the order book is the core of any centralized exchange (CEX). This is a great model used to facilitate exchange and efficient trading and has allowed for the creation of more complex financial markets.

DeFi trading, however, involves executing trades on-chain, without a centralized party holding the funds. This presents a problem when it comes to order books. Each interaction with the order book requires Gas fees, which makes the process much more expensive for executing trades.

This also makes the work of market makers, traders who provide liquidity for trading pairs, extremely expensive. Above all, though, most blockchains are not capable of handling the throughput required to trade billions of dollars every day.

This means that on a blockchain like Ethereum, an on-chain order book exchange is practically impossible. We could use sidechains or layer-two solutions, which are already under development. However, the network is not able to handle the throughput in its current version.

Before we go any further, it is important to note 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 trades. Another example is Project Serum, which is being built on the Solana blockchain.

Still, as many of the crypto sector's assets are located on Ethereum, it will not be possible to trade them on other networks unless you use some type of cross-chain bridge (a type of connection between different chains).


How do liquidity pools work?

Automated Market Makers (AMM) have completely changed the landscape of the 'game'. They are an important innovation that allows on-chain trading without the need for an order book. Since no direct counterparty is required to execute trades, traders can enter and exit positions on token pairs that would likely have very low liquidity on order book exchanges.

We can imagine an order book exchange as a peer-to-peer platform, where buyers and sellers connect through the order book. For example, trading on Binance DEX is peer-to-peer, as trades take place directly between users' wallets.

Trading through an AMM is different. We can imagine trading on an AMM as a peer-to-contract operation.

As we mentioned, a liquidity pool is a pool of funds deposited into a smart contract by liquidity providers. When you are placing a trade on an AMM, there is no counterparty like in traditional trades. Instead, you execute the trade against the liquidity of the liquidity pool. To buy, there does not need to be a seller at that moment, just sufficient liquidity in the pool.

When you buy the latest 'food coin' on Uniswap, there is no seller on the other side, in the traditional sense. In reality, the operation is managed by the algorithm that controls what happens in the pool. Furthermore, the price is also determined by this algorithm based on the trades that happen in the pool. If you want to know more, read our article about AMM.

Of course, liquidity must have an origin. Anyone can be a liquidity provider, so they can be seen as a counterparty. But it is not the same case as the order book model, as you are interacting with the contract that manages the pool.


What are liquidity pools used for?

So far, we've mainly talked about AMMs, which have been the most popular use of liquidity pools. However, as we said, the concept of a liquidity pool is very simple, so it can be used in a number of different 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 to pools that are used to generate yield.

Distributing new tokens to the right people is a very complex problem in crypto projects. Liquidity mining has been one of the most successful approaches. Basically, tokens are distributed algorithmically to users who place their tokens in a liquidity pool. Then, the newly created tokens are distributed to each user in the pool, in an amount proportional to their shares.

Remember if; these can even be tokens from other liquidity pools, called pool tokens. For example, if you are providing liquidity to Uniswap or lending funds to the Compound protocol, you will receive tokens representing your pool holdings. You can deposit these tokens into another pool and earn income. These chains can be quite complicated, as protocols integrate pool tokens from other protocols into their products, and so on.

We can also imagine governance as a use case. In some cases, there is a very high threshold of token votes required to present a formal governance proposal. If funds are pooled, participants can unite around a common cause that they consider important to the protocol.

Another emerging sector of DeFi is smart contract risk insurance. Many of its implementations are also done using liquidity pools.

Another even more advanced use of liquidity pools is for tranching. Tranching is a concept originating from traditional finance that involves dividing financial products based on their risks and returns. As you would expect, these products allow LPs to select personalized risk and return profiles.

The creation of synthetic assets on the blockchain also relies on liquidity pools. Add some collateral to a liquidity pool, connect it to a trusted oracle, and you have a synthetic token tied to any asset you want. In reality, it's a little more complicated than that, but that's the basic idea.

What else can we mention? There are probably many other uses for liquidity pools that have not yet been discovered and it all depends on the ingenuity and creativity of developers in the DeFi sector.


➟ Thinking about investing in cryptocurrencies? Buy Bitcoin (BTC) on Binance!


The risks of liquidity pools

If you provide liquidity to an AMM, you should be aware of a concept called impermanent loss. In short, it is a loss in dollar value relative to HODLing when you are providing liquidity to an AMM.

When providing liquidity to an AMM, you are likely exposed to impermanent losses. Sometimes it can be insignificant. However, it can also be huge in some cases. If you're thinking about putting funds into a bilateral liquidity pool, it's worth reading our article about it.

Another thing to keep in mind is the risks of smart contracts. When you deposit funds into a liquidity pool, the funds remain in the pool. Therefore, although there are technically no intermediaries holding your funds, the contract itself can be considered a custodian of the funds. If there is a bug or some type of exploit through a flash loan, for example, your funds could be lost forever.

Also, be careful with projects where developers are allowed to change the rules governing the pool. In some cases, developers may have an administrator key or some other privileged access within the smart contract code. This makes it possible for them to try something malicious, like taking full control of the pool's funds. Read our article on DeFi scams to avoid scams and exit scams in the best way possible.


Final considerations

Liquidity pools are one of the core technologies behind the DeFi sector’s suite of technologies. They provide decentralized trading, lending, income generation and much more. These smart contracts power almost every part of the DeFi sector, and will most likely continue to do so.