Skip to main content
Source of truth. The tables below are regenerated from each program’s error.rs in the public Raydium repositories. When a program is upgraded and a new variant is added, re-run the extraction (link at the bottom of each table) and append to the table rather than reshuffling — Anchor error codes are assigned by source order, not name, so rearranging breaks integrator error-handling.

How Anchor error codes work

Anchor assigns each variant of a program’s ErrorCode enum a numeric code starting at 6000. A failing transaction surfaces:
  • Numeric error code (e.g. 0x1771 = 6001) in the transaction logs.
  • Error name (e.g. InvalidOwner) from the IDL.
  • #[msg(...)] string that Anchor emitted in log_messages.
Integrators should match on the numeric code, not the message string (the string can be re-worded without bumping a version).

CPMM (Standard AMM) errors

Program ID: see reference/program-addresses. Source: raydium-cp-swap/programs/cp-swap/src/error.rs. Regeneration source: github.com/raydium-io/raydium-cp-swap — error.rs.

CLMM errors

Program ID: see reference/program-addresses. Source: raydium-clmm/programs/amm/src/error.rs.
Note on renumbering. The CLMM ErrorCode enum was renumbered in this release: five legacy variants (LOK, ZeroMintAmount, InvalidLiquidity, TransactionTooOld, InvalidRewardDesiredAmount) and several typos (Liquitity, enought, emissiones) were removed/fixed, and eleven new variants were appended. Because Anchor numbers errors by source order, every code at or after 6000 has shifted relative to pre-release builds. Clients that hard-coded numeric codes against an earlier version need to remap.
Regeneration source: github.com/raydium-io/raydium-clmm — error.rs.

AMM v4, Farm v3 / v5 / v6, LaunchLab errors

These programs are documented in their respective chapters (see products/amm-v4/instructions, products/farm-staking/instructions, products/launchlab/instructions). Because those programs use a mix of Anchor and plain Solana error surfaces, their error tables live next to the instruction reference rather than here. The codes below are reserved by those chapters:

Mapping SDK errors to program errors

The official TypeScript SDK wraps on-chain errors into SendTransactionError and, for Anchor programs, AnchorError:
If you are not using Anchor client-side, parse the transaction logs:
The pattern Error Number: (\d+) is stable across Anchor versions and safe to match.

Regenerating these tables

When a program is upgraded and adds a new error, re-extract from source:
Always update reference/changelog when a new variant is added, so integrators upgrading the SDK know to refresh their error handlers. Sources: