What are liquidity pools? The ultimate guide to DeFi mechanics - Empirica (2024)

What are liquidity pools? The ultimate guide to DeFi mechanics - Empirica (1)

GM! And welcome back to the Empirica Blog. Today we will dive deeper into the topic of liquidity pools & their importance in the operations of automated market makers.

Liquidity pools are a mechanism based on smart contracts that regulate the token ratio in the pool and allow market participants to exchange ERC-20 tokens without any counterparties.

TL;DR: The whole space is running on liquidity pools. Without them, the instant money transfers you know from Uniswap would be almost impossible.

  1. Do you know how they ACTUALLY work?
  2. What are MEV attacks & how can you protect yourself from them?
  3. And what’s the role of liquidity pools in many important web3 projects?

All of that (and more) is in the newest article. Let’s dive deeper into the rabbit hole.

Check here for details on how ourmarket makers helping crypto projects

Table of contents

  1. How do liquidity pools work?
  2. What’s the role of liquidity pools in DeFi?
  3. Why is deep liquidity essential for the blockchain startup?
  4. Liquidity pools vs yield farming – the incentive formula for DeFi
  5. Liquidity pools vs crypto security: what are sandwich MEV attacks?

1. How Do Liquidity Pools Work?

Let’s start from the beginning. Have you ever been wondering how the liquidity pools actually work? We mean, the coins you get doing the swap on Uniswap have to come from somewhere. That’s where the liquidity pools hit the floor. They are the base of DeFi, allowing market participants to successfully buy & sell crypto assets and providing the liquidity to cash out (or buy).

Liquidity pools vs order book formula

If you want a benchmark for liquidity pools, let’s take an example of centralized exchanges: when you buy BTC for USD on Binance, you need the second part of the transaction. The users can place the buy order (which makes it to the order book), and when the seller appears (selling BTC at a price request by you), you get crypto, and the other side gets fiat.

What are liquidity pools? The ultimate guide to DeFi mechanics - Empirica (2)

Liquidity pools allow crypto market participants to trade without waiting for the counterparty of the transaction because this role takes liquidity providers that are incentivized to “share” their cryptocurrencies as liquidity.

Liquidity Pools & Automated Market Makers

Moreover, liquidity pools are the base for the model of conducting transactions in the world of decentralized finance. It’s called AMM – automated market maker – which means the whole market-making process is now automated.

What’s the mechanism behind liquidity pools?

From the one side, there is the pool provided by the blockchain project itself and filled with liquidity by liquidity providers, aka DeFi Farmers, which simply are crypto-market participants who want to earn interest on their tokens). On the other side, we have traders. Now, let’s take an example:

  1. When a trader wants to conduct a sell transaction, she relies on the liquidity pool provided by the blockchain project and DeFi farmers.
  2. If the token A is sold, the amount of A is increased in the pool, and the amount of B is reduced (because the ultimate state of valuation is always a 50/50 ratio)
  3. When token A is bought, there are fewer A tokens in the pool and more B (the ratio of the token amount is changed, but the value will stay at 50/50).

The whole process is automated and regulated by the math algorithm.

Let’s take an example of the Uniswap V3 mechanism. The market depth is calculated using this formula: m (δ) = 1 s i0X +d(δ) i=i0 λx(i) + p −1 0 λy(i).

Each type of transaction or in-protocol operation has rules that, at the end of the day, regulate the token ratio in the pools and provide the proper functioning of the market. The liquidity provider gets LP tokens that represent his share in the pool. LP tokens will be the basis for calculating the value of the tokens when the liquidity provider decides to withdraw the assets. Learn more about the mechanism behind LP tokens here.

(If you are interested in reading more about the math processes, read this document from Uniswap)

So in summary what are the liquidity pools?

These are tokens locked in a smart contract (called a pool). The whole amount is divided into 2 different crypto assets: for example, 50% of the token is paid in USDC, and 50% in the token of your protocol. If the initial value of the pool is set for $300k, you need $150k USDC and $150k in your token.

2. What’s The Role of Liquidity Pools in DeFi?

The entire crypto space is running on liquidity pools. No matter which protocol you take as an example, they exist there, providing a possibility to conduct transactions for the crypto market participants.

The role of the liquidity pool is to:

  • allow your users the possibility of trading (buying and selling) the tokens
  • facilitate the trading process
  • increase the speed of financial exchange

But let’s get back to the main topic: the main benefit of a liquidity pool is the drawback of the centralized exchanges and NFT Market.

Most Liquid Pools 2023 on Uniswap V3– Report by Empirica Liquidity Lab –

3. Why is Deep Liquidity Essential For The Blockchain Startup?

Now, let’s take an example from real life and put having deep liquidity pools into context.

Some founders still do not understand how low liquidity can negatively affect the price of their token.

So let us explain: as you read above, the liquidity pool formula is about regulating the token ratio in the pool due to the current market supply and demand for the token.

If you have high liquidity, there is no problem: anyone can make even big orders(and the price won’t react that much).

The problem is when massive sell pressure appears (during the FED meeting about interest rates, for example), and the holders will instantly start selling.

It might lead to a situation in which the price of the token falls much more than in the case of adequately deep pools of liquidity.

Why is that?

Because lower liquidity leads to higher price volatility.

For example, if there is $1M in tokens in the liquidity pool, and the user conducts a sell transaction for $100k, the price will drop by around 10%.

If the liquidity is around $10M, the $100k sell order will take down the price only by around 1%.

As the crypto space is one of the most volatile financial markets on Earth, during the panic-selling events, the capitalization of core crypto assets drops twice or more as stocks, not to mention the low-cap coins.

Such moments sometimes appear in history, especially when the recession is around the corner. That is why it is worth understanding how the liquidity mechanism works to prepare for a price crash potentially.

4. Crypto Liquidity Pools vs Yield Farming – The Incentive Formula For DeFi

Liquidity is one of the few things that matter in crypto. Without it, your token holders won’t be able to trade. But as a startup founder, most often, your liquidity is limited to what you raised from investors. So if you attract the DeFi farmers (independent investors, providing liquidity) and make them provide liquidity for the broad group of traders, the potential of increasing the liquidity depth would be unlimited.

That’s what yield farming is – people provide their cryptocurrencies for crypto/crypto or stablecoin/crypto pools, so the token’s price can be less volatile, even under large transactions.

But they aren’t doing it for free. The liquidity-providing activity is incentivized by the crypto protocols. It works in such a way: when crypto market participants have free funds and want to earn interest on them, they can deposit their crypto assets to the smart contract and get paid for it.

It first started in 2020, when Synthetix – one of the pioneer DeFi protocols, established an incentive mechanism that became one of the key catalysts for the DeFi Summer.

Later, we had Compound, which is a protocol that started to distribute COMP tokens to liquidity providers. This formula of paying users to transfer their stablecoins to Compound began a new era of DeFi when protocols competed with each other to offer the highest APY (annual percentage yield), thus achieving liquidity from DeFi farmers.

However, this mechanism is not bullet-proof:

5. The Main Drawback of Yield Farming & Liquidity Mining

The truth is, as long as you give the tokens as rewards, you will have liquidity providers with you. When the financial incentive (in the form of tokens) is gone, the liquidity providers are also gone.

Such a phenomenon is called mercenary capital and stands for the money in the crypto space from investors focused on short-term profits.

Why is that important?

As you read before, liquidity is king. If the depth of the protocol’s liquidity is not stable (and even worse, dependent only on the financial incentive), we enter the dangerous ground.

Because financial incentives cannot last constantly – they have to decrease in time (most often the incentives are planned only for the first months of operations to increase the interest in the protocol).

Without changing the incentive program (and most often, lowering the liquidity mining APRs), the price of the token will quickly decrease because of the selling pressure from DeFi farmers – if the only incentive is to earn money, providing liquidity is a pure business and the farmers will dump the tokens.

That’s why addressing the point of deep & low liquidity is that crucial. In the beginning, each project needs to define what will be its idea to attract liquidity – if it’s based only on financial incentives, the token price will dramatically decrease over a longer period of time.

6. Liquidity Pools vs Crypto Security: What Are MEV Sandwich Attacks?

And last but not least, the MEV Sandwich attacks (an on-chain example can be find here)

What are these?

Attacks from the hackers that “sandwich” the whole process between 3 transactions (hacker’s txn – victim’s txn – hacker’s txn).

You can see that during 3 consecutive transactions on the same token.

What does the process of MEV attacks look like?

What are liquidity pools? The ultimate guide to DeFi mechanics - Empirica (4)

First, the hacker seeks a victim and then makes a transaction. His (or her) goal is to increase the exchange rate on a given token trading pair (i.e.XYZ / ETH).

To do it, the bot buys the token before the real user (onchain example).

Then, the victim pays more for the digital asset (XYZ) than it usually would.

The outcome: the victim gets less ETH (onchain example).

Then, the hacker has to reverse the transaction and sell XYZ for the higher price.

How is that possible?

First, the attacker buys the token before the victim and pumps up the price. Then, the victim buys the token and pumps the price even more. In the end, the attacker sells the token at a higher exchange rate.

It can happen during the DEX swap or a lending operation.

To make such an operation, hackers code the bots and most often use protocols like Aave to maximize capital efficiency and use stablecoins to increase the price of a particular asset.

Why are we talking about MEV attacks?

They can appear during all kinds of DeFi operations.

To protect your community (and yourself) from the sandwich attacks:

  • use CowSwap – an MEV-proof automated-market-maker DEX
  • set the low slippage on DEXs (you can custom it)

It’s also good to increase awareness of the MEV attacks because 99% of crypto investors still do not know what they are and how not to suffer from them.

Bottom Line

Thanks for your time! If you found this interesting, share the article on Twitter and show your friends that web3 is a great space.

See you in the next article!

Check here for details on how we build organic liquidity for crypto projects

Related posts:

How To Get a Job in Web3? Top Crypto and DeFi Jobs in 2023Generated by AIA Job in Market Making – a Brief GuideAMM – Automated Market Maker – its role and examplesUniswap Market MakerToken liquidity – how can crypto projects handle it right?LP tokens: what are liquidity provider tokens and how they work?

What are liquidity pools? The ultimate guide to DeFi mechanics - Empirica (2024)

FAQs

What are liquidity pools? The ultimate guide to DeFi mechanics - Empirica? ›

Liquidity pools are a mechanism based on smart contracts that regulate the token ratio in the pool and allow market participants to exchange ERC-20 tokens without any counterparties.

What are liquidity pools in DeFi? ›

A liquidity pool is a collection of crypto held in a smart contract. The purpose of the pool is to facilitate transactions. Decentralized exchanges (DEXs) use liquidity pools so that traders can swap between different assets within the pool.

Are DeFi liquidity pools safe? ›

Depositing your cryptoassets into a liquidity pool comes with risks. The most common risks are from DApp developers, smart contracts, and market volatility. DApp developers could steal deposited assets or squander them. Smart contracts might have flaws or exploits that lock or allow funds to be stolen.

What are DeFi mining pools? ›

Liquidity mining is a DeFi mechanism where users provide their crypto token holdings to decentralized exchanges (DEXs) and receive liquidity pool tokens (LP tokens). The LP tokens are then used to calculate a reward based on the fees accumulated by the pool which is divided among all the LP token holders.

How do you make money from liquidity pool? ›

Liquidity pools are collections of funds that are locked in an exchange to facilitate trading of tokens without third parties. They allow you to provide liquidity and earn fees from the trades that occur in the pool. To provide liquidity you need two tokens that will be exchanged for one another in the pool.

What happens when a liquidity pool dries up? ›

Liquidity pools drying up

Because various users worldwide supply liquidity, the amount of liquidity can change as people pull their tokens from the pool. Low liquidity leads to higher slippage, meaning people will receive less money than expected when selling their tokens into the pool.

Is DeFi liquidity mining legit? ›

These new scams, using fraudulent decentralized finance (DeFi) applications, are an evolution of the “liquidity mining” scams we uncovered in 2022 marrying the script for fake romance and friendship perfected by past pig butchering operations with smart contracts and mobile crypto wallets.

What are the downsides of liquidity pools? ›

Some common vulnerabilities and risks associated with liquidity pools include: Impermanent Loss: Impermanent loss occurs when the price of the assets in the liquidity pool changes relative to the price outside of the pool. Liquidity providers can experience financial losses when withdrawing their assets.

Can you lose your coins in a liquidity pool? ›

Impermanent loss occurs when the price of a token rises or falls after you deposit it in a liquidity pool. It indicates a loss when the dollar value of your token at the time of withdrawal is less than the amount deposited.

What are the disadvantages of liquidity pools? ›

One of the main risks is impermanent loss, which occurs when the price of one token in the pool changes significantly compared to the other token. This can result in liquidity providers losing value compared to holding the tokens on their own.

What is an example of a liquidity pool? ›

Each liquidity pool usually contains a specific pair of cryptocurrencies for other DEX users to trade against. For example, DEX customers looking to trade ether (ETH) for USD Coin (USDC) will need to locate an ETH/USDC liquidity pool on the platform.

How does a liquidity pool work? ›

Liquidity pools are crypto smart contracts in DEXs that replace traditional order book trading. They're funded by users (liquidity providers) who earn fees and LP tokens. LP tokens represent a provider's share in the pool and can be used for additional earnings through liquidity mining.

How to start a liquidity pool? ›

How to Create a Liquidity Pool
  1. Choose two coins or tokens that will form a trading pair.
  2. Specify the necessary amounts of both coins/tokens. ...
  3. Check the initial prices for each direction, make sure the proportions are correct.
  4. Press 'Create' and confirm the transaction.

What is the most profitable liquidity pool? ›

Pools Decentralized Exchange
PoolTVLCurrentAPR30D Period
1 J W JONES / WETH 0.5% Camelot V2 • Arbitrum$1.49M0.24%
2 W E WETH / EMC 0.3% Camelot V2 • Arbitrum$1.34M4.95%
3 G A GRAIL / ARB 0.5% Camelot V2 • Arbitrum$700.23K--
4 B W Boop / WETH 0.3% Camelot V2 • Arbitrum$588.36K48.53%
21 more rows

What are the fees for liquidity pools? ›

Liquidity providers may initially create pools at three fee levels: 0.05%, 0.30%, and 1%.

What is better staking or liquidity pool? ›

Liquidity pools maintain equilibrium and adjust for token prices during volatile market conditions. If users decide to withdraw their assets when token prices have deviated from their time of deposit, impermanent loss becomes permanent. Staking, however, is not subject to any kind of impermanent loss.

What is the difference between liquidity pool and staking? ›

Liquidity pools maintain equilibrium and adjust for token prices during volatile market conditions. If users decide to withdraw their assets when token prices have deviated from their time of deposit, impermanent loss becomes permanent. Staking, however, is not subject to any kind of impermanent loss.

How long do liquidity pools last? ›

In most cases, crypto liquidity mining programs run for a predetermined period of time, usually ranging from a few weeks to several months. During this time, users can stake their tokens and earn rewards based on the amount of liquidity they provide.

Top Articles
Latest Posts
Article information

Author: Laurine Ryan

Last Updated:

Views: 5856

Rating: 4.7 / 5 (77 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Laurine Ryan

Birthday: 1994-12-23

Address: Suite 751 871 Lissette Throughway, West Kittie, NH 41603

Phone: +2366831109631

Job: Sales Producer

Hobby: Creative writing, Motor sports, Do it yourself, Skateboarding, Coffee roasting, Calligraphy, Stand-up comedy

Introduction: My name is Laurine Ryan, I am a adorable, fair, graceful, spotless, gorgeous, homely, cooperative person who loves writing and wants to share my knowledge and understanding with you.