Summary

Liquidity pools are one of the fundamental technologies in the current DeFi ecosystem. They are an integral part of many applications, such as automated market makers (AMMs), lending protocols, liquidity mining, synthetic assets, on-chain insurance, blockchain games, etc.

The concept itself is fairly simple, essentially funneling money into a large pile of numbers. However, in a permissionless environment where anyone can add liquidity to it, what can you do with this pile of numbers? Let us explore how DeFi completes iterations on the concept of liquidity pools.


Introduction

Decentralized finance (DeFi) has spawned a large amount of on-chain activity, driving decentralized exchanges to compete with centralized exchanges for trading volume share. As of December 2020, the value locked in DeFi protocols is close to $15 billion. With the continuous emergence of new products, the entire ecosystem continues to grow and develop.

What is the driving force behind this development? One of the core technologies behind all these products is the liquidity pool.


What is a liquidity pool?

It is a collection of funds locked in smart contracts that facilitate decentralized trading, lending, and more functions discussed later.

Liquidity pools are the backbone of many decentralized exchanges (DEXs), such as Uniswap. Users, called “liquidity providers (LPs)”, create markets by adding two tokens of equal value to the pool. In return, the transaction fees generated in the pool are distributed to users according to their respective proportions of the total liquidity.

Everyone can become a liquidity provider, and AMM makes market making more “people-friendly”.

Bancor was one of the first protocols to use liquidity pools, but the concept did not gain more attention until Uniswap became popular. Other popular exchanges in Ethereum that use liquidity pools include SushiSwap, Curve, and Balancer, whose liquidity pools accommodate ERC-20 tokens. Similar platforms in Binance Smart Chain (BSC) include PancakeSwap, BakerySwap, and BurgerSwap, whose pools accommodate BEP-20 tokens.


Liquidity Pools vs. Order Books

To understand the differences in liquidity pools, let’s first look at the basic building block of electronic trading: the order book. In simple terms, the order book is a collection of currently unfilled orders in a particular market.

The system for matching orders is called a matching engine, which, together with the order book, forms the core of a centralized exchange (CEX). This model has been very effective in promoting efficient trading and supporting the creation of complex financial markets.

However, DeFi transactions involve executing trades on-chain, with no centralized party holding funds. Problems arise when order books are involved. Each interaction with the order book requires a gas fee, which increases the cost of executing trades.

This also makes the work of market makers (traders who provide liquidity for trading pairs) expensive. On top of that, most blockchains have limited throughput and cannot handle billions of dollars in transactions per day.

This means that on-chain order book transactions are almost impossible to implement in blockchains like Ethereum. Users can use sidechains or Layer 2 solutions, but they are currently in the development stage and the network is still unable to handle the current throughput.

Before we go on, it’s worth noting that there are indeed decentralized exchanges with on-chain order books that work well. Binance DEX is based on Binance Chain and is designed for fast and low-cost transactions. Another example is the Serum project based on the Solana blockchain.

Even so, a large portion of assets in the cryptocurrency space are concentrated on Ethereum and cannot be traded on other networks unless a cross-chain bridge is used.


How do liquidity pools work?

Automated Market Makers (AMMs) are a game changer. They are a major innovation that enables on-chain trading without the need for an order book. There is no direct counterparty when executing trades, and traders can open and close positions on token pairs with very low liquidity on order book trading platforms.

You can think of order book trading as peer-to-peer trading, where buyers and sellers are connected through an order book. For example, trading on the Binance decentralized exchange is peer-to-peer, with trades taking place directly between user wallets.

Trading with AMMs is different, you can think of it as peer-to-peer contracts.

As mentioned above, the liquidity pool is a group of funds deposited by liquidity providers into smart contracts. When users execute transactions in AMM, there is no counterparty in the traditional sense, but instead the liquidity of the liquidity pool. When the buyer buys, there is no need to trade with the seller, and the transaction can be completed as long as there is sufficient liquidity in the pool.

When buying the latest food tokens on Uniswap, there is no traditional counterparty (i.e. seller), instead there is an algorithm that manages the activity of the pool. The transaction price is determined by this algorithm based on the transactions in the pool. For a deeper understanding of how this works, please read our AMM article.

Of course, liquidity must come from somewhere, and anyone can be a liquidity provider. In a sense, these people can be considered your counterparties. However, unlike the order book model, here you are interacting with the smart contract that manages the pool of funds.


What is the purpose of the liquidity pool?

So far, we have mainly discussed AMMs, which are the most popular application of liquidity pools. However, as mentioned earlier, pooling liquidity is a very simple concept with many use cases.

One of them is yield farming (also known as “yield farming” or “liquidity mining” in English). Liquidity pools are the basis of platforms that automatically generate returns (such as yearn). Users add funds to the pool and automatically receive returns.

Distributing new tokens to the right users is a difficult problem for cryptocurrency projects. Liquidity mining is one of the more successful methods. Basically, users add their tokens to a liquidity pool, which distributes exclusive tokens to users based on an algorithm. Then, the newly minted tokens are distributed to users according to their share of the pool.

Keep in mind that these tokens can even be tokens of other liquidity pools, called pool tokens. For example, if you provide liquidity to Uniswap, or lend money to Compound, you will receive a certain number of tokens representing your share of the pool. You can deposit these tokens in another pool to earn a yield. These chains can get quite complex, as protocols can integrate other protocols' pool tokens into their own products, and other such operations.

We can think of governance as a use case. In some cases, the threshold of token votes required to make formal governance proposals is high. By pooling funds together, participants can collectively support the same proposals they agree on.

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

Another more cutting-edge use case for liquidity pools is tiering. This is derived from traditional finance, where financial products are graded according to risk and return. As you might expect, these products allow liquidity providers to choose a customized risk and return combination.

Minting synthetic assets in the blockchain also requires the support of a liquidity pool. Add collateral to the liquidity pool and connect it to a trusted oracle to create synthetic tokens anchored to any desired asset. This is relatively complicated in practice, but the basic principle is that simple.

What other use cases can you think of? There are more use cases for liquidity pools to be discovered, and it all depends on the innovation of DeFi developers.


➟ Want to start your digital currency journey? Buy Bitcoin on Binance now!


Risks of Liquidity Pools

If you provide liquidity to an AMM, you need to be aware of the concept of “impermanent loss.” Simply put, when a user provides liquidity to an AMM, the asset incurs a loss measured in USD value compared to holding it for the long term.

If you provide liquidity to an AMM, you may face impermanent loss. Such losses can be large or small. If you want to invest your funds in a two-way liquidity pool, be sure to read our article first.

Another thing to pay attention to is the risk of smart contracts. After depositing funds into the liquidity pool, the funds are closely linked to the pool. From a technical point of view, there is no middleman holding the user's funds, but the contract itself can be regarded as the custodian of the funds. If there is a loophole in the contract or it is attacked by a flash loan, the user may lose the funds forever.

Also, be wary of projects where developers have the power to change the governance rules of the fund pool. Developers sometimes have admin keys or other privileges that allow them to access smart contract code. This provides them with opportunities to do bad things, such as controlling the funds in the fund pool. Please read our DeFi scam article to stay away from "runaway" scams.


Summarize

Liquidity pools are one of the core technologies of the current DeFi technology stack. They enable decentralized trading, lending, yield generation, and more. These smart contracts enable almost every aspect of DeFi, and are likely to continue to do so in the future.

Do you have any other questions about liquidity pools and decentralized finance? Visit Ask Academy, our Q&A platform, where members of the Binance community will patiently answer your questions.