CLMM
Suggest an editA standard AMM spreads a liquidity provider's deposit over every price from zero to infinity, so most of it never trades. A Concentrated Liquidity Market Maker (CLMM) lets the provider choose a price range instead. On Solana this design raises a state question that Uniswap V3 on Ethereum did not have to answer: where does the pool keep its price levels, when a swap has to list every account before it runs?
What's wrong with the standard AMM
A constant-product pool prices trades along the curve x * y = k, which covers every price from zero to infinity. As the price moves, the reserves shift along the curve.
The trouble is that LPs end up providing depth at prices that will never trade. If SOL is at $200 and you deposit $10,000 into a standard SOL/USDC pool, a small fraction of it provides liquidity near $200, where trades happen. The rest is reserved for trades at $1, at $5,000, at $100,000. Those dollars sit idle and earn no fees. In a standard SOL/USDC pool, the part of an LP's capital that is active within any reasonable trading band is often less than 5% of the deposit.
Concentrated liquidity: the LP chooses the range
A CLMM lets an LP say: "I think SOL will trade between $180 and $220. Concentrate all my capital in that range." The LP picks a lower price Pl and an upper price Pu, and the capital provides depth only in [Pl, Pu]. Trades inside the range pay fees to the position. If the price moves outside the range, the position earns nothing until the price comes back or the LP repositions.
The range [$180, $220] is 10% either side of the current price, so the same $10,000 provides depth comparable to a standard-AMM deposit about 20 times larger, around $200,000, because none of the capital is reserved for unreachable prices (the Uniswap V3 lesson shows the calculation). The narrower the range, the more fees per dollar while the price is inside it, and the higher the risk that the price leaves and the position earns nothing.
So a CLMM pays for capital efficiency with active management: the LP has to watch the price and move the range. A passive LP in the standard AMM earns less per dollar but never goes out of range.
The range decides which token you deposit
In the standard AMM you always deposit both tokens, in the ratio set by the current pool price. In a CLMM the ratio depends on where your range sits relative to the current price, and you don't choose it: the range forces the composition.
To see why, look at what the pool does when the price moves. When the price rises, someone is buying SOL: they send USDC into the pool and the pool sends SOL out. When the price falls, someone is selling SOL: the pool takes SOL and pays USDC. The pool is a market maker that always takes the other side, so it needs SOL to sell while the price rises and USDC to buy while the price falls.
Now apply this to a position with range [Pl, Pu]:
Range entirely above the current price (current price < Pl). For the price to reach this range it has to rise to Pl, and it crosses the range while rising to Pu. The pool is selling SOL the whole way, so you deposit only SOL. As the price rises through your range, your SOL is gradually sold for USDC. When the price reaches Pu, all your SOL is gone, replaced by USDC.
Range entirely below the current price (current price > Pu). For the price to enter this range it has to fall to Pu, and it crosses the range while falling to Pl. The pool is buying SOL the whole way, so you deposit only USDC. As the price falls through your range, your USDC is gradually converted to SOL. When the price reaches Pl, all your USDC is gone, replaced by SOL.
Range straddling the current price (Pl < current price < Pu). The price can move in either direction, so the position needs both tokens, in a ratio that depends on where the current price sits within the range.
At the lower boundary Pl a position holds only SOL, and at the upper boundary Pu it holds only USDC. In between it is a mix.
A narrow range works as a limit order
Suppose SOL is at $200 and you want to sell at $250. In the standard AMM you would have to watch the price and swap when it hits your target. In a CLMM you create a tight position with range [$250, $250.50]. The position is entirely above the current price, so you deposit only SOL. If the price never reaches $250, the position sits idle. If the price moves through $250 to $250.50, your SOL is swapped for USDC inside the range, and when the price exits at the top the position holds only USDC, from SOL sold at an average price near $250.
A limit buy is the same with a tight range below the current price. The fill is an average over the range, not the exact target, so a tighter range gives a fill closer to the target. Unlike a true limit order, the position earns fees while it fills, and the fill is not final. If the price comes back down through the range, the pool buys SOL back with your USDC, and the position is all SOL again. To keep the USDC, you have to withdraw the position after the price has crossed it.
Ranges end on ticks
For every range boundary, the pool has to remember how much liquidity starts or stops counting when the price crosses it. If a boundary could be any price, every position would add two new boundaries to store. So boundaries are restricted to a fixed grid of price levels called ticks, and positions that share a boundary share its record.
The grid is geometric:
price(tick) = 1.0001 ^ tickEach step from one tick to the next changes the price by 0.01%, one basis point. Tick 0 corresponds to price 1.0, tick 1 to price 1.0001, tick -1 to price 0.9999. Because the step is a percentage, the same grid fits a token worth cents and a token worth thousands of dollars. Frontends and SDKs convert between tick numbers and prices, so you almost never compute ticks by hand.
A pool also has a tick spacing. A pool with tick spacing 60 only allows positions whose endpoints are multiples of 60, so there are fewer boundaries to store and to cross. Raydium CLMM pools exist at several fee tiers, from 0.01% for pairs that should trade at almost identical prices, like two stablecoins, to 1.00% for exotic pairs with high volatility, and a higher fee tier has a coarser spacing. Each fee tier is a separate pool, so the liquidity of one pair is split across them and thin markets fragment further. Aggregators like Jupiter route a trade through whichever pool gives the best execution.
Where the ticks live on Solana
Uniswap V3, the concentrated-liquidity DEX on Ethereum, keeps the ticks in the pool contract's own storage, keyed by tick number. During a swap the contract reads whichever ticks the price crosses, and nobody has to name them in advance.
A Solana program cannot do that. Every account a transaction touches is listed before it runs, and a swap does not know exactly how far the price will move. The two obvious layouts both fail:
- One account per tick. A swap would have to list one account for every tick it crosses, so the list would grow with the size of the trade, and a legacy transaction fits about 35 account addresses in total (composing programs).
- All ticks in the pool account. The account would need space for every tick that could ever be used, and rent is paid for every byte whether or not a tick holds liquidity.
Orca Whirlpools and Raydium CLMM use the layout in between, a tick array. A tick array is an account that holds a fixed number of consecutive ticks at the pool's spacing, at an address derived from the pool and the array's first tick. The pool account keeps the current price, the current tick, and the liquidity active at that price. The per-tick records are in the arrays.
How a swap works follows from this layout:
- The client computes which tick arrays the price can reach and passes them with the swap. The addresses are derived, so it can do this without asking the program.
- The program starts in the array that contains the current tick and moves through the arrays it was given. It cannot cross a tick in an array that was not passed, so one transaction can move the price only as far as its tick arrays reach.
- A tick array is created the first time someone needs it. Usually the LP who opens the first position in an untouched part of the price range pays the rent for that array.
Solana PRO describes the general form of this layout as divide and conquer: split the state into partitions, and let each transaction touch only the partitions it needs.
A bin holds liquidity at one fixed price
Meteora's DLMM uses a different unit in place of the tick. The price range is cut into bins, and every bin has one fixed price and its own reserves. A swap trades against the active bin at that bin's price until one of its tokens runs out, and then moves to the next bin. Bins are grouped into bin array accounts the same way ticks are grouped into tick arrays, and a swap passes the bin arrays it can reach.
What differs is the meaning of one record. A tick only marks where liquidity starts or stops, and the price moves along a curve between ticks. A bin holds the liquidity itself, at one price. An LP chooses how much to put into each bin, so a position can have any shape across its range. The price then moves in steps of one bin: inside a bin a trade does not move the price, and when the bin is emptied the price jumps to the next one.
A position is an account, and the NFT is its key
Standard AMM LP positions are SPL tokens. Every LP in a standard pool has the same kind of claim, only for different amounts, so the shares are fungible. CLMM positions are not interchangeable. If Alice has the range [$180, $220] and Bob has the range [$200, $300], their exposures are different, and there is no single LP token that could represent both.
So each position is its own account, owned by the CLMM program, that records the pool, the range, the liquidity amount, and the accumulated fees. Its address is derived from the mint of an NFT that the program mints when the position is opened. Whoever holds the NFT controls the position, so a position can be transferred, sold on a secondary market, or used as collateral by moving one token. Every integration has to handle individual positions and cannot treat LP shares as a fungible balance, which makes building on a CLMM more work than building on the standard AMM.
The pool records its own price history
A CLMM pool stores observations: a running total of the tick multiplied by time, updated as swaps move the price. The difference between two observations, divided by the time between them, is the average tick over that window, and the average tick converts back to a price. Because the tick is the logarithm of the price, this average is the geometric mean of the price. The geometric mean of $100 and $400 is $200, while the arithmetic mean is $250. The geometric mean treats equal ratio changes as equal distances, which matters when prices can swing by large multiples. Solana PRO's internal oracle lesson shows how another program can use these observations in place of an external price feed.
When the standard AMM is still the better choice
The standard AMM is still a reasonable choice for assets with extreme volatility where any chosen range becomes irrelevant quickly, for passive LPs who can't or won't monitor positions, and for integrations where a fungible LP token keeps the rest of the program simple.
Before you choose a CLMM for a pair, ask what happens when the price leaves the range for a week: who notices, who moves the liquidity, and who pays for those transactions. If the answer is nobody, a standard pool will serve that pair better.