MECHANICS OF LIQUIDITY POOLS IN CRYPTO

Mechanics of Liquidity Pools in Crypto

PUBLISHED: 2025-01-25


Liquidity pools are vital to the decentralized finance (DeFi) sector, functioning as the backbone for transactions on decentralized exchanges (DEXs) by eliminating the need for traditional financial intermediaries.

This article explores the mechanics, benefits, and inherent risks associated with liquidity pools, offering insights into how they operate, their advantages over conventional systems, and the critical considerations for those looking to participate in this evolving financial landscape.

BY MIKHAIL ZOLOTOV · PHD · DR., AMIN REZAIE


Basic understanding of Liquidity Pools

Crypto liquidity pools play an essential role in the decentralized finance (DeFi) ecosystem — in particular when it comes to decentralized exchanges (DEXs). Liquidity pools are a mechanism by which users can pool their assets in a DEX’s smart contracts to provide asset liquidity for traders to swap between currencies. Liquidity pools provide much-needed liquidity, speed, and convenience to the DeFi ecosystem.

Before automated market makers (AMMs) came into play, crypto market liquidity was a challenge for DEXs on Ethereum. At that time, DEXs were a new technology with a complicated interface and the number of buyers and sellers was small, so it was difficult to find enough people willing to trade on a regular basis. AMMs fix this problem of limited liquidity by creating liquidity pools and offering liquidity providers the incentive to supply these pools with assets, all without the need for third-party middlemen. The more assets in a pool and the more liquidity the pool has, the easier trading becomes on decentralized exchanges.

Difference between MM and AMM

In financial markets such as foreign exchange markets, stock markets, bond markets, there needs to be some mechanism for providing liquidity so that trade in the asset can take place. Liquidity in cryptocurrency markets essentially refers to the ease with which tokens can be swapped to other tokens (or to government issued fiat currencies).

One way a market achieves liquidity is through the use of order books, like in a stock market. Here buyers and sellers of an asset place orders: they specify a price and quantity of the asset that they would like to buy or sell, as the case may be. An exchange, such as a stock exchange, then matches buy and sell orders to establish a price for the asset.

An alternative way to provide liquidity is through the use of a market maker, an agent who stands ready to buy and sells certain assets at all times, thereby providing liquidity to the market. In DeFi, there exist centralized exchanges, such as Binance (which is a firm), that act as market makers. However, one of the exciting new aspects of DeFi is the replacement of a centralized market maker with a decentralized counterpart. So, instead of using a centralized exchange like Binance to swap tokens, you can use a decentralized exchange (DEX) like Uniswap.

Centralized exchanges in the cryptocurrency ecosystem that implement an order book system carry over all the problems of centralization in traditional finance, which can make them unattractive. However, decentralized order books have been found to be expensive to implement on a blockchain.

Why Are Crypto Liquidity Pools Important?

Any seasoned trader in traditional or crypto markets can tell you about the potential downsides of entering a market with little liquidity. Whether it’s a low cap cryptocurrency or penny stock, slippage will be a concern when trying to enter — or exit — any trade. Slippage is the difference between the expected price of a trade and the price at which it is executed. Slippage is most common during periods of higher volatility, and can also occur when a large order is executed but there isn't enough volume at the selected price to maintain the bid-ask spread.

This market order price that is used in times of high volatility or low volume in a traditional order book model is determined by the bid-ask spread of the order book for a given trading pair. This means it’s the middle point between what sellers are willing to sell the asset for and the price at which buyers are willing to purchase it. However, low liquidity can incur more slippage and the executed trading price can far exceed the original market order price, depending on the bid-ask spread for the asset at any given time.

Liquidity pools aim to solve the problem of illiquid markets by incentivizing users themselves to provide crypto liquidity for a share of trading fees. Trading with liquidity pool protocols like Bancor or Uniswap requires no buyer and seller matching. This means users can simply exchange their tokens and assets using liquidity that is provided by users and transacted through smart contracts.


the mechanics behind lps

Liquidity pools operate on a relatively simple principle but power complex financial interactions. They are not limited to DEXs only and serve as a foundational backbone for various DeFi use cases.

  1. Liquidity Providers (LPs) are users who deposit pairs of tokens into the poo. Typically, that’s equal value, but it can also have different values depending on the model underlying the smart contracts. For example, an ETH/USDC pool would require depositing equal values of USD of both Ethereum and USDC.
  2. Automated Market Makers (AMMs) are the underlying smart contracts that use mathematical formulas to determine asset prices and facilitate trades. The most famous one is Uniswap’s constant product formula (x * y = k), which maintains balance in the pool. With new models, those formulas have been upgraded to serve other functions.
  3. Other types of Liqudity Pools do exist in DeFi, serving, for example, lending protocols and NFT projects. While not necessarily using the AMM model, these protocols are still considered liquidity pools where users earn rewards for depositing tokens.
  4. Fees and Rewards: LPs earn a portion of the trading fees generated by the pool. Some protocols also distribute governance tokens or offer yield farming opportunities as additional incentives.

advantages of LPs

Liquidity pools offer several advantages over traditional market-making systems:

  1. Decentralization: Anyone can become a liquidity provider, democratizing market-making.
  2. Continuous Liquidity: Pools enable 24/7 trading without the need for matching buyers and sellers.
  3. Efficient Price Discovery: AMMs automatically adjust prices based on supply and demand within the pool.
  4. Lower Barriers to Entry: New projects can easily create trading pairs and gain liquidity without relying on centralized exchanges.

AMM algorithm

DEXs employ various automated market maker algorithms to make sure the prices of assets held in liquidity pools align with broader market prices. Uniswap, one of the largest decentralized crypto platforms, uses something called a Constant Product Market Maker algorithm.

The formula for the Uniswap algorithm looks like this:

x * y = k

"x" and "y" represent the two paired assets within the pool. "k" equals a constant value that the algorithm maintains by adjusting the prices of each asset in the pool.

The total value of token "x" reserves multiplied by the total value of token "y" reserves must always equal the same value, "k."

Let's say a pool contains two tokens, a newly created token ITR and USDT. Let us look at the example on the left.

The owner of ITR created an initial pool with USDT, placing 20k of ITR token and 10k of USDT. This means that if someone has IRT it can sell these tokens for USDT and visa-versa if someone holds USDT he can swap to IRT. Initially 1 IRT token’s price is 0.5 USDT.

Another important thing is that k will be always = to 2M no matter what happens with the pool, and it is considered constant and is created at the initial stage of the pool.

Now imagine someone has 5k USDT and wants to buy ITR token with these money. In this case LP should change its values but retain the constant. So according the formula trader gets 6.66k of ITR tokens changing the LP to 13.33k/15k ratio, keeping constant at 200M level.

Trader will pay 0.75 USDT for every IRT token because the impact of his 5k USDT is quite significant to the pool. The difference between $0.5 and $0.75 price is called slippage that happens when the impact on price in the liquid pair is great.

In the example below you can see that price impact is the difference between the market price and estimated price due to trade size. It means that if you want to swap 10k of ADA for USDT the price will change only 0.16% while in the second example the impact will be so high that you will make price change of almost 80%.

So, placing large trades in pools with limited liquidity can increase the amount of price slippage a trader induces.

The difference in prices after the trade creates an opportunity for arbitrage traders to lock in lower-risk gains. Here, they can add ETH to the pool and withdraw discounted UNI tokens until prices realign with the broader market. This arbirtrage trading within liquidity pools is what allows decentralized exchanges to operate without the need for a centralized intermediary.


liquidity provision

When token is created the most probable possibility is that token creator creates pools of liquidity so that other people could trade newly created token. As discussed above the most popular LP is the token and USDT on the other half.

However other traders can contribute to LPs with their money and earn some profit for providing liquidity.

Liquidity providers deposit two token pairs into a liquidity pool. Once deposited, they can swap between the tokens and charge a small fee for users who swap using their tokens.

Platforms such as Uniswap, Curve and Balancer are also called AMMs and are a fundamental component of DeFi. They are based on LP tokens necessary to allow platform decentralization and serve customers in a noncustodial way. They do not hold on to users’ tokens, but the automated functions will enable them to be fair and decentralized.

For providing assets like Ether to the pool, liquidity providers receive LP tokens representing their pool share, which will be used to claim any interest earned from transactions. LP tokens are always under the providers’ control, who decide when and where to withdraw their pool share.

Once crypto users decide to invest in LP tokens, they can choose the liquidity pool and start depositing crypto assets to receive LP tokens in return. 

The LP tokens received are in proportion to the amount of liquidity provided, so if a user provides 10% of the liquidity to the pool, they’ll be issued 10% of the LP native tokens in that pool. The tokens will be added to the wallet used for liquidity and can be withdrawn along with interest earned at any time.

Providing liquidity to a centralized platform doesn’t generate LP tokens since the assets deposited are under the platform’s custody. On the other hand, DEXs and AMMs use LP tokens to remain noncustodial.


Risks and Considerations in Liquidity Pools

If we are talking about liquidity providers that do this for some reward, they face major 3 risks that can influence on their liquidity pair and final financial result. Let us examine these risks.

Impermanent Loss 

Impermanent Loss is a significant risk associated with liquidity pools in decentralized finance (DeFi). It refers to the temporary reduction in value experienced by liquidity providers (LPs) when participating in these pools. When the price ratio between two assets in a pool changes, LPs may suffer Loss compared to simply holding the assets. This is caused by the need to rebalance the pool to maintain the desired asset ratio.

To mitigate impermanent Loss, LPs can employ strategies such as impermanent loss insurance, yield farming, or choosing pools with lower volatility. However, it’s crucial to thoroughly analyze the risks and potential rewards before engaging in liquidity pools.

Smart Contract Risks 

Smart contracts, while revolutionary in their ability to automate transactions on the blockchain, come with inherent risks and vulnerabilities. These digital agreements are susceptible to coding errors, leading to unintended consequences and financial losses. Vulnerabilities such as reentrancy attacks, unchecked external calls, and integer overflow can be exploited by malicious actors, compromising the integrity of the contract.

The importance of audits and rigorous security measures cannot be overstated. Regular audits help identify and rectify vulnerabilities, ensuring smart contracts function as intended and minimize the risk of exploits. Implementing robust security measures like code reviews, formal verification, and bug bounties fosters trust and safeguards the decentralized ecosystem.

Volatility and Market Risks 

Volatility and market risks play a significant role in the risk considerations for liquidity pools. These pools, designed to provide liquidity to decentralized finance (DeFi) platforms, are susceptible to price fluctuations that can impact their overall liquidity and risk management strategies. As prices of underlying assets experience volatility, liquidity providers (LPs) may face challenges in maintaining stable liquidity ratios. Sudden price drops can lead to impermanent Loss, eroding the value of LPs’ assets.

To mitigate these risks, LPs employ various strategies like diversifying their portfolios, utilizing hedging techniques, and actively monitoring market conditions. Constant evaluation and adaptation of risk management strategies become imperative to ensure the stability and sustainability of liquidity pools amidst price fluctuations and market uncertainties.


Conclusion

Liquidity pools have emerged as a cornerstone of the decentralized finance (DeFi) landscape, revolutionizing how assets are traded, lent, and managed without the need for traditional intermediaries. By leveraging smart contracts and automated market makers (AMMs), liquidity pools not only facilitate seamless and efficient trading but also democratize access to financial services, bringing investment opportunities to the unbanked and underbanked populations worldwide. 

However, this innovation is not without its challenges. The benefits of providing liquidity are counterbalanced by risks such as impermanent loss, smart contract vulnerabilities, and market volatility. These risks necessitate a cautious approach, where potential liquidity providers must weigh the rewards against the inherent uncertainties of the DeFi market. Strategies like diversification, thorough security audits, and staying informed about market dynamics can help mitigate these risks.

Looking forward, the evolution of liquidity pools and AMMs promises even greater integration and sophistication within the DeFi ecosystem. As technology advances, we can anticipate more robust mechanisms to manage risks, better tools for price discovery, and perhaps even new models that could minimize or eliminate certain types of losses currently experienced by liquidity providers. Liquidity pools are not just a technical innovation but a paradigm shift in how we think about and interact with financial systems, heralding an era of more inclusive, efficient, and transparent financial services.

Disclaimer: This statement does not constitute financial advice. The information provided is for informational purposes only and should not be considered as investment advice. If you require financial advice, please consult with our certified financial consultants who can offer personalized guidance based on your specific financial situation.

#pools #liquidity #crypto #mechanics


COMMENTS • 3


Monique 2025-01-26 | 02:05:02

Nice to read all at once, on Internet all is so broken apart, now I mostly get what it means. However I need to read once again or twice to get it all completely.

Amin Rezaie 2025-01-24 | 23:20:59

Great
Actually I founded it useful, You learned me well. Thank you so much.

James 2025-01-24 | 19:43:07

Impressive, thanks, now it becomes more and more clear of how LPs work. Keep up with good work, wish to see more posts like this one.

Add your comment