Contents
Decentralized finance can be a lot to wrap your head around, even if you know how finance works. For example, how do decentralized exchanges work without an order book? They utilize alternative methods, like automated market makers and liquidity pools. What is a crypto liquidity pool and how does it work? Let us explain it to you!
Key Takeaways
- What are liquidity pools? They are special smart contracts that let automated market makers (AMM) match prices of two assets in a trading pair on a decentralized exchange (DEX).
- How does a liquidity pool work? An AMM calculates the exchange rate in a given token pair with an x * y = k formula, where k is a constant. By swapping x for y, you take out the y token from the pool, causing the smart contract to lock the corresponding amount of the x token and adjust the prices.
- What is liquidity mining? It is an additional mechanism to incentivize liquidity provision for an AMM. Some protocols and DEXs, such as earlier iterations of Uniswap, rewarded liquidity providers with their governance token UNI, ensuring that people who actively contribute to the work of the protocol receive the voting rights to steer its development.
What Is A Liquidity Pool In Crypto?
On traditional exchanges and some cryptocurrency exchanges that take after them, buyers and sellers are matched with an order book. It is a list of prices which buyers are willing to pay for an asset or sellers want to sell the asset for. The more offers there are, the less likely it is for a large order to affect the current market price, and the more liquid the market is.
Although these days order books are automated, they are still managed by the exchange in a centralized manner. They can avail of services of so-called market makers, who improve the liquidity of a given market by placing more buy and sell orders. In traditional markets, it is common for them to monopolize the flow of orders. Things are completely different for decentralized finance (DeFi).
Decentralized exchanges (DEXs) work as platforms powered by multiple public smart contracts instead of being built with proprietary software. As such, market making and liquidity is also handled by smart contracts, automated market makers or AMMs being one of the most common types.
Instead of a centralized order book, AMMs use formulas to regulate the exchange rate in a pair of tokens. Each pair gets a dedicated smart contract, or pool, hence the term liquidity pool.
How Do Crypto Liquidity Pools Work?
Why does a smart contract need to hold a certain reserve of the tokens when a traditional order book does not require it? A DEX and a centralized exchange (CEX) do not work the same, so some explanation of how liquidity pools work is in order.
Since there is no entity like a market maker to fill market orders (when a trader buys or sells an asset at the current market price), an AMM has to have a reserve. If there is an increase in demand for a certain asset, on a traditional exchange the amount of buy orders will increase correspondingly, driving the price up. Sell orders reduce the amount of the other token in the pair, causing the corresponding adjustment.
This reserve is also the basis for the algorithm to accurately price orders so as not to end up emptying the pool. The more you ask from the pool, the more slippage your order will see because it will dig deeper into the reserve. You have two options: adjust the order amount so you get an acceptable rate or pony up and compensate the rest of users for taking the liquidity out.
Automated Market Makers in Action: Uniswap Pools
Crypto liquidity pools are probably best explained with concrete examples. Let’s take a look at Uniswap, which pioneered the x * y = k formula for pricemaking. But first, let’s unpack the formula with a less complex hypothetical.
There exists a market for trading bells for whistles. The perceived exchange rate for them would be 1:1, so the liquidity pool has 50 bells and 50 whistles. However, the actual rate will be decided by the ‘x * y = k’ formula, where ‘x’ and ‘y’ are the amount of bells and whistles in the pool and ‘k’ is a constant (does not change). That would make the ‘k’ constant in this pool 2,500.
If Alice wants to use this market to get 1 bell from this pool, she will need to pay exactly ‘y’ whistles so that ‘k’ remains at 2,500, which is 1.02. However, if she wanted to get 10 bells from it, she would have to part with 12.5 whistles, at the rate of 1.25 a piece. This difference is called slippage.
Why is having more liquidity good? Because if there had been ten times more bells and whistles and the ‘k’ was 250,000, getting 10 bells would have required Alice to provide 10.2 whistles in return, which is a noticeably better rate, and 1.002 bells would convert to 1 whistle, which is quite close to 1:1.
But what is happening with those whistles that Alice puts into the pool? Let’s say Bob is in the market for them, and he gets the other side of the deal. The liquidity pool would underprice whistles to balance the composition, so if Bob bought whistles right after Alice took 10 bells and left the pool with a 40/62.5 ratio, those extra assets would go for 0.8 a piece. Not a bad deal! This is a side effect of low liquidity, because in the ‘k’ = 250,000 scenario, the discounted rate would be closer to 0.98 bell for 1 whistle.
Summing up, the deeper the liquidity, the closer the rates to their intended levels but fewer opportunities for arbitrage. By presenting these opportunities in the first place, liquidity pools close the gaps in their composition and return to the intended balance, while discouraging users from introducing these gaps with less favorable exchange rates.
How Does Uniswap Work?
This is, at least on paper, how the most established in the crypto space DEX, Uniswap works. It is to be expected that in practice, things are slightly more complicated than that.
For one, Uniswap does not exist in a vacuum, and its price curve does not singlehandedly decide the price of assets. Since it’s an algorithm, sometimes it lags behind more centralized entities in responding to outside factors and pricing assets correctly. If conditions in the market at large change suddenly, DeFi arbitrageurs can dig deep into the liquidity pools to snipe assets for their previous prices. They do it at the expense of a pool, leaving it out of balance until the curve catches up. The algorithm takes a small fee for each swap, making sure at least some liquidity stays there, but in extreme cases this can last for a while or at least until liquidity providers turn this into an opportunity.
Who are they? Any user can choose to contribute liquidity to a pool for a fee or other tokens (via so-called liquidity mining or farming) in return. To a DEX, it is a way to deepen liquidity, since regular market makers are unavailable. To these users, this is a method of passive income: assets that sit in a pool as liquidity accumulate trading fees proportionately to the position’s size and time. Earlier versions of Uniswap required liquidity providers to add both tokens in a pool (so the constant is the same and the rates don’t change) but more recent ones added an option to contribute only one kind.
What is Uniswap used for? Of course, you can use it to get cryptocurrencies by swapping and get an experience which is not worse than on a centralized exchange. In fact, a lot of crypto enthusiasts use Uniswap and other DEXs to get the newest tokens without waiting until they appear on CEXs. However, due to generally, not always, lower liquidity, DEXs are favored by traders seeking arbitrage opportunities and generally a more hardcore trading public. As also briefly mentioned, some people use Uniswap and its alternatives as a method to earn extra crypto, though it is risky and hinges on the condition that the value ratio will not change by a lot, plus there will be trading activity to collect fees off of.
Conclusion
Liquidity pools and AMMs are shining examples of how ideas outside of the box in the traditional finance world work in practice. Decentralized finance as a whole is a field where experiments like these are possible, which makes crypto so exciting.
Subscribe to our Telegram, X,and Facebook to not miss out on any crypto news! Explore the crypto world with experts’ insights in our blog.
Frequently Asked Questions
How Does A Liquidity Pool Work?
In simple terms, a liquidity pool consists of two assets and lets users take one of them in exchange for another at a rate that would keep them balanced. If there is a deficit of one asset in a pool, to compensate for it as soon as possible, the price of the other asset (which is in surplus) is discounted.
What Is An Example Of A Liquidity Pool?
Most established decentralized exchanges like Uniswap, Curve, and PancakeSwap, have liquidity pools for each trading pair. An example of a liquidity pool is the smart contract at the Ethereum address 0x99ac8cA7087fA4A2A1FB6357269965A2014ABc35 which governs the Uniswap WBTC/USDT liquidity pool estimated to have $123.9M total value locked (at the time of writing).
Is It Safe To Invest In Liquidity Pools?
You don’t invest in a liquidity pool per se: what you do is lock one of the pair’s tokens or both in a smart contract corresponding to that pool. However, you can receive returns for doing so, in the form of the protocol tokens (in case with Uniswap V2, it is UNI) and others’ trading fees. Providing liquidity in any protocol or pool is inherently risky: for example, risks of impermanent loss if your allocation is out of the price range.
What Is LP In Crypto?
In the crypto context, ‘LP’ can refer to two things. One meaning of the LP abbreviation is ‘liquidity pool’, explained above. Another option is ‘liquidity provider’, either as a person who contributes to a liquidity pool, or LP can mean a source of liquidity for a crypto service.
How Do You Make Money From A Liquidity Pool?
When you put your assets in a liquidity pool, you need to make a transaction that locks both assets in a specified ratio (so you don’t change the constant, although single asset liquidity provision is now available). In return, you will receive a proof of liquidity, in Uniswap’s case special NFTs that can be used to track the value ratio in that pool and accrued fees. If you take out liquidity from the pool, you will also get a portion of trading fees with the assets. This arrangement incentivizes LPs to keep their liquidity in the pool for as long as possible. To turn a profit, the pool has to have decent trading activity and the value ratio should not deviate too much from the point it was at when the liquidity was contributed.
How To Check The Liquidity Of A Crypto?
Technically, liquidity is a characteristic of a market, not an asset, so if you ask how liquid a certain asset is, look at the markets it’s traded in. On traditional and centralized exchanges, it would be evident by the depth of an order book or by tangential qualities, such as volatility. Decentralized exchanges track liquidity in an even more transparent way, by the size of a liquidity pool, which can be viewed with a blockchain explorer. However, this method will not show you liquidity of assets not available in any pool, like Bitcoin.
What Are Crypto Pools?
In crypto, ‘pool’ can refer to a mining pool, where miners put together their computing resources to increase the chances of receiving rewards, or to ‘liquidity pools’, a mechanism that determines exchange rates in decentralized smart-contract-powered markets.