Brief content
Liquidity pools are one of the core technologies underlying the current DeFi ecosystem. They are an integral part of automatic market makers (AMM), borrowing and lending protocols, profit farm, synthetic assets, on-chain insurance, blockchain games, etc.
The idea itself is quite simple. A liquidity pool is basically funds collected in a large digital "pile". But what can you do with that pile in a permissionless environment where anyone can add liquidity to it? Let's see how DeFi embodies the idea of liquidity pools.
Introduction
Decentralized finance (DeFi) has caused a boom in activity on the network. DEX volumes can seriously compete with volumes on centralized exchanges. As of December 2020, DeFi protocols have recorded $15 billion in locked value. The ecosystem is rapidly expanding due to new types of products.
But what makes this expansion possible? One of the core technologies underlying all these products is the liquidity pool.
What is a liquidity pool?
A liquidity pool is a collection of funds blocked in a smart contract. Liquidity pools are used to provide decentralized trading, lending and many other functions that we will cover later.
Liquidity pools are the basis of many decentralized exchanges (DEX) such as Uniswap. Users, called liquidity providers (LPs), add an equal value of two tokens to the pool to create a market. In exchange for providing their funds, they earn trading commissions from trades that occur in their pool, in proportion to their share of the total liquidity.
Since anyone can be a liquidity provider, AMMs have made the market 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 using Ethereum liquidity pools are SushiSwap, Curve, and Balancer. Liquidity pools on these platforms contain ERC-20 tokens. Similar equivalents on Binance Smart Chain (BSC) are PancakeSwap, BakerySwap and BurgerSwap, where the pools contain BEP-20 tokens.
Liquidity pools versus order books
To understand how liquidity pools differ, let's look at the fundamental building block of electronic trading - the order book. Simply put, an order book is a set of current open orders for a given market.
The system that matches orders with each other is called a matching engine. Along with the matching engine, the order book is the core of any centralized exchange (CEX). This model is excellent for facilitating efficient exchange and allows for the creation of complex financial markets.
However, DeFi trading involves executing transactions within the network without a centralized party holding the funds. This creates a problem for the order book. Each interaction with the order book requires a gas commission, which makes the execution of trades much more expensive.
It also makes the work of market makers, the traders who provide liquidity for trading pairs, extremely expensive. However, above all, most blockchains cannot provide the necessary bandwidth to handle billions of dollars in daily trade.
This means that in a blockchain like Ethereum, exchanging the order book on the chain is practically impossible. You can use sidechain or second-tier solutions that are already in development. However, the network cannot handle the bandwidth in its current form.
Before we go any further, it's worth noting that there are DEXs that work fine with on-chain order books. Binance DEX is built on Binance Chain and specially designed for fast and cheap trading. Another example is Project Serum, built on the Solana blockchain.
Even so, since most of the assets in the crypto space are in Ethereum, you can't trade them on other networks unless you use some sort of cross-chain bridge.
How do liquidity pools work?
Automated Market Makers (AMMs) have changed this game. This is an important innovation that allows you to trade online without the need for an order book. Since there is no direct counterparty required to execute trades, traders can enter and exit positions in token pairs that are likely to be very illiquid on exchanges with order books.
You can think of an order book exchange as a peer-to-peer platform where buyers and sellers are connected by an order book. For example, trading on Binance DEX is peer-to-peer, as transactions take place directly between users' wallets.
Trading with an automated market maker is different. You can think of it as peer-to-contract transactions.
As we have already mentioned, the liquidity pool is a collection of funds deposited into a smart contract by liquidity providers. When you trade on AMM, you don't have a counterparty in the traditional sense of the word. Instead, you trade against the liquidity in the liquidity pool. In order for the buyer to buy, there does not necessarily need to be a seller at the moment, only sufficient liquidity in the pool.
When you buy the last coin on Uniswap, there is no seller on the other side in the traditional sense. Instead, your activity is governed by an algorithm that controls what happens in the pool. In addition, the prices are also determined by this algorithm based on the trades that take place in the pool. If you want a deeper understanding of how it works, read our article on AMM.
Of course, liquidity has to come from somewhere, and anyone can be a liquidity provider to be considered your counterparty in some sense. But it's not the same as the order book model because you're interacting with a contract that manages the pool.
What are liquidity pools used for?
So far, we have mainly discussed AMMs, which have been the most popular use of liquidity pools. However, as we have already said, liquidity pooling is a very simple concept, so it can be used in different ways.
One option is a profitable farm or liquidity mining. Liquidity pools are the basis of automated profit generation platforms such as yearn, where users add their funds to pools that are then used to generate profits.
Distribution of new tokens to the right people is a very difficult problem for crypto-projects. Liquidity mining has been one of the most successful approaches. In essence, tokens are distributed algorithmically among users who place their tokens in a liquidity pool. The newly created tokens are then distributed in proportion to each user's share in the pool.
Keep in mind; it can even be tokens from other liquidity pools, called pool tokens. For example, if you provide liquidity to Uniswap or lend funds to Compound, you will receive tokens that represent your share of the pool. You may be able to put these tokens into another pool and make a profit. These chains can become quite complex as protocols integrate other protocols' pool tokens into their products and so on.
We could also consider management as a use case. In some cases, a very high threshold of token votes is required to be able to put forward a formal governance proposal. If the funds are pooled instead, participants will be able to rally around a common cause they consider important to the protocol.
Another emerging DeFi sector is smart contract risk insurance. Many of these implementations are also supported by liquidity pools.
An even more advanced use of liquidity pools is tranching. It is a concept borrowed from traditional finance that involves dividing financial products based on their risks and returns. As you would expect, these products allow LPs to choose individual risk and return profiles.
The mining of synthetic assets on the blockchain also depends on liquidity pools. Add collateral to a liquidity pool, connect it to a trusted oracle, and you'll have a synthetic token tied to whatever asset you want. Well, it's actually a more complicated problem, but the basic idea is this.
What else can you think of? There are likely many more uses for liquidity pools yet to be discovered, all of which depend on the ingenuity of DeFi developers.
➟Want to start working with cryptocurrency? Buy Bitcoin (BTC) on Binance!
Risk of liquidity pools
If you provide liquidity to AMMs, you need to be aware of a concept called volatility losses. In short, it's the loss of dollar value compared to holding (HODLing) when you provide liquidity to AMM.
If you provide liquidity to AMMs, you are likely to be exposed to volatile losses. Sometimes they can be tiny; sometimes they can be huge. Be sure to read our article on this if you plan to invest in a bilateral liquidity pool.
Another thing to keep in mind is the risks of smart contracts. When you deposit funds into a liquidity pool, they stay in the pool. So while there are technically no intermediaries holding your funds, the contract itself essentially holds those funds. If there is a mistake or some vulnerability with a flash loan, your funds can be lost forever.
Also, beware of projects where the developers have permission to change the rules governing the pool. Sometimes developers may have an administrator key or any other privileged access in the smart contract code. This could allow them to potentially do something malicious, such as take control of the funds in the pool. Read our article on DeFi scams to try to avoid it.
Final thoughts
Liquidity pools are one of the core technologies underlying the current DeFi technology stack. They provide decentralized trading, lending, profit making and much more. These smart contracts work in almost every part of DeFi and will likely continue to do so.



