AbstractKey words
Liquidity pool is one of the basic technologies of the current DeFi ecosystem. They are an indispensable and important component of many applications, such as automated market makers (AMM), lending protocols, liquidity mining, synthetic assets, on-chain insurance, blockchain games, etc.
The concept itself is quite simple, essentially pooling funds 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.
Decentralized Finance (DeFi) has spawned a large number of on-chain activities and promoted decentralization Trading platforms compete with centralized trading platforms for trading volume share. As of December 2020, the locked value of DeFi protocols is close to $15 billion. As new products continue to be introduced, the entire ecosystem continues to grow and develop.
What is the driving force for development? One of the core technologies behind all these products is liquidity pools.
It is a collection of funds locked in a smart contract that is used to facilitate decentralized trading, lending, and more functions discussed below.
Liquidity pools are the backbone of many decentralized exchanges (DEX), such as Uniswap. Users called "liquidity providers (LP)" add two tokens of equal value to the fund pool to create a market. In return, the transaction fees generated in the fund pool will be 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 it wasn’t until Uniswap became popular that the concept attracted more attention. Other popular trading platforms using liquidity pools in Ethereum include: SushiSwap, Curve and Balancer, whose liquidity pools accommodate ERC-20 tokens. Similar platforms on Binance Smart Chain (BSC) include: PancakeSwap, BakerySwap and BurgerSwap, whose pool accommodates BEP-20 tokens.
In order to understand the differences between liquidity pools, Let's first study the basic structure of electronic trading-the order book. Simply put, an order book is a collection of currently unfilled orders in a specific market.
The system for matching orders is called the Matching Engine, which together with the order book form the core of the centralized exchange platform (CEX). This model is effective in promoting efficient transactions and supporting the creation of complex financial markets.
However, DeFi transactions involve executing transactions on-chain and there is no centralized party holding funds. The problem arises when the order book is involved. Each interaction with the order book incurs gas fees, causing the cost of executing trades to rise.
This also makes the work of market makers (that is, traders who provide liquidity for trading pairs) expensive. On top of that, most blockchains have limited throughput and cannot handle billions of dollars of transactions per day.
This means that in a blockchain like Ethereum, on-chain order book transactions are almost impossible to achieve. Users can adopt sidechain or Layer 2 solutions, but they are currently in the development stage and the network is still unable to handle the current throughput.
Before continuing the discussion, it is worth noting that there are certain decentralized trading platforms with well-functioning on-chain order books. Binance DEX is based on Binance Chain and is designed for fast, low-cost transactions. Another example is the Serum project based on the Solana blockchain.
Even so, a large number of assets in the cryptocurrency space are concentrated in Ethereum and cannot be traded on other networks unless a cross-chain bridge is used.
Automated Market Makers (AMMs) have changed the rules of the game. They are major innovations that enable on-chain transactions without the need for an order book. There is no direct counterparty when executing trades, and traders can open or close positions on extremely illiquid token pairs on the order book trading platform.
You can think of order book trading as peer-to-peer trading, where buyers and sellers are connected through the order book. For example, transactions on the Binance decentralized exchange platform use a peer-to-peer method, and transactions are conducted directly between user wallets.
Trading using AMM is different. You can think of it as a point-to-point contract.
As mentioned above, a liquidity pool is a batch of funds deposited into smart contracts by liquidity providers. When users execute transactions in AMM, there is no counterparty in the traditional sense, but instead the liquidity of the liquidity pool. The buyer does not need to deal with the seller when buying, and the transaction can be completed if there is sufficient liquidity in the pool.
When purchasing the latest food tokens on Uniswap, there is no counterparty (i.e. seller) in the traditional sense. Instead, there is an algorithm that manages the activity of the fund pool. In addition, the transaction price is determined by this algorithm based on transactions in the pool. To learn more about how it works, read our AMM article.
Of course, liquidity must have its source, and anyone can become a liquidity provider. In a sense, these people can be considered your counterparties. However, unlike the order book model, what you interact with here is a smart contract that manages the pool of funds.
So far, we have mainly discussed AMM, which is the most popular application of liquidity pools. However, as mentioned earlier, pooled liquidity is a very simple concept with many use cases.
One of them is liquidity mining (English name is "yield farming" or "liquidity mining"). Liquidity pools are the basis for platforms that automatically generate revenue, such as yearn. Users add funds to the capital pool and automatically receive benefits.
Issuing new tokens to the right users is a difficult problem for cryptocurrency projects. Liquidity mining is one of the more successful methods. The basic operation is that users add their tokens to the liquidity pool, which distributes exclusive tokens to users based on algorithms. The newly minted tokens will then be distributed to users based on 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 funds to Compound, you will receive a certain number of tokens that represent your share of the pool. You can earn income by depositing these tokens into another pool. These chains can get quite complex, as protocols can integrate other protocols’ pool tokens into their own products, and whatnot.
We can think of governance as a use case. In some cases, the token voting threshold required to make a formal governance proposal is high. By pooling funds, participants can collectively support the same proposal that they endorse.
Another emerging DeFi sector is insurance to deal with smart contract risks. Many of its implementations are also powered by liquidity pools.
Another more cutting-edge use case for liquidity pools is grading. It originates from the traditional financial field and classifies financial products according to risk and return. As you might expect, these products allow liquidity providers to choose custom risk and reward combinations.
Minting synthetic assets in the blockchain also requires the support of a liquidity pool. Add collateral to a liquidity pool, connect it to a trusted oracle, and create synthetic tokens anchored to any asset of your choice. This can be relatively complicated in practice, but the basics are that simple.
What other use cases can you think of? More use cases for liquidity pools remain to be discovered, and everything depends on the innovation capabilities of DeFi developers.
➟ Want to start a digital currency journey? Buy Bitcoin on Binance today!
If you provide liquidity to AMM, you need to pay attention to "impermanence" The concept of "loss". Simply put, when users provide liquidity to an AMM, the asset incurs a loss in dollar value compared to long-term holding.
If you provide liquidity to AMM, you may face impermanent losses. Such losses may be large or small. To put money into 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 connected to the pool. From a technical perspective, there is no middleman holding the user's funds, but the contract itself can be considered the custodian of the funds. If the contract has loopholes or is attacked by flash loans, users may lose their funds forever.
In addition, you need to be wary of projects where developers have the right to change the governance rules of the fund pool. Developers sometimes have administrative keys or other privileged access to smart contract code. This provides an opportunity for them to do evil things, such as controlling the funds in the fund pool. Please read our DeFi scam article and try to stay away from "run away" scams.
Liquidity pool is one of the core technologies of the current DeFi technology stack. They enable decentralized trading, lending, revenue generation, and more. These smart contracts can empower 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? Please visit our Q&A platform Ask Academy, where members of the Binance community will patiently answer your questions.