Concentrated Liquidity

The defining idea of ​​PipiSwap v3 is concentrated liquidity: liquidity that is allocated within a custom price range. In previous versions, liquidity was distributed evenly along the price curve between 0 and infinity.

The previous uniform distribution allowed trading over the entire price range (0, ∞) without loss of liquidity. However, in many pools, the majority of liquidity was never used.

Consider stablecoin pairs, where the relative price of the two assets remains relatively constant. Liquidity outside the typical price range of a stablecoin pair was rarely used. For example, the v2 DAI/USDC pair uses approximately 0.50% of total available capital to trade between $0.99 and $1.01, the price range where LPs would expect to see more volume, and consequently earn more commissions.

With v3, liquidity providers can concentrate their capital on price intervals smaller than (0, ∞). In a stablecoin pair, for example, an LP may choose to allocate capital only in the range of 0.99 – 1.01. As a result, traders have deeper liquidity around the median price, and LPs earn more trading fees on their capital. We call liquidity concentrated in a finite interval a position. LPs can have many different positions per pool, creating individualized price curves that reflect each LP's preferences.

Active Liquidity As the price of an asset rises or falls, it can move outside the price limits that LPs have established on a position. When the price leaves the range of a position, the liquidity of the position is no longer active and no longer generates commissions.

As the price moves in one direction, LPs obtain more of one asset while exchangers demand the other, until all of their liquidity consists of just one asset. (In v2, we don't often see this behavior because LPs rarely reach the upper or lower price limit of two assets, i.e. 0 and infinity.) If the price re-enters the range, liquidity becomes active again and LPs within the range start earning commissions again.

Importantly, LPs are free to create as many positions as they see fit, each with their own price range. Concentrated liquidity serves as a mechanism to allow the market to decide what is a sensible distribution of liquidity, as rational LPs have incentives to concentrate their liquidity while ensuring that their liquidity remains active.

Ticks To achieve concentrated liquidity, the spectrum of continuous price space has been divided with ticks.

Ticks are the boundaries between discrete areas in price space. The ticks are spaced such that an increase or decrease of 1 tick represents a 0.01% increase or decrease in price at any point in the price space.

The ticks function as limits for liquidity positions. When creating a position, the provider must choose the lower and upper tick that will represent the limits of their position.

As the spot price changes during the exchange, the pool contract will continuously exchange the outgoing asset for the incoming one, progressively using all available liquidity within the current tick interval until the next tick is reached. At this point, the contract switches to a new tick and activates any inactive liquidity within a position that has a limit on the newly active tick.

While each pool has the same number of underlying ticks, in practice only a portion of them can serve as active ticks. Due to the nature of v3 smart contracts, tick spacing is directly correlated to the exchange fee. Lower fee levels allow for closer potentially active ticks, and higher fees allow for relatively wider spacing of potentially active ticks.

While inactive ticks have no impact on the transaction cost during trades, crossing an active tick does increase the cost of the transaction it is crossed on, as crossing the tick will trigger liquidity within any new positions you use. the tick given as a limit.

In areas where capital efficiency is paramount, such as stablecoin pairs, tighter tick spacing increases the granularity of liquidity provision and will likely reduce the price impact when exchanging, resulting in significantly improved prices for exchanges. of stablecoins.

Last updated