Skip to main content
Each table mirrors the Rust #[error_code] enum exactly. For kimia-perp, codes are explicitly pinned at the start of each bucket; Anchor auto-increments within a bucket, so a code number not listed here is not used.

kimia-perp

Defined in Perp-engine/programs/kimia-perp/src/errors.rs.

Oracle

CodeNameMeaning
6000StaleOraclePrice older than oracle_staleness_threshold
6001OracleConfidenceTooWideConfidence exceeds oracle_confidence_max_bps
6002InvalidOraclePricePrice ≤ 0 or account misowned

Market

CodeName
6010MarketNotActive
6011MarketNotPaused
6012MarketAlreadyExists

Margin

CodeName
6020InsufficientMargin
6021WithdrawalExceedsMargin
6022ExceedsMaxLeverage

Position

CodeName
6030NoPosition
6031CloseExceedsPosition
6032ZeroSize
6033InvalidDirection

Funding

CodeName
6040FundingTooEarly
6041FundingAlreadySettled

Liquidation

CodeName
6050NotLiquidatable
6051LiquidationTooLarge

Deposit / Withdraw

CodeName
6060ZeroDeposit
6061InsufficientCollateral

Math / Auth

CodeName
6070MathOverflow
6080Unauthorized
6081InvalidDelegate

Slippage / Insurance

CodeName
6090SlippageExceeded
6100InsuranceInsufficient

Orderbook

CodeName
6110OrderbookFull
6111OrderNotFound
6112OrderWouldCross
6113OrderPriceOutOfRange
6114MissingCounterparty
6115InvalidTickSize
6116InsufficientFreeCollateral
6117MarketOrderSlippage

Spot pool

CodeName
6130SpotPoolPaused
6131SpotPoolInsufficientLiquidity
6132SpotSwapSlippageExceeded
6133SpotSwapZeroAmount

delta-vault

Defined in Programs/programs/delta-vault/src/errors.rs. Codes auto-increment from 6000 in the order shown.
NameMeaning
VaultNotActiveVault is not in Active state
VaultNotPausedVault is not in Paused state
ZeroDepositDeposit amount must be greater than zero
InsufficientSharesInsufficient shares for withdrawal
StaleOracleOracle price is stale (age > 30 s)
OracleConfidenceTooWideOracle price confidence too wide (> 1%)
MathOverflowMath overflow
UnauthorizedNot vault authority
ZeroInsuranceSeedInsurance fund seed amount must be greater than zero
InsufficientLiquidityInsufficient pool liquidity for withdrawal
DeltaExceedsThresholdDelta exceeds rebalance threshold
InvalidParameterInvalid parameter value
NavCorruptedNAV invariant violated. Call admin_resync_nav
PerpsUserAccountAlreadyInitPerps user account already initialized
PerpsUserAccountNotInitCall init_perps_user_account first
PerpsMarketMismatchProvided market does not match vault.perps_market
PerpsMarketIndexMismatchPerps market index mismatch
PerpsUserAccountMismatchPerps user account PDA mismatch
NoHedgePositionNo hedge position open to close
SpotPoolMismatchSpot pool does not match vault.spot_pool
WsolVaultMismatchwSOL vault does not match vault.wsol_vault
InsufficientWsolInsufficient wSOL balance for withdrawal
VaultNotMigratedSpot leg not configured; call admin_setup_spot_leg first
SpotLegAlreadySetupSpot leg already configured

split-engine

Defined in Programs/programs/split-engine/src/errors.rs.
NameMeaning
NotMaturedMarket has not reached maturity
AlreadyMaturedMarket has already matured
ZeroDepositDeposit amount must be greater than zero
SupplyInvariantViolatedPT/YT supply invariant violated
NoYieldToClaimNo yield to claim
MathOverflowMath overflow

yield-amm

Defined in Programs/programs/yield-amm/src/errors.rs.
NameMeaning
SwapDisabledNearMaturityPool is near maturity (t < 0.001)
SlippageExceededOutput less than minimum
InsufficientLiquidityInsufficient liquidity in pool
EmptyPoolPool is empty
MathOverflowMath overflow
InvalidPoolConfigInvalid pool configuration
ZeroAmountZero amount
MaturityInPastMaturity must be in the future
InvalidDurationInvalid duration
AlreadyMaturedPool already matured
InvariantViolatedInvariant violated after swap

intent-router

Defined in Programs/programs/intent-router/src/errors.rs.
NameMeaning
InvalidSessionStateStep must follow Created → Step1 → Step2 → Step3
TargetRateNotAchievableTarget rate not achievable at current market prices
SessionCompletedSession already completed
NotSessionOwnerNot session owner
MathOverflowMath overflow
ZeroAmountZero amount
NoSharesReceivedNo vault shares received from deposit
NoTokensReceivedNo PT/YT received from split
SlippageExceededSlippage exceeded on swap
PtBalanceMismatchPT balance after swap doesn’t match claimed pt_sold
UnderlyingBalanceInsufficientUser underlying balance < claimed underlying_received
TargetRateNotAchievedAchieved fixed rate below session target
NoSwapPerformedSwap reported zero PT sold or zero underlying received
NegativeDiscountUnderlying received exceeds PT face value
InvalidDurationSession duration must be greater than zero