Canonical: https://solanashreds.xyz/learn/concentrated-liquidity-on-solana

# Concentrated liquidity on Solana, for people decoding it

Solana concentrated liquidity in Raydium CLMM, Orca Whirlpool and Meteora DLMM: how each stores price ranges and which accounts a swap touches.

Solana concentrated liquidity lets providers place funds in chosen price ranges instead of across every price. Raydium CLMM and Orca Whirlpool store the ranges as ticks grouped into tick arrays; Meteora DLMM stores fixed-price bins grouped into bin arrays. Each swap must list the arrays it may cross as extra accounts.

## Liquidity placed in price ranges

In a constant-product pool, every unit of liquidity covers every possible price, so most of it sits idle far from the current price. Concentrated designs let a provider choose a range. Within that range the liquidity works harder; outside it, the position holds only one of the two tokens and earns nothing until the price comes back.

For a decoder, the important consequence is structural. The pool account cannot hold every range in one place, so the program spreads them over separate accounts, and a swap has to name the accounts it will walk through as the price moves. Those accounts show up in the instruction's account list. [How swaps look as instructions](https://solanashreds.xyz/learn/how-swaps-look-as-instructions) covers the parts every DEX swap shares.

## Three designs side by side

| | Raydium CLMM | Orca Whirlpool | Meteora DLMM |
| --- | --- | --- | --- |
| Price unit | tick | tick | bin |
| Units per account | 60 ticks per tick array | 88 ticks per tick array | 70 bins per bin array |
| Index range | ticks from -443,636 to 443,636 | ticks from -443,636 to 443,636 | bin ids, step set per pool, at most 400 basis points |
| Price in pool state | square root of price, 64.64 fixed point | square root of price, 64.64 fixed point | the active bin id |
| Arrays on a swap | after the named accounts: an optional bitmap extension, then tick arrays | three named tick arrays in `swap_v2`, plus supplemental ones after transfer-hook accounts | bin arrays after the named accounts |
| Swap amount fields | `amount`, `other_amount_threshold`, `sqrt_price_limit_x64`, `is_base_input` | `amount`, `other_amount_threshold`, `sqrt_price_limit`, `amount_specified_is_input`, `a_to_b` | `amount_in` and `min_amount_out`, or `max_in_amount` and `out_amount` for exact out |

Meteora also runs DLMM Pro, a separate tick-based program with its own ID, `dPro1D5wiqnGMH8vMDG23jh35btTHoWdyqXjqkqxe8n`; its pools cannot be used from DLMM, and this page covers the original bin design. The array sizes and bounds come from each program's source; the swap fields come from the IDLs each team publishes. Spacing between usable ticks is a pool setting: both Whirlpool pool creations we decoded used a tick spacing of 8.

## The extra accounts on every swap

Because a swap may cross from one array to the next, the caller passes the arrays the price could reach. Anchor IDLs name the fixed accounts, and anything past them arrives as remaining accounts, which the IDL does not label.

In the real swaps we decoded, the count of those trailing accounts varied from swap to swap. Raydium CLMM `swap_v2` calls carried 2, 3 or 6. Whirlpool `swap_v2` calls carried none in 7 cases and 2 in 4, since its first three tick arrays are named accounts. DLMM `swap2` calls carried 3 or 5. The program decides what each trailing account is by reading it: Raydium CLMM, for example, checks the data length to tell a tick array from the bitmap extension.

So a decoder that labels accounts by position must stop at the end of the named list. Treat whatever follows as an ordered list of arrays, not as fixed fields. [Reading an IDL](https://solanashreds.xyz/learn/reading-an-idl) explains named and remaining accounts.

## Reading a price from pool creation

1. Decode the pool creation instruction. Raydium CLMM `create_pool` carries `sqrt_price_x64`. Whirlpool `initialize_pool_v2` carries `initial_sqrt_price` and `tick_spacing`. DLMM `initialize_lb_pair2` carries `active_id`.
2. For the two tick designs, divide the square-root value by 2^64 and square it. One Raydium CLMM pool created on mainnet started at `sqrt_price_x64` 332,213,663,356,585,312,256: divided by 2^64 that is about 18.009, so the price was about 324.34 raw units of the second token per raw unit of the first.
3. For DLMM, the price of a bin is (1 + bin step / 10,000) raised to the bin id, which is how Meteora's own client computes it. A pool with a 10 basis point step and active id 264 would sit at about 1.302.
4. Adjust for each mint's decimals before showing a human price. Raw units are what the program stores.

## What a shred decoder can and cannot know

From the transaction bytes alone you get the direction, the fixed amount, the limit on the other side, and for the tick designs a square-root price limit. You also get the pool and the arrays the sender expected to cross. You do not get the price the swap actually executed at. That depends on the pool's state at the moment the leader ran it, after every earlier transaction in the block.

For a live view this is usually enough: the limit tells you the worst price the sender accepted, and the arrays tell you roughly where they expected the price to be. For settled numbers, take the token balance changes from RPC after confirmation, or the program's own event if it emits one. [Instruction data versus logs](https://solanashreds.xyz/learn/logs-vs-instruction-data) compares the two sources.

## Questions about concentrated liquidity

### Is a DLMM bin the same as a tick?

Not quite. A tick marks a boundary where a position's liquidity starts or stops, and the price moves smoothly between ticks. A DLMM bin is a single fixed price, and a swap inside one bin trades at exactly that price until the bin runs out.

### Why does the same pool need different tick arrays on different swaps?

The arrays a swap needs depend on the current price and on how far the swap may move it. As the price moves, callers pass different arrays.

### Do these pools use the constant-product formula?

Within a single tick range, the tick designs behave like a constant-product pool with extra virtual liquidity. DLMM uses a constant-sum style rule inside each bin, which is why a trade that stays in one bin sees no price change.

## Where instruction data runs out

The instruction tells you what the sender asked for, not what happened. The executed amount, the fee taken and the price after the swap all need confirmed state. Remaining accounts are unlabeled, so identifying an exact tick array means deriving its address or reading the account. And a swap called from another program, such as an aggregator, appears only as an inner instruction, which shreds do not carry.

## Decoding each design

The [Anchor decoding guide](https://solanashreds.xyz/docs/decode/anchor-instructions) turns any of these swaps into named fields with the published IDL, and [account roles](https://solanashreds.xyz/learn/account-roles) explains which accounts a program may write. To watch concentrated pools trade as blocks are produced, [see the plans](https://solanashreds.xyz/pricing).
