Sqrt Price

DEX & liquidity

Sqrt price is the square root of the actual pool price, stored as a Q64.64 fixed-point number. CLMMs use it because the swap math (delta amount given delta sqrt-price) stays in u128 space without overflow. If you read a Whirlpool or Raydium CLMM pool account, the price field you see is sqrt price, not price. You square it and rescale to get a human number.

Detailed explanation

Concentrated liquidity math is built around an invariant: liquidity L is constant inside a price range. Working in sqrt-price space turns the swap formulas into linear functions of L, which means you can compute exact outputs in fixed-point integer math without ever touching floating point. That matters on Solana because floats are not allowed inside programs.

The Q64.64 format means 64 bits of integer and 64 bits of fractional precision packed into a u128. To convert a sqrt price back to a normal number, you square the u128, divide by 2^128, and scale by the difference between the two token decimals. Most CLMM SDKs ship a helper for this. The Orca Whirlpools SDK exposes sqrtPriceX64ToPrice, the Raydium CLMM SDK exposes SqrtPriceMath.sqrtPriceX64ToPrice.

Sqrt price is also how ticks are indexed. A tick index t maps to sqrt price 1.0001^(t/2). Move one tick and sqrt price moves by a factor of 1.0001^0.5. That is why CLMM tick spacings are powers of two and why off-by-one tick errors create huge price misreads.

One opinion: if your code is computing prices from raw reserves on a CLMM pool, you are doing it wrong. Use the sqrt price field on the pool account; the reserves are scratch space.

When you'll see this

Sqrt price shows up on every CLMM pool account. On Orca Whirlpools the field is sqrt_priceon the Whirlpool account at program whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc. On Raydium CLMM the field is sqrt_price_x64 on the PoolState account at CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK.

How NoLimitNodes uses this

Our Orca and Raydium parsed streams emit both the raw sqrt price and a derived price field for every pool update, so you never have to ship the math yourself. The price field is in token-pair-native units with decimals already applied.

Related terms

  • CLMM · Concentrated Liquidity Market Maker. LPs choose a price range, and capital only earns fees inside that range.
  • Tick Array · An 88-tick storage account in Orca Whirlpools that holds the liquidity bitmap a swap walks across.
  • Whirlpool · The Orca CLMM pool account that stores the active sqrt-price, current liquidity, fee tier, and tick spacing.
  • Position NFT · The non-fungible token that represents ownership of a CLMM liquidity position with its own price range.
  • LB Pair · The Meteora DLMM liquidity-book account that stores the active bin, fee parameters, and the pool reserves.

Canonical references

Ready to get started?

Get your free API key and start building in under 30 seconds.

Talk to Sales