◾
Quadrat² Protocol
Strategies0xPlasma TwitterQuadrat Twitter
  • Welcome to Quadrat² Protocol
  • 🧦Uniswap Basics
    • About Uniswap Protocol
    • Uniswap v2 vs v3
    • Impermanent Loss
      • Impermanent Loss (IL) and Options Calculator
    • Implied Volatility
    • Uniswap v3 Analytics
    • Uniswap V3 Fee Calculation
      • Uniswap v3 Math
    • Uniswap Resources
  • 🔳Quadrat Protocol
    • Protocol Overview
    • Use Cases
      • Passive Strategies (Savings)
      • Fund Management
      • Option Strategies
      • DEX Trading - Asset Trust Management
    • Quadrat Strategies
    • Protocol Fee Structure
    • Quadrat UI and User Experience
      • How to analyse strategies
      • How to deposit assets in Strategies
      • How to withdraw assets from the Strategy
    • Development Infrastructure
      • HyperPool Smart Contracts
      • API Service
      • Quadrat and Uniswap v3 Subgraphs
    • Quadrat Open Uniswap v3 Asset Management Platform
      • Overview
      • Create Strategy Vault
      • Manager ENS Profile
      • Manager Success Fees
      • Rebalancing Calculator
      • Rebalancing Slippage
      • Rebalancing Strategy
      • TX Fees Cost for Asset Managers
      • Depositors Whitelist
      • Block new Deposits
      • Strategy Balance Limit
      • Strategy Ownership Transfer
      • Risk Warnings for Asset Managers
      • Governance Control
    • Risk Assessment
    • Quadrat Brand Asset
  • 🚀Quadrat Booster
    • Booster Overview
    • How to create Farming on Uniswap v3 using Quadrat Booster
    • Managing Quadrat Booster Farming Campaigns
    • Deposit LPs into Booster Farming Campaign (for liquidity providers)
    • Withdraw Liquidity from Booster Farming and Claiming Rewards (for liquidity providers)
    • Using Quadrat Booster for Protocol/Team Tokenomic and Liquidity Improvement
  • 🧩DeFi Lego with Quadrat Protocol
    • Lending
    • DeFi Index
    • Rebalancing Vaults
    • Liquidity Farming and Liquidity Lockup on Uniswap v3
    • HyperDEX + Quadrat
    • Gnosis SaFe + Quadrat Strategies
    • Auto Strategy Executor with Gelato
    • External Tokens Governance and Uniswap v3 Pool Management
    • Investment DAO
    • * Quadrat DeFi Lego (for Devs)
  • 📊Quadrat Strategies
    • Rebalancing Algorithm
    • USDT, USDC Strategies
    • ETH Strategies with the highest APY and lowest IL
    • BTC Strategies with the highest APY and lowest IL
    • Low IL and high APY strategies
    • Black Swan Strategies
    • Trading Strategies
    • Forex Strategies
    • Delta Neutral Strategy and Hedge *Advanced
  • 🚀Quadrat Launch Roadmap
    • Quadrat NFT Pass
    • NFT Pass Distribution for Community and pre-mint whitelist for Ambassador
    • NFT Pool for Public Distribution
    • Fair $POOL Token Launch & Token AirDrop
    • Quadrat Strategy Incentivization
    • Staking Program for $POOL Governance
  • 🐳Quadrat Liquidity Alliance
    • Quadrat Liquidity Alliance
  • 🧊Quadrat Uniswap v3 Asset Managers Alliance
    • Asset Managers Alliance
  • 🧑‍🏫Quadrat Core Team
    • 0xPlasma OG
  • 💻Links & Resources
    • Quadrat dApp and Socials
Powered by GitBook
On this page
  • Concentrated Liquidity #
  • Dune Analytics Dashboard Uniswap V2/V3 Comparison
  1. Uniswap Basics

Uniswap v2 vs v3

PreviousAbout Uniswap ProtocolNextImpermanent Loss

Last updated 2 years ago

This chapter retells . Again, it’s totally ok if you don’t understand all the concepts. They will be clearer when converted to code.

To better understand the innovations Uniswap V3 brings, let’s first look at the imperfections of Uniswap V2.

Uniswap V2 is a general exchange that implements one AMM algorithm. However, not all trading pairs are equal. Pairs can be grouped by price volatility:

  1. Tokens with medium and high price volatility. This group includes most tokens since most tokens don’t have their prices pegged to something and are subject to market fluctuations.

  2. Tokens with low volatility. This group includes pegged tokens, mainly stablecoins: USDC/USDT, USDC/DAI, USDT/DAI, etc. Also: ETH/stETH, ETH/rETH (variants of wrapped ETH).

These groups require different, let’s call them, pool configurations. The main difference is that pegged tokens require high liquidity to reduce the demand effect (we learned about it in the previous chapter) on big trades. The prices of USDC and USDT must stay close to 1, no matter how big the number of tokens we want to buy and sell. Since Uniswap V2’s general AMM algorithm is not very well suited for stablecoin trading, alternative AMMs (mainly ) were more popular for stablecoin trading.

What caused this problem is that liquidity in Uniswap V2 pools is distributed infinitely–pool liquidity allows trades at any price, from 0 to infinity:

The curve is infinite

However, we all believe in ETH reaching $10,000 one day.

Uniswap V3 introduces concentrated liquidity: liquidity providers can now choose the price range they want to provide liquidity. This improves capital efficiency by allowing to put more liquidity into a narrow price range, which makes Uniswap more diverse: it can now have pools configured for pairs with different volatility. This is how V3 improves V2.

In a nutshell, a Uniswap V3 pair is many small Uniswap V2 pairs. The main difference between V2 and V3 is that, in V3, there are many price ranges in one pair. And each of these shorter price ranges has finite reserves. The entire price range from 0 to infinite is split into shorter price ranges, with each of them having its own amount of liquidity. But, what’s crucial is that within that shorter price range, it works exactly as Uniswap V2. This is why I say that a V3 pair is many small V2 pairs.

Now, let’s try to visualize it. What we’re saying is that we don’t want the curve to be infinite. We cut it at points aa and bb and say that these are the boundaries of the curve. Moreover, we shift the curve so the boundaries lay on the axes. This is what we get:

It looks lonely, doesn’t it? This is why there are many price ranges in Uniswap V3–so they don’t feel lonely 🙂

As we saw in the previous chapter, buying or selling tokens moves the price along the curve. A price range limits the movement of the price. When the price moves to either of the points, the pool becomes depleted: one of the token reserves will be 0, and buying this token won’t be possible.

On the chart above, let’s assume that the start price is at the middle of the curve. To get to point aa, we need to buy all available yy and maximize xx in the range; to get to point bb, we need to buy all available xx and maximize yy in the range. At these points, there’s only one token in the range!

Fun fact: this allows to use Uniswap V3 price ranges as limit-orders!

What happens when the current price range gets depleted during a trade? The price slips into the next price range. If the next price range doesn’t exist, the trade ends up fulfilled partially-we’ll see how this works later in the book.

You can see that there’s a lot of liquidity around the current price but the further away from it the less liquidity there is–this is because liquidity providers strive to have higher efficiency of their capital. Also, the whole range is not infinite, it’s an upper boundary shown in the image.

Dune Analytics Dashboard Uniswap V2/V3 Comparison

This might not seem like a bad thing, but this makes capital inefficient. Historical prices of an asset stay within some defined range, whether it’s narrow or wide. For example, the historical price range of ETH is from $0.75 to $4,800 (according to ). Today (June 2022, 1 ETH costs $1,800), no one would buy 1 ether at $5000, so it makes no sense to provide liquidity at this price. Thus, it doesn’t really make sense to provide liquidity in a price range that’s far away from the current price or that will never be reached.

Concentrated Liquidity

Uniswap V3 price range

This is how liquidity is spread in :

Liquidity in the real USDC/ETH pool
🧦
CoinMarketCap
#
the USDC/ETH pool in production
the whitepaper of Uniswap V3
Curve
LogoUniswap V2/V3 ComparisonDuneAnalytics