DeFi, or decentralized finance, has managed to create a complete explosion of on-chain activities. DEX volumes can compete meaningfully with the total volume on the centralized exchanges. There are nearly $15 billion of value completely locked in decentralized finance-backed protocols as of December 2020.
Currently, the ecosystem is expanding rapidly with multiple products. But what is making such an expansion possible? One of the basic technologies behind these products happens to be the liquidity pool. If you have never heard about this term, then you have arrived at the right destination.
Simply put, it’s one of the foundational technologies that work behind the existing DeFi ecosystem – sound interesting, right? Stay tuned to find out more.
So, What Is A Liquidity Pool?
A liquidity pool is basically a collection of funds that are locked within a smart contract. These are used for facilitating decentralized lending, trading, and several functions that we can explore later.
These happen to be the backbone of multiple DEX (decentralized exchanges) like Uniswap. Users known as LP or liquidity providers add a similar amount of two tokens within a pool in order to develop a market. In exchange for giving their funds, they actually earn trading fees, and that too from the different trades that happen inside their pools, completely proportional to their primary share of the liquidity.
Since anyone can become an LP, AMMs have contributed to making markets more accessible.
Perhaps one of the very first protocols to utilize liquidity pools was Bancor. However, the concept started gaining much more attention once Uniswap became more popular. Then, there are some well-known exchanges that utilize liquidity pools on Ethereum. These are Balancer, Curve, and SushisSwap.
Liquidity pools in such venues include ERC-20 tokens. You will also find similar equivalents on the BNB chain, such as BurgerSwap, BakerySwap, and PancakeSwap, where these pools include BEP-20 tokens.
How Do Liquidity Pools Work?
Automated market makers have now changed this entire game. They are basically a significant innovation that enables on-chain trading without the basic requirement to oder a book.
Since there is no direct counterparty required for executing trades, any trader can easily get in as well as out of position on token duos. This would likely be highly illiquid on the order book exchanges.
You can think of such an exchange as basic peer-to-peer, where purchasers and sellers are easily connected by an order book. For instance, trading on the Binance DEX happens to be peer-to-peer since trades take place between user wallets directly.
Trading with the help of an AMM is very different. You can think of the same as a peer-to-peer contract on an AMM.
A liquidity pool is basically a bunch of funds that liquidity providers have deposited into a smart contract. When you are executing any trade on any AMM, you will not have a counterparty in the conventional sense.
Instead, you are implementing the trade against the pool’s total liquidity. For a buyer to purchase, there does not need to be any seller at that specific moment, just enough liquidity within the pool.
When you are purchasing the recent food coin located on Uniswap, there is no seller literally on the other side in the conventional sense. Instead, your activities will be managed by the algorithm responsible for governing what actually happens in the liquidity pool.
Additionally, costing is determined by this particular algorithm depending on the trades happening in the pool.
Obviously, the liquidity needs to come from a spot. And anyone can become an LP. So, you could view them as your counterparty. But for the order book model, it’s not the same since you are engaging with that particular contract governing the pool.
Liquidity Pools Versus Order Books:
To determine what’s so different about liquidity pools, let’s check out the primary electronic trading building blocks – the order book. To simplify things, the order book can be defined as a collection of recently opened orders for any given market.
The system matching orders with one another is known as the matching engine. Apart from the matching engine, the order book happens to be at the center of centralized exchanges. This is a great model to facilitate efficient exchange, enabling the development of complicated financial markets.
Decentralized finance trading, however, includes implementing trades on-chain. This takes place without any centralized party actually holding the funds. This presents a major problem when it becomes all about the order book since each engagement demands gas fees. This makes it so much more costly for executing trades.
Also, it makes the job of most market makers and traders providing liquidity to trading duos extremely expensive. Most importantly, a majority of blockchains cannot handle the needed throughput in order to trade thousands of dollars regularly.
This indicates that on an Ethereum-like blockchain, any on-chain order book exchange is impossible practically. You could use layer-two or sidechain solutions while these are on your way. However, the network is not able to handle the actual throughput while it is in its current format.
It is also worth noting that there are multiple DEXs that work in sync with on-chain order books. For example, Binance DEX has been built on the BNB Chain – it’s designed specifically for cheap and quick trading. Another example happens to be Project Serum, which is being developed on the Solana blockchain.
Despite the same, since most assets in the cryptocurrency industry are literally on Ethereum, you cannot trade the same on any other network unless you utilize some type of cross-chain bridge.
The Risks Associated With Liquidity Pools:
If you decide to provide liquidity to any AMM, you will have to be familiar with a concept known as impermanent loss. In brief, it is a loss in terms of dollar value as compared HODLing when you are giving liquidity to any AMM.
If you provide liquidity to any AMM, you are probably exposed to impermanent loss. Sometimes, it’s huge, and at times, it can be tiny.
Another risk in this context is the smart contract risk. When you do deposit funds into any liquidity pool, they stay in the pool. So, while there are no middlemen technically holding your funds, the smart contract itself becomes the custodian of the same funds.
If there’s a bug or even some type of exploit through some kind of flash loan, for instance, your funds can also be lost forever.
And It’s A Wrap!
Liquidity pools are known as one of the foundational technologies behind the whole decentralized finance or DeFi trading stack. They allow decentralized lending, trading, yielding, and so much more. These are the smart contracts powering nearly every percentage of DeFi. At the same time, they are most likely to continue doing the same.