Solana Programs

Automated Market Makers (AMMs)

Overview of AMM types and implementations on Solana

Automated Market Makers (AMMs) are decentralized exchange protocols that use mathematical formulas to price assets and enable trustless token swaps without traditional order books. Each AMM type is optimized for different use cases.

AMM Types

Constant Product AMM (CPAMM)

Classic x * y = k formula used by Uniswap V2 and Raydium CPAMM. Simple and efficient for most trading pairs.

Formula:

x * y = k

Examples:

Raydium CPAMM
Token Swap Program

Stable Swap AMM

Optimized for stablecoin pairs with minimal slippage. Uses amplification coefficient for better price stability.

Formula:

Curve-style StableSwap

Examples:

Saber StableSwap

Concentrated Liquidity AMM (CLMM)

Allows liquidity providers to concentrate capital within custom price ranges for better capital efficiency.

Formula:

Uniswap V3 style

Examples:

Orca Whirlpools
Raydium CLMM

Key Concepts

Liquidity Pools

Smart contracts that hold token reserves and facilitate swaps based on the AMM formula.

Slippage

The difference between expected and actual execution price, influenced by trade size and pool depth.

Impermanent Loss

Temporary loss of funds when providing liquidity compared to simply holding the tokens.

LP Tokens

Tokens representing your share of the liquidity pool, used to redeem your position plus fees.