A Brief Introduction to Liquidity Pools & How they Work
In digital markets today, people want to buy and sell assets in exact quantities with instant speeds. This, however, poses a problem since if I want to buy X quantity of an asset, I need to find a seller with X quantity, willing to sell right now. Liquidity pools solve this problem.
Summary
Liquidity pools are a mechanism where people, called stakers, can deposit funds into a smart contract to provide asset liquidity for traders to swap between two currencies. This provides convenience for traders as they no longer need to wait to find someone to match their trade. In return, liquidity pools take a small premium on the trade (typically around 0.3%).
How are Liquidity Pools Created?
Liquidity pools are created on a decentralized exchange to provide liquidity for traders who want to swap between assets.
They are created by groups of smart contracts that operate using a treasury. The treasury is funded through crowdsourcing from people on the internet, called Stakers.
Stakers crowdfund a liquidity pool by depositing equal amounts of two tokens, typically one more volatile asset and one stable asset (ex. $100 USD of DAI and $100 USD worth of ETH) into the protocol. The protocol then acts like a traditional AMM, waiting for people who want to buy and sell between the two tokens.
When a trader wants to swap between the two assets, the liquidity pool is able to facilitate this. In exchange, the liquidity pool will typically take a small transaction fee (usually around 0.3%) for providing that liquidity and convenience to a given user of the DEX (decentralized exchange).
In this way, it generates income for the fund, which is then returned proportionally to the stakers in a given pool.
The way the protocol works is that in return for equal amounts of each token, the depositor receives LP tokens (Liquidity Pool tokens) which represent their share of the pool. The amount of LP tokens someone receives is determined using this ratio:
The value of your LP tokens can be derived from the following formula:
When a liquidity pool gets a commission from facilitating trade, it returns the comission to the centralized treasury. This increases the value of the LP tokens since the value of the liquidity pool has increased, but the total number of tokens stays the same.
Risk in Liquidity Pools — Understanding Impermanent Loss
The way a liquidity pool is structured is to contain a 50:50 split in the value of tokens, denominated in a common currency. For example, given a $200 Liquidity pool of ETH and DAI, at any given moment, $100 will be held in ETH and $100 will be held in DAI.
Now, say the value of our ETH goes up to $150, creating an imbalance in the ratio (now we have $100 in DAI and $150 in ETH). The liquidity pool, will then automatically sell off $25 in ETH to buy $25 in DAI, re-balancing the pool to $125 worth of ETH and $125 worth of DAI.
On the other hand, if the value of our ETH goes down, it means the pool will sell off DAI to buy more ETH, again, rebalancing the pools.
This process is known as “impermanent loss” and has two key properties.
1. As the price of ETH goes up, our potential upside goes down since we continuously sell the asset, as it rises, to rebalance the pool. In other words, the higher the price of ETH, the less exposure we have to it, so the less you benefit from its increase in value.
2. As the price of ETH goes down, our potential downside goes up as well. Say the price of ETH drops to $50. This means the liquidity pool would actively start selling off DAI in order to buy more ETH, buying as the price goes down. Now, imagine a hypothetical world where the value of ETH falls close to $0. In this case, the pool would sell off almost all its DAI to balance things out again. In essence, you’re selling off your more valuable stable coin to buy a lot of an almost worthless currency.
Note: While this is an unlikely situation for ETH, this happened with the price of a Titan in Titan liquidity pools. Mark Cuban suffered a loss when this happened and was public about the incident. You can find out more about what happened here.
Okay, so what can we take away?
If the price goes up, then your potential upside goes down.
If the price goes down, you buy less of a valuable asset, i.e. your potential downside goes up.
This suggests that you would lose the least when the two assets are stable. So by putting money in a liquidity pool, you’re effectively betting on the price of the two tokens being relatively stable, over the timeline you are staking.
Now, there’s some nuance to this idea.
The reason this risk is called “impermanent loss” is because the loss on your assets is not permanent until you actually withdraw from the liquidity pool, at which point it becomes “permanent”. Until you withdraw from the pool, your net investment is never realized to your wallet, so all loss is “impermanent”.
Some more advanced liquidity pools will also provide the option of automatically removing your contributions to the pool if the price at which your assets entered the pool goes too far from where they started. This limits your exposure to the pool when an asset is volatile. That said, in the event that your exposure is reduced, you can also expect to receive fewer rewards since you will have been exposed to a fewer number of transactions.
For more on Impermanent Loss.
How does a Liquidity Pool Buy and Sell?
It is easy to make the assumption that a liquidity pool would price assets based on market value. This, however, isn’t true. Liquidity pools actually price based on the ratio of the two currencies in a given pool.
As a result, a liquidity pool may often list the price of an asset below market value. This creates an arbitrage opportunity for traders, where they can buy up all of an asset from a liquidity pool below market value, and resell to the market, taking an immediate profit for themselves. This is a loss of value for the pool.
Generally speaking, however, the transaction fees that a pool accumulates will outweigh the losses of selling to arbitrage traders below market value, providing a positive yield to stakers who lock up their assets in the pool.
How do I put money into a Liquidity Pool?
Most liquidity pools today are hosted on Decentralized Exchanges. Users can stake their tokens on a platform like Balancer, Curve, or Uniswap. Here’s a tutorial of doing this on Uniswap:
Some remaining questions you might have?
Why do Liquidity pools have a 50/50 split across two assets?
By maintaining a 50/50 balance, Liquidity pools are keeping themselves agile enough to handle swapping either way between the assets, depending on which way the market goes. It also enables effective pricing mechanisms since the price that a Liquidity pool interacts with the market is determined by the ratio of the assets. If it was a 70/30 split, it would change the ratio and create a significant divergence from what a traditional pool would list at.
Do Centralized Exchanges use Liquidity Pools?
Centralized exchanges do not use liquidity pools.
Instead of hosting liquidity pools to provide liquidity for their users, a centralized exchange, such as Gemini, may choose to pay a trading firm like Jane Street, to have their employees trade on the Gemini platform. Because a company like Jane Street trades in such high volumes, this offers liquidity to the other users of Gemini, replacing the role of a liquidity pool, but also securing Gemini more revenue in Jane Street’s trading fees.
Are Liquidity Pools used on the Stock Market?
The stock market has a slightly different setup to provide liquidity to traders. While a liquidity pool is decentralized and crowdsourced to create enough funds to provide liquidity, on the stock market, a large centralized entity will buy up lots of a security and play the same role. These large centralized entities are called Mark Makers. When their function is automated by a computer, they are called AMMs or Automated Mark Makers.
Final Note:
Hope you enjoyed the quick intro. Feel free to email me with any questions at satvikagnihotri12@gmail.com. Also, always remember to do your own research, and don’t take this as investment advice.
Contact Me
Interested in more about me? Check out my LinkedIn, Newsletter, and Twitter.