Understanding How Crypto Liquidity Pools Work.
What are Liquidity Pools? How do they work? And why do we even need them in decentralized finance? Also, what are the differences between liquidity pools across different protocols such as Uniswap, Balancer, or Curve? We’ll be going through all of this in this article.
Before we start, if you’re new to DeFi you may want to read my introduction to decentralized finance article first.
Liquidity pools, in essence, are pools of tokens that are locked in a smart contract. They are used to facilitate trading by providing liquidity and are extensively used by some of the decentralized exchanges a.k.a DEXes.
One of the first projects that introduced liquidity pools was Bancor, but they became widely popularised by Uniswap.
Before we explain how liquidity pools work under the hood and what automated market making is, let’s try to understand why we even need them in the first place.
Why Do We Need Liquidity Pools?
If you’re familiar with any standard crypto exchanges like Coinbase or Binance you may have seen that their trading is based on the order book model. This is also the way traditional stock exchanges such as NYSE or Nasdaq work.
In this order book model buyers and sellers come together and place their orders. Buyers a.k.a. “bidders” try to buy a certain asset for the lowest price possible whereas sellers try to sell the same asset for as high as possible.
For trades to happen, both buyers and sellers have to converge on the price. This can happen by either a buyer bidding higher or a seller lowering their price.
But what if there is no one willing to place their orders at a fair price level? What if there are not enough coins that you want to buy? This is where market makers come to play.
In essence, market makers are entities that facilitate trading by always willing to buy or sell a particular asset. By doing that they provide liquidity, so the users can always trade and they don’t have to wait for another counterparty to show up.
Okay, so why can’t we just reproduce something like this in decentralized finance?
The answer is – we can! It would just be really slow, expensive, and pretty much always result in poor user experience.
The main reason for this is the fact that the order book model relies heavily on having a market maker or multiple market makers willing to always “make the market” in a certain asset. Without market makers, an exchange becomes instantly illiquid and it’s pretty much unusable for normal users. On top of that, market makers usually track the current price of an asset by constantly changing their prices which results in a huge number of orders and order cancellations that are being sent to an exchange.
Ethereum with a current throughput of around 12-15 transactions per second and a block time between 10-19 seconds is not really a viable option for an order book exchange. On top of that, every interaction with a smart contract cost a gas fee, so market makers would go bankrupt by just updating their orders.
How about the 2nd layer scaling then? Some of the 2nd layer scaling projects like Loopring look promising, but even they are still dependant on market makers and they can face liquidity issues. On top of that, if a user wants to make only a single trade they would have to move their funds in and out of the 2nd layer which adds 2 extra steps to their process.
This is exactly why there was a need to invent something new that can work well in the decentralized world and this is where liquidity pools come to play.
How Do Liquidity Pools Work?
Ok, so now that we understand why we need liquidity pools in decentralized finance, let’s see how they actually work.
When a new pool is created, the first liquidity provider is the one that sets the initial price of the assets in the pool. The liquidity provider is incentivised to supply an equal value of both tokens to the pool. If the initial price of the tokens in the pool diverges from the current global market price, it creates an instant arbitrage opportunity that can result in lost capital for the liquidity provider. This concept of supplying tokens in a correct ratio remains the same for all the other liquidity providers that are willing to add more funds to the pool later.
Each token swap that a liquidity pool facilitates results in a price adjustment according to a deterministic pricing algorithm. This mechanism is also called an automated market maker (AMM) and liquidity pools across different protocols may use a slightly different algorithm.
The main takeaway here is that the ratio of the tokens in the pool dictates the price, so if someone, let’s say, buys ETH from a DAI/ETH pool they reduce the supply of ETH and add the supply of DAI which results in an increase in the price of ETH and a decrease in the price of DAI. How much the price moves depends on the size of the trade, in proportion to the size of the pool. The bigger the pool is in comparison to trade, the lesser the price impact a.k.a slippage occurs, so large pools can accommodate bigger trades without moving the price too much.
Because larger liquidity pools create less slippage and result in a better trading experience, some protocols like Balancer started incentivizing liquidity providers with extra tokens for supplying liquidity to certain pools.
The concepts behind liquidity pools and automated market-making are quite simple yet extremely powerful as we don’t have to have a centralized order book anymore and we don’t have to rely on external market makers to constantly keep providing liquidity to an exchange.
Different Types of Liquidity Pools
The liquidity pools that we just described are used by Uniswap and they are the most basic forms of liquidity pools. Other projects iterated on this concept and came up with a few interesting ideas.
Curve, for example, realized that the automated market-making mechanism behind Uniswap doesn’t work very well for assets that should have a very similar price, such as stable coins or different flavors of the same coin, like wETH and sETH. Curve pools, by implementing a slightly different algorithm, are able to offer lower fees and lower slippage when exchanging these tokens.
The other idea for different liquidity pools came from Balancer that realized that we don’t have to limit ourselves to having only 2 assets in a pool and in fact Balancer allows for as many as 8 tokens in a single liquidity pool.
Helpful? Useful? Enlightening?
Please consider making a small donation to CoinTutor.org. Any little bit helps the articles keep coming and the forums running. Pick a coin below, donate, and Thank You!
Donate Bitcoin to this address
Scan the QR code or copy the address below into your wallet to send some Bitcoin
Donate Ethereum to this address
Scan the QR code or copy the address below into your wallet to send some Ethereum
Donate Tether to this address
Scan the QR code or copy the address below into your wallet to send some Tether
Donate Cardano to this address
Scan the QR code or copy the address below into your wallet to send some Cardano
Donate Xrp to this address
Scan the QR code or copy the address below into your wallet to send some Xrp
Donate Polkadot to this address
Scan the QR code or copy the address below into your wallet to send some Polkadot
Donate Litecoin to this address
Scan the QR code or copy the address below into your wallet to send some Litecoin
Donate Dogecoin to this address
Scan the QR code or copy the address below into your wallet to send some Dogecoin
Donate Usdcoin to this address
Scan the QR code or copy the address below into your wallet to send some Usdcoin
Donate Monero to this address
Scan the QR code or copy the address below into your wallet to send some Monero