Liquidity Pools 101: What is Price Impact? (2024)

When making swap trades on DEXs, you may have come across a negative number marked in red, labelled as ‘price impact’ on the user interface — and wondered what this all means and why it matters to your trade?

Liquidity Pools 101: What is Price Impact? (2)

In this article, we will be covering succinctly all you need to know fundamentally about price impact.

We can define price impact as :

Price impact is the difference between the market price of an asset and the expected fill price for an incoming trade order.

In other words, price impact measures the influence of the user’s individual trade over the market price of an underlying asset pair.

It correlates directly with :

  • the trade size compared to the amount of liquidity in the Automated Market Maker (AMM) (a.k.a. “pool”) — the more illiquid the markets/pairs, the greater the price impact.
  • the trading rule used in the AMM (more details below).

It is an important factor when making trades, as it can result in the trader losing value by having to pay a premium for their subsequent buy trades.

To illustrate, if a trade involves swapping a large amount from a highly liquid token like ETH, to an illiquid token like BANANA — because there are not enough sellers of BANANA at the current market price to fulfill the order, the value of BANANA would increase against the value of ETH in this particular trade, resulting in the trader paying a premium, in what is known as negative price impact.

For example, a [negative] price impact of -42.09%, means that the trader will be paying 42.09% more than current market price (or ie. losing 42.09% of trade value) for their swap.

The opposite, positive price impact, is known as arbitrage opportunity , when a pool is imbalanced towards a trader’s favour, where he/she holds the more illiquid (or ‘rarer’) token and is able to “arbitrage” for better deals from the many trade offers at hand.

To understand how price impact is calculated, we must first understand fundamentally how an AMM determines its token prices:

  • Liquidity pools are smart contracts that act as AMMs — they hold reserves of 2 or more tokens & allow anyone to deposit or withdraw funds from them, according to specific trading rules.
  • The standard trading rule found across established DEXs like Uniswap V2, Sushiswap & Balancer, is the `constant product formula`:
Liquidity Pools 101: What is Price Impact? (3)

# or in pseudo-code:

token_a_pool_size * token_b_pool_size = constant_product

This constant product formula enforces that for some amount of token A to be withdrawn, a proportional amount of token B must be deposited to maintain the constant `k` before fees (fees increase the `k` slightly every trade).

From this constant product formula, the token price formula can be derived as:

price_token_a = reserve_token_b / reserve_token_a

-The following pricing curve graph illustrates this (Source: Curve Whitepaper):

Liquidity Pools 101: What is Price Impact? (4)

With that, we can now understand how price impact is calculated via examining Uniswap:

  • Uniswap V2 defines price impact as the difference between the mid-price & the execution price of a trade”, with mid-price being the price ratio of the two token reserves shown in the previous chart.
  • When inspecting Uniswap’s frontend codebase, we find a script computeFiatValuePriceImpact.tsx that computes the price impact displayed on the app, with the key line :

In essence, Uniswap calculates an estimate price impact using the following formula:

Liquidity Pools 101: What is Price Impact? (5)

As an example, if we wanted to swap 10,000 WBTC to ETH, we calculate as such:

1 — Calculate expected output token to receive based on the constant product:

Liquidity Pools 101: What is Price Impact? (6)

We have the pool information:

Liquidity Pools 101: What is Price Impact? (7)

Swapping 10,000 WBTC should give us:

Liquidity Pools 101: What is Price Impact? (8)

This means we receive:

Liquidity Pools 101: What is Price Impact? (9)

2 — With that, we can now calculate the estimated price impact using:

Liquidity Pools 101: What is Price Impact? (10)

Let’s measure the value of the tokens in BTC terms:

Liquidity Pools 101: What is Price Impact? (11)

Substituting the variable, we get:

Liquidity Pools 101: What is Price Impact? (12)

If we were to only make the swap fully within this single WBTC-ETH pool, then the price impact is a very high -96.934%.

If we take the previous 10k WBTC swap to ETH as an example, we find that on Uniswap, the actual Price Impact is much lower (-59.23% instead):

Liquidity Pools 101: What is Price Impact? (13)

This is because most DEXs have a built-in pathfinder algorithm (in this example, called `Auto Router`) that automatically splits a trade amount between multiple liquidity sources, which helps reduce negative price impact. On Uniswap, this can be found in the smart contract Router02 .

Other than that, here are some simple ways to reduce negative price impact manually:

  1. Find the market with the deepest liquidity, in the price range we want. We can use CoinGecko as a starting point to view the depth of markets, e.g. for BTC :
Liquidity Pools 101: What is Price Impact? (14)

2. Trade off-chain, for example on CEXs. As there are arbitrage opportunities for “backrunning” trades due to rate differences between CEXs & DEXs, many times DEXs may not offer the best prices.

3. Spread out trades in smaller trades over time. Routing through different “bridge” currencies may also help reduce negative price impact — in this regard, aggregators like 1inch are particularly useful.

Price impact is a very important metric to watch out for whenever making trades on DEXs / liquidity pools — a negative price impact means that your trade is making you lose value. DEXs try to reduce this effect automatically through auto-routing feature written in their smart contracts, but traders can further mitigate negative price impact by always looking out for markets with the deepest liquidity and spreading out their trades over time into smaller chunks.

So, the next time you are making a trade on a DEX, be sure to pay attention to that sneaky little red figure that is ‘price impact’!

Learn more about the fundamentals of crypto & DeFi — visit https://medium.com/@geniokua or geniokua.com

Liquidity Pools 101: What is Price Impact? (2024)
Top Articles
What are the best ways to ensure a positive travel experience?
What Is ISO 20022 and How Will It Impact the Financial Industry?
Maria Dolores Franziska Kolowrat Krakowská
Amtrust Bank Cd Rates
Koordinaten w43/b14 mit Umrechner in alle Koordinatensysteme
How Much Is 10000 Nickels
According To The Wall Street Journal Weegy
Kris Carolla Obituary
Strange World Showtimes Near Cmx Downtown At The Gardens 16
Remnant Graveyard Elf
Spelunking The Den Wow
Knaben Pirate Download
Power Outage Map Albany Ny
Yesteryear Autos Slang
Used Wood Cook Stoves For Sale Craigslist
Chicken Coop Havelock Nc
Https://Store-Kronos.kohls.com/Wfc
24 Best Things To Do in Great Yarmouth Norfolk
Louisiana Sportsman Classifieds Guns
Diamond Piers Menards
Everything you need to know about Costco Travel (and why I love it) - The Points Guy
라이키 유출
Glenda Mitchell Law Firm: Law Firm Profile
Craigslist Prescott Az Free Stuff
Best Transmission Service Margate
Boston Dynamics’ new humanoid moves like no robot you’ve ever seen
A Cup of Cozy – Podcast
What Are The Symptoms Of A Bad Solenoid Pack E4od?
Disputes over ESPN, Disney and DirecTV go to the heart of TV's existential problems
Suspiciouswetspot
Pain Out Maxx Kratom
Kroger Feed Login
Marokko houdt honderden mensen tegen die illegaal grens met Spaanse stad Ceuta wilden oversteken
Where to eat: the 50 best restaurants in Freiburg im Breisgau
Lilpeachbutt69 Stephanie Chavez
Evil Dead Rise Showtimes Near Regal Sawgrass & Imax
25Cc To Tbsp
Learn4Good Job Posting
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Craigslist Free Stuff San Gabriel Valley
Lil Durk's Brother DThang Killed in Harvey, Illinois, ME Confirms
Telegram update adds quote formatting and new linking options
All Characters in Omega Strikers
Trivago Sf
Pekin Soccer Tournament
Login
Reilly Auto Parts Store Hours
Sky Dental Cartersville
Mega Millions Lottery - Winning Numbers & Results
Who We Are at Curt Landry Ministries
Blippi Park Carlsbad
Latest Posts
Article information

Author: Ouida Strosin DO

Last Updated:

Views: 5322

Rating: 4.6 / 5 (76 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Ouida Strosin DO

Birthday: 1995-04-27

Address: Suite 927 930 Kilback Radial, Candidaville, TN 87795

Phone: +8561498978366

Job: Legacy Manufacturing Specialist

Hobby: Singing, Mountain biking, Water sports, Water sports, Taxidermy, Polo, Pet

Introduction: My name is Ouida Strosin DO, I am a precious, combative, spotless, modern, spotless, beautiful, precious person who loves writing and wants to share my knowledge and understanding with you.