Liquidity Provision

Overview

Comet Swap supports two liquidity models:

  • CLMM Pools (V3-style): liquidity is provided within a chosen price range.

  • Classic Pools (V2-style): liquidity is provided across the full curve, and LP shares are fungible.

CLMM Pools (V3-style)

Price, ticks, and ranges

V3-style pools discretize price into ticks. A tick is an integer index that maps to price:

price=1.0001tick\text{price}=1.0001^{tick}

The pool tracks price in a square-root form for efficient math:

sqrtPriceX96=price296\text{sqrtPriceX96}=\left\lfloor \sqrt{\text{price}}\cdot 2^{96}\right\rfloor

Liquidity providers choose a lower tick and upper tick to define the range in which their liquidity is active.

Example: how tick maps to price

If we define price as token1 per token0, then:

  • Tick = 0

price=1.00010=1\text{price}=1.0001^{0}=1
  • Tick = 100

  • Tick = -100

price=1.00011000.99005  (0.995%)price = 1.0001^{-100} \approx 0.99005 \;(\approx -0.995\%)

Notice: each tick is a very small step (~0.01%). Around 100 ticks is ~1% change.

Example: how a liquidity range becomes a price range

Liquidity is active only when the current tick stays between your lower tick and upper tick.

For example, if you choose:

  • lowerTick = -600

  • upperTick = 600

then your liquidity is active roughly when:

pricemin1.00016000.94177price_{min} \approx 1.0001^{-600} \approx 0.94177
pricemax1.00016001.06183price_{max} \approx 1.0001^{600} \approx 1.06183

So the position is active when price stays within [0.94177, 1.06183] (in token1/token0 terms).

V3 Tick Spacing

Tick Spacing defines the grid size of ticks in a V3 pool. Liquidity positions can only be created with lower/upper ticks that are multiples of tickSpacing, so it controls how fine-grained price ranges can be.

  • Smaller tick spacing ⇒ finer range selection, but potentially more initialized ticks and higher gas/state.

  • Larger tick spacing ⇒ coarser range selection, but fewer initialized ticks and lower gas/state.

Example: if tickSpacing = 60, valid ticks are ..., -120, -60, 0, 60, 120, ... (you cannot use tick = 13 as a boundary).

Active vs inactive liquidity (in-range / out-of-range)

A CLMM position is active only when the current price is inside its range:

  • In-range (active): your liquidity participates in swaps and can earn fees.

  • Out-of-range (inactive): swaps do not use your liquidity, so fee earning stops until price returns into range or you reposition.

This is the single most important operational concept for V3 LPs: fees earning requires your liquidity to be active.

Liquidity efficiency and range width

Range width is a trade-off between fee capture frequency and depth concentration:

  • Wider ranges tend to stay active more often (lower management burden), but liquidity is spread across more prices, so the position provides less “usable depth” near the active price.

  • Narrower ranges concentrate liquidity closer to the active price (more effective depth per unit deposited), but are more likely to go inactive if price moves, requiring more active management to stay in-range.

Implication for LPs:

  • Narrow ranges can earn fees more efficiently when active, but increase the risk of inactivity and one-sided outcomes.

  • Wide ranges trade fee efficiency for robustness and lower maintenance.

Why V3 positions become “single-sided”

As price moves through a range, your position’s inventory changes. If price exits your range, your position can become largely or entirely one token:

  • If price moves above your upper bound, the position trends toward token1-only.

  • If price moves below your lower bound, the position trends toward token0-only.

This is not an error; it is the expected behavior of providing liquidity in a finite interval.

Positions as NFTs

V3 positions are represented as NFTs because they are non-fungible: each position may have a unique range, fee tier, and liquidity amount.

A position NFT encodes:

  • token pair and fee tier,

  • tickLower / tickUpper,

  • liquidity amount,

  • fee accounting state (uncollected fees).

Fees are not automatically compounded into liquidity. They accrue to the position and are tracked so they can be collected.

Fee tiers

V3 pools exist per token pair + fee tier. Fee tiers allow markets to choose fee levels that match volatility and trading demand.

General guidance:

  • lower fee tiers often fit correlated or stable pairs,

  • higher fee tiers fit more volatile pairs where traders tolerate higher fees.

Classic Pools (V2-style)

Constant product invariant

V2-style pools follow the constant product curve:

xy=k\text{x}\cdot\text{y}=\text{k}

Where x and y are reserves of token0 and token1. Swaps move reserves along the curve after paying fees.

V2 LP tokens (ERC-20)

When you add liquidity to a V2 pool, you receive ERC-20 LP tokens that represent your pro-rata share of the pool. Positions are fungible because liquidity is uniform across the curve.

When you remove liquidity, LP tokens are burned and you receive your share of the reserves in token0 and token1. Fees earned by the pool are reflected in the reserves over time, so the claimable amounts per LP token typically increase as swaps occur.

Impermanent Loss(V2 and V3)

Providing liquidity exposes LPs to price movement risk:

  • Impermanent loss (IL) is the difference between holding tokens in a pool versus holding them outside the pool, when relative prices change.

  • IL can occur in both V2 and V3.

  • In V3, the effect is more granular and position-dependent because ranges can amplify exposure near the active price and can end up single-sided when out-of-range.

Fees may offset IL depending on volume, fee tier, and how long liquidity stays active.

Last updated