Mechanics
Cetus CLMM Mechanics
Active Liquidity of a Position
The active liquidity of a CLMM position is defined based on its range and current price. Let Pcurrent be the current price, Plow and Phigh be the lower price and upper price bounds of the position, and L represent the position liquidity:
If Pcurrent < Plow, the position holds only token Y.
If Pcurrent > Phigh, the position holds only token X.
If Plow ≤ Pcurrent ≤ Phigh, the position holds both tokens according to:
Where x and y are the real token reserves of the position.
Pool Liquidity
The real-time total active liquidity of a CLMM pool is the aggregate of the active liquidity of all active positions at the current price:
Since liquidity is not fungible across positions in CLMM, two positions with the same $TVL may contribute differently depending on their range and the current price.
Swaps in CLMM
In a Cetus CLMM pool, liquidity is provided through positions, each defined over a discrete price range between a lower tick Plow and an upper tick Phigh. While price ticks are discrete, the pool price moves continuously as swaps occur, allowing execution along the price curve.
How swaps interact with position liquidity:
1) Active Positions at the Current Price
All positions whose price ranges contain the current pool price are considered active.
Swaps interact proportionally with all active positions based on their active liquidity at the current price.
2) Executing Swaps and Updating Reserves
As a swap is executed, each active position updates its token reserves according to its proportional contribution:
where ΔXallocated is the amount of token X assigned to that position based on its share of total active liquidity, and f (⋅) is the liquidity-price relation derived from the position’s liquidity L and tick bounds.
3) Price Movement Across Ticks
If a swap consumes enough liquidity to push the pool price beyond the range of the currently active positions, the pool price moves linearly to the next available price range containing liquidity.
New positions that now encompass the pool price become active automatically, and the swap continues interacting proportionally with all active positions at the new price.
Range Orders
Range orders are an advanced LP-driven trading strategy enabled by CLMM:
A liquidity position can be set to one side of the current price to simulate a limit order.
Once the market price crosses the position’s range, the swap executes automatically.
Although the range order trading is quite similar to limit orders in orderbook market, there are still differences. If your range order position is crossed, you need to withdraw your position to finalize the order because the pool price may fluctuate back and the liquidity swaps may occur reversely at a later time.
Common Types of Range Orders
Take-Profit Orders
For example, the current price of a BTC-USDC pool is 20,000 USDC/BTC and you want to sell your BTC for USDC when BTC price reaches 21,000 USDC/BTC. This is feasible by placing range orders because the price space above the current price is fully denominated in the higher-valued token in a concentrated liquidity pool. You can open a position with a narrow price range like 21,000-21,001 USDC/BTC and add your BTC into the pool. Your order will be filled if the price keeps increasing and crosses your liquidity position.
Buy-Limit Orders
For example, the current price of the BTC-USDC pool is 20,000 USDC/BTC. You predict that the BTC price will rebound if it drops to 19,000, so you plan to buy some BTC with USDC at the price of 19,000. It can be achieved by range orders because the space below the current price is denominated in the lower-valued asset, USDC. You can simply create a position with a price range like 19,000-19,001 USDC/BTC. Your BTC will all be swapped into USDC when the spot price drops and crosses your position price range.
Last updated