What is a Liquidity Pool and how does it work (2024)

In this article I will explain (by giving many examples) how a Liquidity Pool works, its advantages and risks. Uniswap is definitely home to Liquidity Pools, but it’s certainly not the only place. Recently it is possible to find excellent liquidity pools also on DEXs (decentralized exchanges) on WAX, such as Alcor and Taco Swap!

Imagine a Liquidity Pool as a large vessel that holds two types of tokens. For example we could create a Liquidity Pool which contains EOS and WaxP; or WaxE and Ether, or WaxP and TLM... Anyone will be able to add or swap tokens from our Liquidity Pool, and does not have to ask our permission: there is a smart contract that takes care of regulating all incoming and outgoing flows.

What is a Liquidity Pool and how does it work (2)

There are only three ways to interact with a classic Liquidity Pool: add liquidity, swap tokens, remove previously added liquidity.

ADD LIQUIDITY TO A POOL

“Add liquidity” means “add tokens to the pool”. There is only one rule: you can only add tokens in the same proportion as the current between the 2 tokens. Let’s take an example: if there were 200 WAX and 100 EOS in the pool, the proportion WAX:EOS would be 2 : 1 . So you could add 2 WAX and 1 EOS, or 4 WAX and 2 EOS, or even 1 WAX and 0.5 EOS, but not 3 WAX and 1 EOS

What is a Liquidity Pool and how does it work (3)

NOTE: After adding liquidity, the proportion of tokens in the pool has not changed

SWAP TOKENS IN A POOL

“Swap tokens” means “exchange a token for another”. This functionality is the real reason why Liquidity Pools were invented: allowing users to exchange one token for another without having to trade with other users, but only interacting with a smart contract! Also this time there is only one rule: in a swap you will receive as many tokens so that the product between the quantities of the two tokens after the exchange is equal to the product before the exchange.

Let’s take an example: suppose the Liquidity Pool contains 24 WaxP and 12 EOS (the product of which equals 288). If we put 4 EOS in the pool, we will receive exactly 6 WaxP in return: in fact, 12+4=16 EOS and 24–6=18 WaxP will remain in the pool, and 18 times 16 still equals 288!

What is a Liquidity Pool and how does it work (4)

NOTE: after doing a swap, the proportion of tokens in the pool changed (in the example before the swap it was 2:1 while after the swap it became 1.125:1)

- REMOVE LIQUIDITY FROM A POOL

This is the tricky part, which most people struggle to understand. “Remove liquidity” simply means “withdrawing your tokens from the pool”: the problem is that they won’t be exactly the same as you added! This is due to the fact that, as we have seen, each swap changes the proportion between the two tokens present in the pool. So how do you calculate the exact amount of tokens you will get by removing liquidity? Every time someone adds liquidity, the smart contract gives them new tokens in exchange (this does not happen in swaps). When someone wants to remove liquidity, he returns these tokens and receives a certain amount of the initial two tokens, again in the same proportion of the current pool.

Let’s take an example: the Liquidity Pool contains 200 waxP and 100 EOS, and cumulatively those who provided this liquidity received 10 Liquidity Pool tokens (let’s call them W|E tokens, “WaxP|EOS” tokens)

What is a Liquidity Pool and how does it work (5)

Now suppose that Lisa arrives and wants to add liquidity: she adds 20 waxP and 10 EOS (the ratio of the pool was 2:1, as well as that of the tokens she added). Lisa added 10% of the pool: since the liquidity providers had 10 W|E tokens, she will receive W|E tokens equal to 10% of the existing ones, i.e. 1 token. Now the total W|E tokens are 11, and the Pool contains 220 WaxP and 110 EOS.

What is a Liquidity Pool and how does it work (6)

Suppose Marc arrives now and wants to swap 22 WaxP: the smart contract that manages the pool will take his 22 WaxP and give him 10 EOS in exchange; now in the pool there are 100 EOS and 242 WaxP (in fact before his arrival the product of the tokens was 220x110 = 24200, and after his swap… 100x242 = 24200)! The W|E tokens remain the same as before, 11, because Marc didn’t add liquidity.

What is a Liquidity Pool and how does it work (7)

Now suppose Lisa wants to remove all of her liquidity. Lisa gives back her W|E token; the smart contract knows that there are a total of 11 W|E tokens, so it gives Lisa back exactly one eleventh of the entire current pool! So 242 : 11 = 22 WaxP and 100 : 11 = 9.09 EOS. If you remember Lisa had given 20 WaxP to 10 EOS when she provided liquidity, and now she has returned 22 WaxP (2 more) and 9.09 EOS (almost 1 less)

What is a Liquidity Pool and how does it work (8)

Note that:

  • if Lisa had removed her liquidity before Marc made a swap she would have got her initial tokens back, 20 WaxP and 10 EOS
  • Lisa could also have removed only a portion of the liquidity provided, not all

Providing liquidity to a pool has one big advantage: every time someone uses the pool to make a swap, they pay a small surcharge (which depends on the pool; usually it’s 0.3%). This fee is immediately added to the pool, then split among all those who previously had added liquidity in proportion to their share. In practice, with each swap the pool increases a little, and when someone removes liquidity they’re getting a portion of all that addition too!

So providing liquidity only has advantages? Unfortunately not! As we saw in the previous example, the tokens obtained when liquidity was removed are not in the same proportion as the tokens given when liquidity was provided. And it almost always happens that their value in dollars is lower than the starting one. To understand why, let’s go back to our example, this time calculating the value of tokens in dollars. Suppose 1 WaxP is worth $5 and 1 EOS is worth $10: the Liquidity Pool contains the same amount of dollars in WaxP ($1000) and EOS ($1000). Lisa adds liquidity by pooling 20 WaxP and 10 EOS, or $200.

What is a Liquidity Pool and how does it work (9)

Now suppose that the dollar price of EOS rises from $10 to $15, while that of WaxP remains $5. Marc knows that if he swaps his 22 WaxP the pool will give him 10 EOS (as in the previous example): he will gladly do it, because 22 WaxP is still worth $110 while 10 EOS is now worth $150, and he’ll be earning $40 in no time doing the swap!

What is a Liquidity Pool and how does it work (10)

Now suppose that the dollar price of WaxP and EOS no longer changes, and Lisa decides to remove her liquidity. As always, she will return his W|E token and in exchange she will receive an eleventh of the pool, i.e. 22 WaxP and 9.09 EOS. Well, it’s time to do the math! What if Lisa, instead of putting her 20 WaxP and 10 EOS in the pool, had initially HODL (kept) them?

What is a Liquidity Pool and how does it work (11)

As you can see, there is no good news: if Lisa had kept her tokens she would now have $250, while providing liquidity and then removing it has less money, $236.5! To be precise, she would have some more money, because Marc paid a small commission (not counted) by making the swap; in any case, it would have been better for Lisa to keep her own tokens, rather than providing liquidity. This is called impermanent loss: it is not a real loss (in fact Lisa previously had $200, now she has more, $236.5) however it is a loss compared to holding her initial tokens (which would now be worth $250)

Absolutely not! Participating in a liquidity pool is often advantageous compared to keeping your own tokens, because the fees paid by those who use the liquidity pool to make swaps continue to add up, and after a while they become greater than the impermanent loss! Without going into too much detail, we can say that adding liquidity to a pool is all the better the more:

  • the pool is used for swaps
  • the price of the two tokens in dollars changes in a similar way (both go up in value, or both go down in value)
  • liquidity is left for longer before removing it

Conversely, providing liquidity is impractical when:

  • few swaps are made using the pool
  • the dollar price of the two tokens changes very differently
  • there is little time before having to remove liquidity

My Cloud Wallet | Official WAX Discord | The defi channel | WAX Twitter | My Twitter | WAX Whitepaper

What is a Liquidity Pool and how does it work (2024)

FAQs

What are liquidity pools and how do they work? ›

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.

What is an example of a liquidity pool? ›

Examples of Popular Liquidity Pools

The pool maintains a fixed product of tokens. As an example, say you deposit 1 BTC and 16 ETH, the pool will always maintain this product of tokens. The total value of ETH will always equal the total value of BTC. Constant Sum: This is also known as a Balancer pool.

What is liquidity and how does it work? ›

Liquidity refers to the efficiency or ease with which an asset or security can be converted into ready cash without affecting its market price. The most liquid asset of all is cash itself.

How do you make money from liquidity pool? ›

A typical liquidity pool rewards users for staking their digital assets in a pool. The rewards can be in the form of cryptocurrency rewards. They can also be a part of the trading fees from exchanges where the pooling of the assets takes place.

Is it safe to invest in liquidity pools? ›

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 the benefits of creating a liquidity pool? ›

Efficiency: Liquidity pools simplify the trading process by providing trade liquidity, reducing the time and complexity involved in matching buyers and sellers in an order book system.

How do you identify liquidity pools? ›

Precise identification of liquidity pools is the key. This can be done using advanced market analysis tools like Bookmap and its features like order flow analysis and heatmaps. Once identified, traders must manage risks carefully by using stop-loss orders and adjusting position sizes.

How do you calculate liquidity pool? ›

For one, in v2 the liquidity of a pool and the liquidity of a position are conceptually the same, the L = sqrt(x*y) formula works for both. The liquidity of a position is uniform in the range [p_a, p_b] , and zero for prices outside of this range.

Do stocks have liquidity pools? ›

Dark pools of liquidity are private stock exchanges designed for trading large blocks of securities away from the public eye. These trading venues are called "dark" because of their complete lack of transparency, which benefits the big players but may leave the retail investor at a disadvantage.

What is the best example of liquidity? ›

Liquidity describes your ability to exchange an asset for cash. The easier it is to convert an asset into cash, the more liquid it is. And cash is generally considered the most liquid asset. Cash in a bank account or credit union account can be accessed quickly and easily, via a bank transfer or an ATM withdrawal.

How do liquidity funds work? ›

Liquid funds refer to investments that can be easily converted into cash without significant loss in value, offering high liquidity and typically investing in short-term securities like treasury bills and commercial paper.

Is liquidity good or bad? ›

Liquidity is neither good nor bad. Everyone should have liquid assets in their portfolio. However, being all liquid or all illiquid can be risky. Instead, it's better to balance assets with your investment goals and risk tolerance to include both liquid and illiquid assets.

How do you lose money in 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.

What is a liquidity pool for dummies? ›

A liquidity pool is a collection of assets where a liquidity provider can deposit his assets to be used by the platform. The structure of a liquidity pool can be different on different platforms. For example: A lending platform uses a single asset pool where a pool consists of one asset only.

Can you withdraw from liquidity pool? ›

Select or search for a liquidity pool you'd like to withdraw liquidity from. In the "Withdraw Liquidity" panel, enter the amount of tokens you would like to withdraw from the liquidity pool (or use the slider!) and click “Withdraw Liquidity” at the bottom.

How do liquidity pools stay balanced? ›

At the heart of crypto liquidity pools is the concept of constant product market makers (CPMMs). These algorithms maintain a balanced ratio between the assets in the pool, ensuring reliable pricing and minimizing slippage—a measure of price deviation during trades.

How are liquidity pool fees paid? ›

Fees are collected by burning liquidity tokens to remove a proportional share of the underlying reserves. Since fees are added to liquidity pools, the invariant increases at the end of every trade.

What are liquidity pools strategy? ›

Liquidity pools are typically composed of two or more assets that are paired together in a specific ratio, such as 50% ETH and 50% DAI. The ratio is maintained by an automated market maker (AMM) algorithm, which adjusts the price of the assets in the pool based on the relative supply and demand.

How does liquidity pool farming work? ›

Farms are a way to further incentivize liquidity providers by offering additional rewards. They work like this: liquidity providers deposit their LP tokens into a farm, which is a collection of smart contracts. While those LP tokens are in the farm, they entitle the holder to earn additional rewards.

Top Articles
Telling Your Kids You Cannot Afford Something. StepChange
ORS News2Use - Registered vs Certified Mail Understanding USPS Special Services
Use Copilot in Microsoft Teams meetings
NOAA: National Oceanic & Atmospheric Administration hiring NOAA Commissioned Officer: Inter-Service Transfer in Spokane Valley, WA | LinkedIn
Bild Poster Ikea
Fat Hog Prices Today
Celebrity Extra
50 Meowbahh Fun Facts: Net Worth, Age, Birthday, Face Reveal, YouTube Earnings, Girlfriend, Doxxed, Discord, Fanart, TikTok, Instagram, Etc
Volstate Portal
Steve Strange - From Punk To New Romantic
Does Pappadeaux Pay Weekly
Turbocharged Cars
Urban Dictionary Fov
The Rise of Breckie Hill: How She Became a Social Media Star | Entertainment
Used Wood Cook Stoves For Sale Craigslist
Nier Automata Chapter Select Unlock
Slushy Beer Strain
8 Ways to Make a Friend Feel Special on Valentine's Day
Craigslist Edmond Oklahoma
Joann Ally Employee Portal
Halo Worth Animal Jam
Best Transmission Service Margate
Slim Thug’s Wealth and Wellness: A Journey Beyond Music
3Movierulz
Dmv In Anoka
Bayard Martensen
Mini-Mental State Examination (MMSE) – Strokengine
Imagetrend Elite Delaware
Vip Lounge Odu
Dentist That Accept Horizon Nj Health
Citibank Branch Locations In Orlando Florida
Egg Crutch Glove Envelope
Utexas Baseball Schedule 2023
Jambus - Definition, Beispiele, Merkmale, Wirkung
De beste uitvaartdiensten die goede rituele diensten aanbieden voor de laatste rituelen
October 31St Weather
Mohave County Jobs Craigslist
Nancy Pazelt Obituary
Lcwc 911 Live Incident List Live Status
Janaki Kalaganaledu Serial Today Episode Written Update
Best Restaurants West Bend
Fool's Paradise Showtimes Near Roxy Stadium 14
2024-09-13 | Iveda Solutions, Inc. Announces Reverse Stock Split to be Effective September 17, 2024; Publicly Traded Warrant Adjustment | NDAQ:IVDA | Press Release
Fatal Accident In Nashville Tn Today
Avatar: The Way Of Water Showtimes Near Jasper 8 Theatres
Tlc Africa Deaths 2021
15 Best Places to Visit in the Northeast During Summer
Willkommen an der Uni Würzburg | WueStart
Gear Bicycle Sales Butler Pa
Kidcheck Login
Nkey rollover - Hitta bästa priset på Prisjakt
Factorio Green Circuit Setup
Latest Posts
Article information

Author: Jamar Nader

Last Updated:

Views: 5944

Rating: 4.4 / 5 (55 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Jamar Nader

Birthday: 1995-02-28

Address: Apt. 536 6162 Reichel Greens, Port Zackaryside, CT 22682-9804

Phone: +9958384818317

Job: IT Representative

Hobby: Scrapbooking, Hiking, Hunting, Kite flying, Blacksmithing, Video gaming, Foraging

Introduction: My name is Jamar Nader, I am a fine, shiny, colorful, bright, nice, perfect, curious person who loves writing and wants to share my knowledge and understanding with you.