Last updated on July 11th, 2023 at 11:18 pm
DeFi has blown up in the past year, and the on-chain activity has been rapidly increasing. The volumes have been so high recently that popular decentralized exchanges like Uniswap can even compete with the volume on some of the centralized exchanges. As of August 2021, there is almost $69 Billion in Total Valued Locked (USD) across DeFi protocols.
You must be wondering, what is the reason for such rapid growth of the niche? While many factors have contributed to the growth of DeFi, one factor that stands out is the number of funds locked in across liquidity pools in different DeFi protocols.
In this article, we will talk about what liquidity pools are and how they work. We will also talk about the importance of liquidity pools in DeFi and some of the risks associated with them.
Let’s dive in.
What Is A Liquidity Pool?
Liquidity pools are a collection of tokens that are locked in a smart contract. By providing liquidity to a platform, they facilitate trading, lending, and allow many other cool DeFi functionalities.
The concept of liquidity pools is mostly used by decentralized exchanges or DEXes in the DeFi ecosystem. It is fair to say that liquidity pools are the backbone of these platforms as, without them, these platforms will essentially have no good reason to even exist.
Liquidity Pools are operated by Liquidity Providers or LPs. LPs are the market participants responsible for creating a liquidity pool by adding an equal value of two tokens in a pool. You must be thinking why would anyone just give their funds to a pool right? Well, the answer is pretty simple. It’s because of the benefits that they get.
By providing liquidity to a liquidity pool, LPs can earn trading fees from all the transactions that take place in their pool. Their cut depends on the proportion of total liquidity they provide to the pool.
Since anyone in the world can become a liquidity provider on any platform in DeFi, DEXes have made the DeFi ecosystem more accessible. While Bancor was one of the first DEXes that introduced the concept of liquidity pools, the use of such pools was widely popularised by Uniswap.
Why Do We Need Liquidity Pools?
If you have invested in crypto, you must be aware that centralized crypto exchanges like Binance or Coinbase allow users to trade on their platform. To facilitate trading, such platforms use the order book model, similar to the model used by TradFi exchanges like the NYSE.
Let’s try and understand how this model works.
Liquidity Pools Vs Order Books
To understand how the concept of liquidity pools is unique, let’s take a look at how trading works in the conventional sense.
Traditional finance exchanges use the concept of order books for trading purposes. An order book is a collection of all the open orders in a market. Using the matching engine system, all the orders in the market are matched and the data is reflected on the order book.
In DeFi, there is no central authority that holds the funds of the users, thus, all the transactions are executed on-chain. This poses a problem for using the order book concept in DeFi as each transaction using the order book requires gas fees, making the trades more expensive.
Moreover, this makes the process of providing liquidity less profitable for LPs. Furthermore, most blockchains that are currently available in the market do not have the capacity to handle the required throughout which would be generated from the billions of dollars in traded volume every day.
The Need For Liquidity Pools In DeFi
In the order book model, buyers and sellers on the platform come together and place their orders on the exchange. Buyers try to buy assets at the lowest possible price whereas sellers try to sell their assets at the highest possible price. For a trade to occur, both buyers and sellers need to agree on the price. This can only happen if either the buyer is willing to bid higher or a seller is willing to sell their assets at a lower price.
Seems fairly simple right? It is, but there’s a catch. What if neither the buyer nor the seller agrees to sell their assets at a ‘fair price’? This is why we need market makers. In TradFi, a central authority acts as a market maker to facilitate trading. These entities are always willing to buy or sell an asset at any price and by doing so, they provide the much-needed liquidity to the platform. In doing so, such entities allow trades to be executed instantly on the platform as neither the buyer nor the seller has to wait for someone to match their price.
So why can’t we just do the same thing in DeFi?
The same concept can be used in DeFi as well, but the system will be inefficient. This is because, in DeFi, there is no central authority that can act as a market maker and will always be willing to “make the market”. As a result, the exchange would become highly illiquid and the trading experience will be very slow and expensive.
Moreover, on TradFi platforms, there is a large number of orders and order cancellations as the market makers are constantly changing their prices to track the current price of an asset. Thus, for a blockchain like Ethereum, using an on-chain order book exchange does not make practical sense. Layer two solutions like Polygon provide an alternative to this but such networks have not yet become mainstream.
However, it is worth noting that there are many DEXes like the Binance DEX that work just fine using the on-chain order book concept. Moreover, blockchains like Solana make it possible for DEXes to enable fast and cheap trading.
How Do Liquidity Pools Work?
Now that we have a better understanding of why we need liquidity pools, let’s take a look at how they actually work.
Any Liquidity Provider can create a new liquidity pool by simply adding 2 tokens. The first LP sets the price of the assets in the pool and other LPs are incentivized to supply more liquidity to the pool by supplying an equal value of both tokens.
The incentive for LPs is LP tokens that they receive in the proportion to the funds they add to the pool. When a trade is executed on their pool, the fee generated is distributed equally among all the LPs of that pool.
Since Automated Market Makers use a deterministic pricing algorithm, each token swap on a liquidity pool results in a price adjustment according to the algorithm. Most liquidity pools use a constant product model which is run on the formula x*y=k where x and y are the tokens of the pool.
What does this imply?
This means that the ratio of the tokens in the pool determines the price. As the quantity increases, the algorithm of AMMs increases the price of the token. This allows pools to always be able to provide liquidity irrespective of the size of the trade.
Let’s look at an example to understand this better.
For instance, a user buys ETH from a USDC/ETH pool. When they do that, the supply of ETH in the pool reduces, and the supply of USDC increases. This results in an increase in the price of ETH and a decrease in the price of USDC.
The extent of the price movement depends on the size of the transaction in comparison to the size of the pool. The larger the pool in comparison to the transaction size, the lesser the price change meaning that there is less slippage offering a better trading experience.
You can also check out our article on yield farming to understand how liquidity mining works.
Different Types Of Liquidity Pools
The liquidity pool mentioned above is the one used by Uniswap. This is how most liquidity pools work and are the simplest kinds of pools to understand. However, many different projects have come up with interesting twists on the conventional liquidity pool concept.
For example, Balancer has liquidity pools with as many as 8 tokens in a single liquidity pool whereas, Curve uses a different algorithm for different pools to offer lower fees and lower slippage wherever possible.
The Risk Of Liquidity Pools
Besides the standard DeFi risks such as smart contract bugs and systematic risks, users must be aware of risks such as impermanent loss and liquidity pool hacks.
In short, the impermanent loss is the loss in value that LPs face when they provide liquidity in comparison to just holding on to their asset.
You can learn more about the impermanent loss in DeFi and how to avoid it.
In Conclusion…
Liquidity pools will lead the way for DeFi to grow in the future. By offering incentives to LPs, liquidity pools are attracting many users to DeFi and explore yield farming.
What are your views on liquidity pools? Have you ever provided liquidity to one?
Let us know in the comments!
If you would like to read more articles like this, follow DeFi Planet on Twitter and LinkedIn.