main-featuresConcentrated Liquidity

Concentrated Liquidity

Overview

Providing liquidity is essential for decentralized exchanges like SpookySwap to function. It allows users to trade assets on the platform while ensuring that there are sufficient funds available for transactions. Providing liquidity awards the contributors to earn swapping fees from the pairs they provide. Your liquidity can earn even more rewards (BOOs) if they’re staked at farms.

Concentrated Liquidity

The Idea

The key feature of SpookySwap V3 is concentrated liquidity, which allows liquidity to be allocated within a specific price range. In earlier versions, liquidity was distributed uniformly across the entire price curve from 0 to infinity.

This uniform distribution enabled trading throughout the entire price interval (0, ∞) without any loss of liquidity. However, in many pools, a significant portion of this liquidity remained unused.

Take stablecoin pairs, for example, where the relative prices of the two assets tend to remain stable. The liquidity outside the typical price range of a stablecoin pair is seldom utilized. For instance, in the SpookySwap V2 DAI/USDC pair, approximately 0.50% of the total available capital is engaged in trading within the narrow price range of $0.99 to $1.01, where liquidity providers (LPs) expect to see the highest volume and earn the most fees.

With SpookySwap V3, liquidity providers can concentrate their capital within smaller price intervals than (0, ∞). For a stablecoin/stablecoin pair, an LP might choose to allocate their capital solely to the 0.99–1.01 range. This concentration results in deeper liquidity around the mid-price, enabling traders to benefit from improved pricing and allowing LPs to earn higher trading fees on their invested capital. We refer to liquidity concentrated within a finite interval as a “position.” LPs can have multiple positions within a single pool, each creating unique price curves that reflect their individual preferences.

Liquidity providers (LPs) can combine multiple concentrated positions within a single pool. For instance, an LP in the ETH/DAI pool could allocate $100 to the price range of $1,000–$2,000 and an additional $50 to the range of $1,500–$1,750.

This approach allows LPs to mimic the shape of any automated market maker or even an active order book (range orders).

Traders interact with the combined liquidity of all individual positions without any increase in gas costs per liquidity provider. The trading fees collected within a given price range are distributed proportionally among LPs based on the liquidity they contributed to that specific range.

By concentrating their liquidity, LPs can provide the same depth of liquidity as in V2 within specified price ranges while risking less capital, resulting in higher capital efficiency.

Active Liquidity

As the price of an asset fluctuates, it may move outside the price bounds set by liquidity providers (LPs) for a given position. When this happens, the liquidity within that position becomes inactive and ceases to earn fees.

When the price shifts in one direction, LPs accumulate more of one asset as swappers demand the other, eventually resulting in their entire liquidity being composed of just one asset. In V2, this behavior is less common since LPs typically do not reach the upper or lower bounds of the asset prices (i.e., 0 and ∞). However, if the price reenters the specified interval, the liquidity becomes active again, and LPs who are within the range can start earning fees once more.

Importantly, LPs can create multiple positions, each with its own designated price interval. Concentrated liquidity allows the market to determine an optimal distribution of liquidity, as rational LPs are incentivized to concentrate their liquidity while ensuring that it remains active.

Non-Fungible Liquidity

Due to the unique custom price curves created by each liquidity provider (LP), liquidity positions are no longer fungible and are not represented as ERC-20 tokens within the core protocol.

Instead, LP positions are represented by non-fungible tokens (NFTs). However, common shared positions can still be made fungible (ERC-20) through peripheral contracts or collaborations with partner protocols. Additionally, trading fees are no longer automatically reinvested back into the pool on behalf of the LPs.

In the future, we anticipate that increasingly sophisticated strategies will be tokenized, enabling LPs to engage while enjoying a more passive user experience. This could include features like multi-positions, automated re-balancing to concentrate liquidity around the market price, fee reinvestment, lending, and more.

The Role of Ticks

To achieve concentrated liquidity, the previously continuous spectrum of price space has been divided into discrete segments known as ticks.

Ticks serve as the boundaries between distinct areas in price space, with each tick representing a 0.01% inc