Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.raydium.io/llms.txt

Use this file to discover all available pages before exploring further.

Who this chapter is for

Protocol researchers, auditors, and advanced integrators who want to understand the why behind the math rather than just call the instructions. Product pages give a summary and defer here for derivations.

Chapter contents

Constant product (xy=k)

Invariant, marginal price, swap input/output formulas, slippage as a function of trade size.

CLMM math

Sqrt-price representation, liquidity ↔ amount conversion, single-tick swap step, fee-growth accumulator, multi-tick swap iteration.

Bonding curves

LaunchLab’s curve formula(s), graduation threshold derivation, continuous vs. discrete pricing.

Slippage and price impact

Definitions, how SDK computes minAmountOut, what “price impact” means across AMM types, MEV considerations.

Token-2022 transfer fees

How a transfer-fee-bearing token changes the effective swap input and output amounts, and how the CPMM/CLMM programs handle it.

Impermanent loss

IL formulas for CPMM and CLMM, worked examples, and the break-even fee APR thresholds every LP should know.

Estimating CLMM APR

How Raydium computes the APR shown on CLMM pools and how to project APR for a prospective range before opening it.

Writing brief

  • Use LaTeX-style math sparingly; show formulas as code blocks with inline prose.
  • Every formula is followed by a worked numeric example.
  • Every page has a “Where this is implemented” section that points to the relevant line range in the on-chain program source, for auditors.
  • Do not re-derive the same formulas on product pages — link here.