paint-brush
The Anatomy of a Crypto Liquidity Pool by@victorfabusola
636 reads
636 reads

The Anatomy of a Crypto Liquidity Pool

by Victor FabusolaApril 11th, 2023
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Liquidity pools are one of the most important technologies powering the crypto ecosystem. They are an essential part of the DeFi protocols suite, and a lot of the innovation in crypto would be impossible without them. A liquidity pool is a collection of assets locked in a protocol mediated by a smart contract.
featured image - The Anatomy of a Crypto Liquidity Pool
Victor Fabusola HackerNoon profile picture


Liquidity pools are one of the most important technologies powering the crypto ecosystem. They are an essential part of the DeFi protocols suite, and a lot of the innovation in crypto would be impossible without them.


In a literal sense, a liquidity pool is precisely what the name implies. It's a fund to which people can add their crypto assets. In a way, it's sort of like a community box where users deposit their assets to. The big difference between this community box and a liquidity pool is what the pool can be used for, and the rules surrounding how people can use the pool.

What Is a Liquidity Pool?

Unsplash


A liquidity pool is a collection of assets locked in a protocol mediated by a smart contract. These pools are very important in DeFi and are critical to the running of decentralized exchanges.


The liquidity — or the assets — that are added to the pool are added by entities known as liquidity providers. These providers usually have a financial incentive to provide this liquidity to the pool and are rewarded when they do.


The liquidity pool itself serves as a sort of bank for users who want to trade. Say, for example, a trader wants to bet on the future of a crypto asset. Perhaps the trader believes that a particular asset would appreciate by 20% of its value and would like to bet on that through a futures contract. This contract may stipulate that the trader can buy the asset at its present price in the next month. If the asset appreciates as the trader believes, then he would be able to purchase it at a discount. If it doesn't and perhaps depreciates, then the trader will buy it at a loss.


However, to make that contract, the trader needs someone on the opposite side. It's not easy for traders to organize this contract themselves, so the liquidity pool does it for them.


In traditional finance (TradFi), this role is taken on by the stock market and it's aggregated by something called an order book. An order book is a record of all the buy and sell orders on the market, and a system called a matching engine matches these orders together. That's why someone who wants to sell 20 of X stocks always finds a buyer for it instantly.


In DeFi, the liquidity pool takes the role of the stock market in traditional finance. It's "the house" that people place to sell or buy orders against. Since the pool has the funds to enter into these contracts, it's the perfect tool for executing these orders.


What’s in It for Liquidity Providers?

For liquidity providers, the incentives to add liquidity to these pools come in the form of rewards. These rewards are called yields, and they are the interests that accrue on assets that are locked in the liquidity pool's smart contracts. These rewards could also be in the pool's governance tokens.


As long as liquidity providers continue to see a good reason to provide enough liquidity to the pool, the pool will continue to act as a market for traders. That's why liquidity providers must always have the right incentives to deposit assets and not have any barriers to doing so.


Asides from governance tokens and yields, liquidity providers may also have a share in transaction fees on the pool. When traders interact with a liquidity pool, they usually pay certain transaction fees. Providers who have liquidity in that pool may be entitled to a share of these transaction fees.

How Does a Liquidity Pool Work?

Liquidity providers who want to add assets to a liquidity pool are often unable to add just one asset. Theoretically, it should be possible for users to simply add the asset they have to the pool and farm yield off it, but that's not how it always works.

Trading Pairs

Most liquidity pools only accept deposits via an arrangement called trading pairs. This means that the liquidity provider has to deposit an equal value of two assets into the pool. For example, users who want to deposit assets into a pool that contains the trading pair ETH/USDT will have to deposit an equal amount of USDT and ETH into the pool.


If a liquidity provider wants to deposit $10,000 worth of assets, the ETH being deposited would have to be worth $5,000 and the USDT would have to be worth $5,000 as well.


For example, on Uniswap, liquidity providers have a choice between any pair of ERC-20 tokens. However, each pair of tokens has different characteristics and providers might have to analyze their pros and cons carefully before choosing a pair. The app also allows users to choose a price range their assets are allocated. This means that liquidity providers themselves can customize their own "stop loss" procedure by dictating what positions their assets should be deployed against.


Another liquidity pool that insists on trading pairs for liquidity provision is Balancer. Balancer is sort of a hybrid in this respect as it allows users to provide liquidity in both trading pairs and single assets.

Single Assets

Today, the biggest liquidity pools on the market insist that users depositing assets must do it via trading pairs. While this has its benefits, it makes providing liquidity somewhat cumbersome. It means that users are exposed to loss in their principal assets if one of the assets has a drastic change in price. This loss is usually referred to as impermanent loss.


Thankfully, there are some liquidity pools, like Caviarswap, that allow user providers to deposit liquidity in a single asset class. This creates better capital efficiency and allows liquidity providers to earn yield and other such rewards quite easily. It also means that liquidity providers are not exposed to impermanent loss as they would with other pools like Uniswap.


Another liquidity pool that allows users to stake through single tokens is Bancor. On Bancor users contribute only one asset to the pool, and all the exposure they have is only to that asset.

Conclusion

It's safe to say that without liquidity pools, DeFi would certainly not have been the permissionless environment it does today. Liquidity pools are the reason why people can trade without necessarily handing over custody of their assets to a "mediator". With liquidity pools, the mediator is a smart contract, and the smart contract is indifferent. It will always execute itself according to the terms agreed upon and will never go back on its word.


However, the fact that liquidity pools are entities sustained by smart contracts means that providers who interact with them must be careful too. Some contracts can be changed after the fact, and there are ample opportunities for fraud when interacting with them. As always, users in crypto should be aware and be very careful before signing any smart contract.