What is Concentrated Liquidity?
With DLMM, LPs can provide liquidity within a specified price range, also known as concentrated liquidity. This is especially useful for token pairs where trades happen within a tight range, such as USDC/USDT where trades usually happen around 1.01. Often, liquidity outside of this range is untouched and LPs do not earn fees.Optimize Your Capital
By concentrating all liquidity within active price ranges, LPs can optimize
their trading fees earned.
DLMM Bin Structure
Bin Price
Liquidity is distributed across discrete bins with a fixed width and fixed price. Within each bin, liquidity can be exchanged at a fixed price using the formula X + Y = k within each bin. Basically, you add X tokens and take out Y tokens (or vice versa), until there is only one type of token left. Each bin represents a single price point, and the difference between 2 consecutive bins is the bin step.Bin steps are calculated based on the basis points set by the pool creator.
Example: APT/USDC Bin Structure
Taking APT/USDC, if the current price is $20 and the bin step is 25 basis points (0.25%), then the consecutive bins would be:Bin Progression
- Bin 1: $20.00
- Bin 2: 20.05
- Bin 3: 20.10
- And so on…
Pool Identification
Liquidity pools are identified by their tuple: (Token X, Token Y, Bin Step S)Bin Liquidity
Liquidity in each bin is calculated using the constant sum price variant:- x = quantity of token X
- y = quantity of token Y
- L = amount of liquidity in the bin
- P = Δy/Δx = price constant unique to each pool
Bin Composition
Key Points
- All bins except for the active one contain just one type of token (X or Y)
- Only the active bin earns trading fees
- P represents the slope of the line and remains consistently uniform within every bin
y = P/x.
Since the composition of reserves (x and y) are independent of both price and liquidity, an additional variable is used to describe the reserves available in the bin. This variable, composition factor c, is the percentage of bin liquidity composed of token Y:
Market Aggregation
The constant sum curve intercepts both the x and y axes, meaning that the reserves of X or Y token can be depleted. When this happens, the current price moves to the next bin either on the left or right.Active Price Bin
The active price bin is defined as the bin that contains reserves of both X and Y tokens.Left Bins
All bins to the left of the active bin contain only token Y
Right Bins
All bins to the right of the active bin contain only token X
Practical Example: APT/USDC Pool
Consider an APT/USDC pool where:- Asset Y = USDC
- Asset X = APT
- Price P = amount of USDC per APT
Active Bin Example ($100 APT)
If we define the $100 APT bin as the active bin:- All bins to the left contain only USDC
- All bins to the right contain only APT
- When there is significant demand for APT, the active bin shifts to the right as the APT reserves in the $100 bin get exhausted