What is a Liquidity Pool in DeFi?
Liquidity Pool is a smart contract that contains pools of tokens and coins that are used to provide liquidity to traders. Let's find out how it works.
As financial technology evolves, our banking means also develop continually from the traditional banking system that dates back to the 1960s to the present-day use of digitization. DeFi has played a leaped role in creating more efficient exchange methods. Factors such as decentralization, sustainability, and efficiency have played crucial roles in the evolution of finance.
DeFi has been around for a few years now. The apparent haul to digital assets and the new financial solutions in DeFi have scintillated new interests in Decentralized exchanges (DEX) — giving birth to liquidity pools as one of its components.
The Growth of DeFi
The growth of DeFi has given rise to a revolution in Blockchain — today, Decentralized exchanges can substantially compete with CEX. In early September 2021, DEX's trading volume rose to $23.6B as a reward from DeFi's exponential growth over the years.
Among several components leading to this explosion in DeFi is the Liquidity pool.
What is a Liquidity Pool?
A liquidity pool is like a magic genie that stores and calculates crypto assets in an equilibrium ratio. It's a medium that benefits both traders and investors. Traders get to swap their tokens with another token, and investors get to earn from each trade carried out in the pool.
In other words, a Liquidity pool is a smart contract that contains pools of tokens and coins that are used to provide liquidity to traders; DEXs mainly use it. The platform works on an algorithm that offers trade based on mathematical equations.
One of the first platforms to use liquidity pools is Uniswap. They allow you to trade any ethereum token for any other ethereum token with a minimal transaction fee.
Also, in a case where you might want to trade two entirely different tokens, let's say a basic attention token (BAT) for a graph token (GRT), liquidity pools allow you to do this.
Furthermore, in a situation where you want an asset that is not available in a pair with the asset you wish to trade with, Liquidity Pools perform a series of swaps and allow you to trade your preferred asset. This is often called Routing.
Liquidity Pools vs. Order Books
Pools of tokens have shown a significant difference between the usual trading mode — order books employed by popular exchange platforms such as Coinbase and Binance. It's essential to note that Binance's DEX order books work effectively.
Order books involve the convergence of buyers and sellers to trade. Here, buyers try to place orders for the lowest price possible, whereas sellers sell orders for the highest price. For trades to happen, both buyers and sellers have to agree on a price.
Order price is the heart of CEX (centralized exchanges), and this model is efficient and has shown sustainability over the years.
However, it has some loopholes regarding the availability of assets and price agreement between bidders and sellers.
DEX (Liquidity pools) integrating the method of automatic market makers have eliminated the need to wait for another counterparty to trade.
Order books rely on market makers, and exchange becomes illiquid without market makers, making it unusable for regular users. In DeFi, it leads to poor user experience as it is slow and costly at the same time.
Market makers work by tracking the current price of an asset by constantly changing the price.
For example, the ethereum blockchain processes about 15 trades per second in a chain time of about 17 secs. Order books can't process this — as every transaction costs a gas fee, and market makers will go insolvent just by updating their orders.
However, layer-two solutions have shown great potential over the years, but their throughput still depends on market makers, and they can face liquidity issues.
Also, order books don't allow single trade. To do this, you will have to use a cross-chain bridge process — moving funds in and out to the second layer, which adds extra steps to the process.
This is why the DEX liquidity pool is essential.
How Does a Liquidity Pool Work?
The liquidity pool uses an algorithm that solves the problem of traditional book orders, and it implements the rule of supply and demand into its mathematical calculations.
The pool is formed by the convergence of investors providing liquidity by depositing money into the smart contract. These investors are typically called Liquidity providers.
Asides from being the mainstay of the pool, they provide securities to the market by constantly funding the chain — thereby earning money from transaction fees.
To understand how liquidity pools work, it's essential to understand the concept of its price action. The volume of the liquidity is proportional to the volume of the pool. In other words, the larger the pool size, the smaller the price, and the smaller the pool, the more significant the price impact.
The automated Market Maker algorithm steadily provides liquidity to the system. The ratio of the assets in the Liquidity Pool determines the price and value of assets.
For example, when you buy ETH from the ETH/USDT pool, the pool will have less ETH and more USDT. This pumps the value of ETH and decreases the value of USDT. Here, the liquidity algorithm will calculate the supply of tokens in the pool until it reaches equilibrium with the rest of the market, as a 50:50 ratio has to be maintained for all liquidity.
Also, Suppose the price of ETH goes up in value. In that case, the liquidity pool has to rely on liquidity providers to ensure the pool price matches the conventional market price to ensure an equilibrium value of both assets in the pool.
The Risks of Liquidity Pools
One primary risk attached to the liquidity pool is impermanent loss — losses incurred when the value of the assets is imbalanced.
Another risk attached to the liquidity pool is rug pull. Unlike CEX, listing tokens on DEX is accessible; this gives room for a vulnerability that can lead to manipulation.
Liquidity pools utilizing Automated market makers were invented to replace traditional order books. It's the core of Decentralized exchanges, and it has shown rapid growth in the space of a few years. A lot more is yet to be explored.