- Name the pool design behind each major Solana DEX program
- Calculate a price from each design's on-chain state
- Choose which pools to track for trading, analytics or LP research
In this lesson
Raydium, Orca, Meteora and PumpSwap all let you swap one token for another, but they don't price trades the same way. Under the hood there are four designs: constant product pools, concentrated liquidity, liquidity bins and bonding curves. The design decides how the price moves, how liquidity providers earn, and what you have to decode to read a swap. This lesson puts them side by side.
01Why the pool type matters#
If you trade, the pool type decides how much the price moves for a given order size. If you provide liquidity, it decides whether your money sits across every price or only a range you pick. If you build dashboards or bots, it decides how you calculate a price from on-chain state, and which events a swap produces.
One more thing trips people up: a “DEX” is often several programs. Raydium alone runs three, each with its own program ID, instructions and math. Tracking “Raydium” means tracking all three.
02At a glance#
03Constant product: Raydium AMM v4, CPMM and PumpSwap#
The oldest and simplest design. The pool holds two reserves, and every swap must keep their product constant: x × y = k. Buy token X and its reserve shrinks, so the next unit of X costs more. Liquidity is spread across every possible price, which makes these pools easy to reason about and hard to break, but means large orders move the price a lot unless the pool is deep.
Liquidity providers deposit both tokens and receive LP tokens for their share. Fees accumulate in the pool and are paid out when they withdraw. Raydium AMM v4 is the classic pool behind much of Solana's memecoin volume. CPMM is Raydium's newer constant product program, which also supports Token-2022 mints. PumpSwap is the constant product AMM that Pump.fun tokens move to when they graduate.
- Reading a swap: the swap instruction gives amounts in and out. Reserves are in the pool's token vaults.
- Watch out for: AMM v4 and CPMM are different programs with different instruction names (
swapvsswapBaseInputandswapBaseOutput).
04Concentrated liquidity: Orca Whirlpool and Raydium CLMM#
In a concentrated liquidity pool, each liquidity provider chooses a price range. Their tokens only trade while the price is inside that range. Liquidity bunches up around the current price, so the same capital gives much less price impact. The trade-off is that a position stops earning fees once the price leaves its range.
The price line is cut into ticks. The pool stores the current price as a square root price in Q64.64 fixed point, and liquidity for ranges of ticks lives in separate tick array accounts. A large swap can cross several ticks and touch several tick arrays. Orca's version is called a Whirlpool, and each position is a position NFT that can be transferred.
- Reading a swap: amounts plus the new sqrt price. Liquidity changes come from separate instructions such as
openPosition,increaseLiquidityanddecreaseLiquidity. - Watch out for: the fee tier is tied to the tick spacing, so the same pair can have several pools with different fees.
05Liquidity bins: Meteora DLMM#
Meteora's DLMM splits the price line into bins. Inside a bin the price is fixed, so a swap that stays in one bin has no price impact at all. When a bin runs out of one token, the swap moves to the next bin and the price steps up or down by the bin step, set in basis points per pool. The bin currently trading is the active bin.
Each pool is an LB pair account, and bin liquidity is stored in bin arrays. Liquidity providers choose which bins to fill and in what shape. Meteora offers spot, curve and bid-ask distributions. DLMM fees also have a variable part that rises when the price is volatile, so providers earn more during busy periods.
- Reading a swap: amounts plus the active bin ID. With the bin step, that gives you the exact price, with no reserve maths.
- Watch out for: fees change with volatility, so you can't assume a fixed fee rate per pool.
06Bonding curves: Pump.fun, then PumpSwap#
A Pump.fun token starts life on a bonding curve, not in a pool. There are no liquidity providers. The program itself sells tokens and buys them back, pricing each trade with constant product maths on virtual reserves, which are starting amounts that set the opening price without anyone depositing them.
When the curve's tokens are sold out, the token graduates. The program moves the real SOL and remaining tokens into a PumpSwap pool, and from then on the token trades like any other constant product pair. Earlier tokens graduated to Raydium instead, so historical analysis has to handle both.
07What this means for your data#
If you're building a price feed, a pool tracker or a trading bot, each design needs its own handling:
Three habits keep multi-DEX data clean:
- Normalise early. Turn every swap into one shape (pool, mints, amounts, price, slot, signature) as soon as you decode it.
- Always apply decimals. On-chain amounts are raw integers. A price that looks off by a factor of 1,000 almost always means decimals were missed.
- Track new pools too. New pairs appear every minute across all of these programs. Our new-pool alert bot walkthrough shows how to catch them.
08Which pools should you track?#
- Memecoin activity: Pump.fun and PumpSwap first, then Raydium AMM v4 and CPMM.
- Major pairs and stablecoins: Orca Whirlpools, Raydium CLMM and Meteora DLMM hold most of the concentrated liquidity.
- Best execution: all of them, or an aggregator such as Jupiter, which routes across them.
- LP analytics: concentrated and bin pools, where position ranges and fee claims tell the real story.
Q1Which pool design stores the current price as a square root in Q64.64 fixed point?
Q2In a Meteora DLMM pool, what happens to the price during a swap that stays inside one bin?
Q3Your computed price is 1,000 times too high. What is the most likely cause?
Frequently asked questions#
What is the difference between Raydium AMM v4 and CPMM?
Both are constant product pools, but they are separate programs with different instructions. CPMM is Raydium's newer program and supports Token-2022 mints. Track both to see all of Raydium's constant product volume.
How is Meteora DLMM different from a CLMM?
Both concentrate liquidity, but DLMM uses bins with one fixed price each, so a swap inside a bin has no price impact. A CLMM uses ticks and a continuous curve. DLMM fees also rise with volatility.
Why does a Pump.fun token have no liquidity providers before graduation?
Before graduation the program itself sells and buys tokens along a bonding curve, priced from virtual reserves. Liquidity providers only appear once the token moves to a PumpSwap pool.
Where can I get Meteora data in real time?
You can subscribe to the Meteora DLMM program with Yellowstone gRPC and decode swaps yourself, or use a decoded Meteora stream that sends swaps and liquidity events with named fields such as the active bin.