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.

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).
// Example: detect the CPMM slippage error and surface a clean UX message.
const CPMM_EXCEEDED_SLIPPAGE = 6005;

try {
  await sdk.cpmm.swap({ ... });
} catch (err: any) {
  const code = err?.error?.errorCode?.number ?? err?.code;
  if (code === CPMM_EXCEEDED_SLIPPAGE) {
    showToast("Price moved past your slippage tolerance. Increase slippage or retry.");
    return;
  }
  throw err;
}

CPMM (Standard AMM) errors

Program ID: see reference/program-addresses. Source: raydium-cp-swap/programs/cp-swap/src/error.rs.
CodeVariant#[msg] stringTypical causeRecommended UX
6000NotApprovedNot approvedCaller is not the configured authority for an admin instruction.”Only the pool admin can perform this action.”
6001InvalidOwnerInput account owner is not the program addressA passed-in account is owned by the wrong program (often a wrong token program or a wrong-program PDA).”Internal: account owner mismatch — refresh and retry.”
6002EmptySupplyInput token account emptyLP or token account balance is zero at a step that requires a positive amount.”Nothing to withdraw.”
6003InvalidInputInvalidInputGeneric bad argument (amount out of range, wrong flag).”Invalid input — check amounts and try again.”
6004IncorrectLpMintAddress of the provided lp token mint is incorrectThe LP mint account passed in does not match pool_state.lp_mint.”Internal: wrong LP mint — refresh pool data.”
6005ExceededSlippageExceeds desired slippage limitThe executed price is worse than the user’s minAmountOut / maxAmountIn.”Price moved past your slippage tolerance. Increase slippage or retry.”
6006ZeroTradingTokensGiven pool token amount results in zero trading tokensDeposit / withdraw math rounded one side to zero (position too small).”Amount is below the minimum for this pool.”
6007NotSupportMintNot support token_2022 mint extension (grammar in source)Pool encountered a Token-2022 extension it cannot handle safely (e.g. TransferHook, DefaultAccountState=Frozen).”This token has an extension Raydium does not support in CPMM.”
6008InvalidVaultinvaild vault (typo in source)The passed vault account does not match the one recorded in pool_state.”Internal: wrong vault — refresh and retry.”
6009InitLpAmountTooLessInit lp amount is too less(Because 100 amount lp will be locked) (grammar in source)At pool initialization, the computed LP supply is below the permanent-lock amount.”Initial liquidity too small. Increase deposit.”
6010TransferFeeCalculateNotMatchTransferFee calculate not matchThe observed post-transfer amount for a Token-2022 fee mint did not match the pre-computed expectation.”Token transfer fee changed mid-transaction. Retry.”
6011MathOverflowMath overflowAn intermediate swap / deposit / fee calculation overflowed.”Amount is too large for this pool.”
6012InsufficientVaultInsufficient vaultPool vault balance is too low to cover the requested output.”Not enough liquidity in the pool for this size.”
6013InvalidFeeModelInvalid fee modelAdmin set an AmmConfig parameter combination that is rejected on-chain.N/A — admin-only path.
6014NoFeeCollectFee is zerocollect_protocol_fee / collect_fund_fee called with zero collectable fees.N/A — admin path; tooling should swallow.
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.
CodeVariant#[msg] stringTypical causeRecommended UX
6000NotApprovedNot approvedCaller is not the configured admin for this instruction.”Only the pool admin can perform this action.”
6001InvalidUpdateConfigFlaginvalid update amm config flagAdmin passed an unrecognized param value to update_amm_config.N/A — admin-only path.
6002AccountLackAccount lackRequired remaining account missing from the tx (typically tick-array or oracle extension).”Internal: missing account — refresh pool data.”
6003ClosePositionErrRemove liquidity, collect fees owed and reward then you can close position accountTried to close a position that still has liquidity, uncollected fees, or uncollected rewards.”Withdraw all liquidity and claim fees/rewards before closing the position.”
6004InvalidTickIndexTick out of rangetick_lower or tick_upper is outside [-443636, 443636].”Price range out of bounds for this pool.”
6005TickInvalidOrderThe lower tick must be below the upper ticktick_lower >= tick_upper.”Lower price must be below upper price.”
6006TickLowerOverflowThe tick must be greater, or equal to the minimum tick(-443636)Lower tick underflow.”Lower price too low.”
6007TickUpperOverflowThe tick must be lesser than, or equal to the maximum tick(443636)Upper tick overflow.”Upper price too high.”
6008TickAndSpacingNotMatchtick % tick_spacing must be zeroSubmitted tick is not a multiple of the pool’s tick_spacing.”Snap price to the nearest valid increment.”
6009InvalidTickArrayInvalid tick array accountWrong PDA passed for a tick-array slot.”Internal: wrong tick array — refresh pool data.”
6010InvalidTickArrayBoundaryInvalid tick array boundaryOff-by-one in tick-array indexing.”Internal: tick-array boundary error.”
6011SqrtPriceLimitOverflowSquare root price limit overflowCaller-supplied sqrt_price_limit outside valid range.”Price limit out of range.”
6012SqrtPriceX64sqrt_price_x64 out of rangePool’s current sqrt price drifted out of range mid-swap.”Retry swap.”
6013LiquiditySubValueErrLiquidity sub delta L must be smaller than beforeInternal invariant violation on decrease-liquidity.”Internal: liquidity accounting error.”
6014LiquidityAddValueErrLiquidity add delta L must be greater, or equal to beforeInternal invariant violation on increase-liquidity.”Internal: liquidity accounting error.”
6015ForbidBothZeroForSupplyLiquidityBoth token amount must not be zero while supply liquidityIncrease-liquidity call with both amount_0_max and amount_1_max zero.”Provide at least one token.”
6016LiquidityInsufficientLiquidity insufficientPosition does not have enough liquidity to satisfy the withdrawal.”Withdraw amount exceeds position liquidity.”
6017PriceSlippageCheckPrice slippage checkExecution price failed the caller’s slippage guard.”Price moved past your slippage tolerance. Increase slippage or retry.”
6018TooLittleOutputReceivedToo little output receivedSwapBaseInput: out amount below other_amount_threshold.”Slippage exceeded — minimum output not met.”
6019TooMuchInputPaidToo much input paidSwapBaseOutput: in amount above other_amount_threshold.”Slippage exceeded — maximum input exceeded.”
6020ZeroAmountSpecifiedSwap special amount can not be zeroZero amount on a swap instruction.”Enter an amount greater than zero.”
6021InvalidInputPoolVaultInput pool vault is invalidSwap’s input-vault account does not match the pool’s recorded vault.”Internal: wrong input vault — refresh pool data.”
6022TooSmallInputOrOutputAmountSwap input or output amount is too smallSwap math rounded to zero, typically very small dust.”Amount too small to swap in this pool.”
6023NotEnoughTickArrayAccountNot enough tick array accountNot enough tick-array remaining accounts supplied for the swap range.”Internal: insufficient tick-arrays — refresh pool data.”
6024InvalidFirstTickArrayAccountInvalid first tick array accountThe first tick-array account passed does not cover the current tick.”Internal: wrong first tick array — refresh pool data.”
6025InvalidRewardIndexInvalid reward indexreward_index outside [0, 2].N/A — admin path.
6026FullRewardInfoThe init reward token reach to the maxPool already has the max (3) reward mints configured.N/A — admin path.
6027RewardTokenAlreadyInUseThe init reward token already in useReward mint duplicates an existing one.N/A — admin path.
6028ExceptRewardMintThe reward tokens must contain one of pool vault mint except the last rewardPre-slot 2, reward mint must equal one of the pool’s vault mints.N/A — admin path.
6029InvalidRewardInitParamInvalid reward init paramBad emission start/end time or per-second rate.N/A — admin path.
6030InvalidRewardInputAccountNumberInvalid collect reward input account numberWrong number of remaining accounts passed to CollectReward.”Internal: wrong account count — refresh and retry.”
6031InvalidRewardPeriodInvalid reward periodReward emission period invalid (end <= start, zero duration).N/A — admin path.
6032NotApproveUpdateRewardEmissionsModification of emissions is allowed within 72 hours from the end of the previous cycleAdmin tried to modify emissions outside the 72-hour window around cycle boundaries.N/A — admin path.
6033UnInitializedRewardInfouninitialized reward infoReward slot not initialized but referenced.N/A — admin path.
6034NotSupportMintNot support token_2022 mint extensionCLMM encountered a Token-2022 extension it cannot handle.”This token has an extension Raydium CLMM does not support.”
6035MissingTickArrayBitmapExtensionAccountMissing tickarray bitmap extension accountSwap crossed a tick range not covered by the base bitmap; extension bitmap account required.”Internal: missing tick-array extension — refresh pool data.”
6036InsufficientLiquidityForDirectionInsufficient liquidity for this directionNot enough liquidity exists in the direction of the swap.”Insufficient liquidity for this swap size.”
6037MaxTokenOverflowMax token overflowInput/output amount exceeded u64.”Amount too large for this pool.”
6038CalculateOverflowCalculate overflowFee / liquidity arithmetic overflow.”Amount too large for this pool.”
6039TransferFeeCalculateNotMatchTransferFee calculate not matchToken-2022 transfer fee observed amount did not match expected.”Token transfer fee changed mid-transaction. Retry.”
6040OrderAlreadyFilledOrder already fully filled, cannot modifyIncreaseLimitOrder / DecreaseLimitOrder called on an order whose unfilled portion is zero.”This limit order is already filled — settle to receive output.”
6041InvalidOrderPhaseInvalid order phaseMutating an order whose FIFO cohort phase no longer matches the tick’s current cohort.”Cannot perform this action in the order’s current state.”
6042InvalidLimitOrderAmountInvalid limit order amountOrder input below the pool’s minimum (or zero) at open / increase / decrease time.”Order size is below the pool’s minimum.”
6043OrderPhaseSaturatedTick order phase saturatedThe cohort’s order_phase counter on the tick has saturated; further orders cannot be opened at that tick until existing cohorts settle and roll over.”Too many active orders at this price; try a nearby tick or wait for orders to settle.”
6044InvalidDynamicFeeConfigParamsInvalid dynamic fee config paramsCreateDynamicFeeConfig / UpdateDynamicFeeConfig rejected; or CreateCustomizablePool enabled dynamic fee without a valid config.N/A on admin path; “Dynamic fee config invalid” on user path.
6045InvalidFeeOnInvalid fee on which token (must be 0, 1, or 2)CreateCustomizablePool passed a collect_fee_on value outside {0, 1, 2}.”Internal: invalid fee mode.”
6046ZeroSqrtPricesqrt_price_x64 must be greater than 0CreateCustomizablePool (or another path that accepts a customizable initial sqrt price) was called with sqrt_price_x64 == 0.”Initial price must be greater than zero.”
6047ZeroLiquidityliquidity must be greater than 0A liquidity-providing path was called with liquidity == 0 and no compensating amount.”Liquidity amount must be greater than zero.”
6048MissingBaseFlagbase_flag is required when liquidity is zeroAn open-position-by-amount path computed liquidity == 0 and the caller did not supply a base_flag to disambiguate which side is the base.”Provide either a non-zero liquidity or specify which token is the base.”
6049MissingMintAccountMint account is required but not providedA Token-2022-aware path was called without the input/output mint account that’s needed to validate extensions and transfer fees.”Internal: missing mint account — refresh pool data.”
6050MissingTokenProgram2022Token-2022 program is required but not providedSame as above for the SPL-Token-2022 program account.”Internal: missing Token-2022 program — refresh and retry.”
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:
ProgramCode range (Anchor only)Reference
AMM v4Custom u32 codes, not Anchor-styleproducts/amm-v4/instructions
Farm v3 / v5Custom u32 codesproducts/farm-staking/instructions
Farm v66000+ (Anchor)products/farm-staking/instructions
LaunchLab6000+ (Anchor)products/launchlab/instructions

Mapping SDK errors to program errors

The official TypeScript SDK wraps on-chain errors into SendTransactionError and, for Anchor programs, AnchorError:
import { AnchorError } from "@coral-xyz/anchor";

try {
  await sdk.cpmm.swap({ ... });
} catch (err) {
  if (err instanceof AnchorError) {
    console.log(err.error.errorCode.number, err.error.errorCode.code, err.error.errorMessage);
    // 6005 ExceededSlippage "Exceeds desired slippage limit"
  } else {
    // Raw SendTransactionError — inspect err.logs for the "custom program error: 0x..." line.
  }
}
If you are not using Anchor client-side, parse the transaction logs:
Program <ProgramID> invoke [1]
Program log: AnchorError caused by account: pool_state. Error Code: ExceededSlippage. Error Number: 6005. Error Message: Exceeds desired slippage limit.
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:
# Clone and grep the error enum in order.
git clone --depth=1 https://github.com/raydium-io/raydium-cp-swap
awk '/#\[msg\(/{ gsub(/^[ \t]*#\[msg\("|"\)\][ \t]*/,""); m=$0; getline; gsub(/,/,""); gsub(/^[ \t]+/,""); print "6000+++\t" $0 "\t" m }' \
  raydium-cp-swap/programs/cp-swap/src/error.rs
# Replace 6000+++ with monotonically-increasing 6000,6001,... Append new rows to the table above.
Always update reference/changelog when a new variant is added, so integrators upgrading the SDK know to refresh their error handlers. Sources: