Liquidity pools: how does it work?

PointPay
6 min readApr 19, 2022

--

The liquidity pool underpins the current decentralized finance (DeFi) universe. It is an integral part of automated market makers (AMMs), credit and loan protocols, income farming, synthetic assets, on-chain insurance, blockchain gaming, etc.

The concept is simple — put your money into a large digital pool, where others can borrow it. But what do you do with this money? How do you earn interest in it? Let’s take a look at how DeFi brings the idea of liquidity pools to life.

What is a liquidity pool?

A liquidity pool is an aggregate of cryptocurrency tokens locked in a smart contract. Liquidity pools are used to provide decentralized trading, lending, and many other features that we will discuss later.

Many decentralized exchanges (DEXs), such as Uniswap, rely on liquidity pools. Users, called liquidity providers (LPs), add the equal value of two tokens to a pool to create a market. In exchange for lending their funds, they earn a part of trading fees in proportion to their share of the total liquidity. And because anyone can become a liquidity provider, AMMs have made the market more accessible.

Bancor was one of the first protocols to use liquidity pools, but Uniswap popularized the concept.

Other popular exchanges that use Ethereum liquidity pools include SushiSwap, Curve, and Balancer. The liquidity pools on these platforms include ERC-20 tokens. The 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 order book’s fundamental building block of centralized exchange (CEX). The order is a collection of current orders for a particular market. The system that matches the orders is called the matching engine. Together with the matching mechanism, the order book is the heart of any CEX. This model is excellent for enabling efficient trading.

However, in Decentralized Finance (DeFi), trades are executed online without the funds being stored centrally, so there is no order book. Every interaction with the order book requires a gas fee, making it much more expensive to execute trades. Furthermore, it also makes the operation of market makers (MM) — participants that support market liquidity and depth to trading pairs — extremely costly. What’s more, most blockchains cannot handle the bandwidth required to trade billions of dollars daily.

Some DEXes work great with the on-chain order book, such as the Serum project built on the Solana blockchain. But for blockchains like Ethereum, an on-chain order exchange is next to impossible. You can use a sidechain or second-layer solution. But as it stands now, the network can not handle the bandwidth.

How does the liquidity pool work?

Automated Market Makers (AMMs) have changed the game. They represent a significant innovation that enables on-chain trading without maintaining an order book. An exchange with an order book can be a peer-to-peer platform where buyers and sellers are connected via an order book.

AMM trading is a completely different matter. You can think of AMM trading as peer-to-contract. As mentioned earlier, a liquidity pool is a collection of funds contributed to a smart contract by liquidity providers. When you make a trade on AMM, you do not have a counterparty in the traditional sense. Instead, you make a trade against the liquidity in the liquidity pool. For a buyer to buy, there does not have to be a seller at the moment, just enough liquidity in the pool.

When you buy a digital asset on Uniswap, there is no seller in the traditional sense. Instead, your actions are driven by an algorithm that controls what happens in the pool. The pricing of assets on DEXes is also determined by this algorithm based on the transactions that take place in the pool. Of course, liquidity has to flow somewhere, and anyone can be a liquidity provider. But that’s not the same as the book model because you interact with the pool’s contract.

What are liquidity pools used for?

AMM is the most popular use case for liquidity pools. However, liquidity pooling is a very simple concept that can be applied in many different ways.

  • One way is yield farming or liquidity mining. Liquidity pools are at the heart of automated revenue generation platforms, such as farms, where users put their funds into pools and then generate revenue.
  • Distributing new tokens to users is an extremely difficult problem for crypto projects. One of the most successful approaches is liquidity mining. The bottom line is that tokens are distributed among users who have deposited tokens into the liquidity pool according to an algorithm. Newly generated tokens are distributed in proportion to each user’s pool share.
  • Another use case is governance. Sometimes, many token votes are needed to make a formal proposal for governance. When token votes are pooled, participants can agree on issues they think are important to the protocol.
  • Another emerging DeFi sector is smart contract risk insurance. Many of the options are also based on liquidity pools.
  • The liquidity pool should be collateralized and then linked to a trusted oracle to create a synthetic token. As a result, you’ll get a token linked to any required asset.

DeFi developers can harness the power of liquidity pools in several ways we have yet to discover.

Key Benefits of liquidity pools

  • Liquidity pools enable decentralized trading and reduce dependence on traditional market makers, who may not always be neutral market participants.
  • Providing liquidity is more beneficial than holding as assets generate passive income, thus giving participants a guaranteed return that they can then reinvest.
  • The reward for providing liquidity is better than nothing when the market moves sideways. They guarantee regular income whenever the markets slow down.

What are the risks of liquidity pools?

The price of assets in the liquidity pool is set by a pricing algorithm that constantly adjusts based on the pool’s trading activity. When the asset price differs from the price on the global market, arbitrage traders who take advantage of these price discrepancies on different platforms profit from this deviation.

Liquidity providers may lose the value of their deposits due to price fluctuations. However, once they withdraw their deposit, the loss becomes permanent. This depends on the amount of price fluctuation and the length of time the provider has placed their deposit. It may be possible to offset some or all of these losses through a transaction fee.

Furthermore, due to the pricing algorithm, small pools may suffer from slippage if someone suddenly wants to place a large trade.

Similarly, DeFi users face other risks, such as smart contract failure if the underlying code is not verified or fully secure. For example, an automated market maker based in China, DODO DEX, reported that hackers broke into several of its version 2 crowd pools on March 8. According to the DeFi Prime service, the attackers withdrew $2.1 million from the protocol.

Conclusion

In the early days of DeFi, DEXs were plagued with a liquidity problem — they were not able to model traditional market makers. A solution came in the form of liquidity pools, which provided a powerful, autonomous solution to liquidity in DeFi. This innovation brought liquidity pools into the spotlight and has been instrumental in unlocking the growth of the DeFi sector.

--

--

PointPay
PointPay

Written by PointPay

Cryptocurrency Ecosystem: pointpay.io Crypto Bank, Exchange, Wallet, Payment System. Buy Bitcoin → https://payments.pointpay.io/ Earn up to 7% yearly with PXP.

No responses yet