Docs, Build

Error reference

Every error the program returns

Every error the program returns. Anchor numbers custom errors from 6000 in declaration order.

Errors

CodeNameMessageWhat to do
6000UnauthorizedSigner is not the adminSign with the admin key.
6001NotPendingAdminSigner is not the pending adminOnly the address named in transfer_admin can accept.
6002NotUpgradeAuthorityInitializer is not the program upgrade authorityInitialize with the program's upgrade authority.
6003InvalidParamsProtocol parameter out of rangeCheck every Params field against its bound.
6004InvalidMarketParamsMarket parameter out of rangeKeep max_leverage x bust_buffer_bps under 10,000 and the impact base at most 50%.
6005InvalidExponentPrice exponent out of rangeUse the feed's own price exponent.
6006OpensPausedNew positions are pausedWait until the admin resumes opens. Closes still work.
6007MarketClosedForOpensThis market is not accepting new positionsPick another market or wait until it reopens.
6008MarginTooSmallMargin below the minimumRaise margin to at least min_margin.
6009InvalidLeverageLeverage must be between 1 and the market maximumPick leverage from 1 to the market maximum.
6010NotionalTooLargePosition notional above the maximumLower margin or leverage.
6011OpenInterestCapOpen interest cap for this side reachedWait for the pool to grow or for open interest on this side to fall.
6012WrongStatusPosition is not in the state this action needsCheck the position's status first.
6013MarketMismatchPosition belongs to another marketPass the position's own market.
6014OwnerMismatchAccount is not the owner'sUse the position owner's token account.
6015ProgramOwnedDestinationPayee may not be an account the program itself controlsPay out to the owner's own token account.
6016OracleWrongOwnerPrice account is not a price this program postedPass a price account posted with post_price.
6017OracleMalformedPrice account data is malformedPass a price account posted with post_price, not another account of this program.
6018OracleNotConfiguredPrice signers are not setThe admin sets the signers with set_oracle_signers before any price can be posted.
6019OracleSignersInvalidSigner list must hold 1 to 3 distinct keys and a threshold between 1 and their countPass one to three distinct keys and a threshold between one and their count.
6020OracleSignatureMissingPrice must follow an ed25519 signature check in the instruction just before itPut the ed25519 signature check right before post_price in the same transaction.
6021OracleSignatureLayoutSignature check does not have the exact layout a price needsBuild the ed25519 check with exactly the threshold number of signatures, the keys and signatures in order, then the one message, every offset reading the check itself.
6022OracleUnknownSignerPrice signed by a key outside the signer setUse signatures from keys in the signer set.
6023OracleDuplicateSignerSame signer counted twiceUse distinct signers.
6024OracleWrongDomainSigned message is not a price for this programPost a message signed for this program.
6025OracleMessageMismatchSigned message does not match the account being postedPass the feed id and second of the signed message.
6026OracleTimesInvalidPrice times must satisfy prev_publish_time < publish_timePost a message whose previous second is earlier than its own.
6027OracleNotPayerOnly the payer can close this price accountClose it with the key that posted it.
6028OracleFeedMismatchPrice update is for another feedUse a price posted for the market's own feed.
6029OraclePriceInvalidPrice must be positiveUse another second.
6030OracleConfidenceTooWidePrice confidence interval too wideThe exchanges disagreed too much that second; use the next one.
6031FillNotFirstAfterTargetFill needs the first signed price at or after the target timePost the first signed second at or after the target time.
6032FillTooLateFill update published too long after the target timeThe fill window passed; cancel the open after the grace.
6033PriceBeforeEntryPrice update predates the position's entryUse a second at or after the entry.
6034PriceAfterExitPrice update is after the pending close's exit timeUse a second no later than the close's fill target.
6035NotLiquidatablePosition is above its liquidation priceThe position is above its bust price.
6036CancelTooEarlyPending open can only be cancelled after its fill window and graceWait for the fill window and the grace to pass.
6037NotQueueHeadPosition is not at the head of the payout queueHarvest the head of the queue first.
6038NothingToHarvestPool has no cash for the queueWait for losses to add cash.
6039QueueNotEmptyPayout queue must be emptyHarvest queued winners first.
6040NoSurplusPool cash is not above the soft capPool cash is under the cap.
6041NoStakersNobody is stakedStake first.
6042StakeLockedStake is still in its cooldownWait for the cooldown to end.
6043InsufficientStakeAmount exceeds the stakeUnstake at most your stake.
6044StakeNotEmptyStake account still holds tokens or rewardsUnstake everything and collect rewards first.
6045NothingToClaimNo rewards to claimNothing has accrued yet.
6046ZeroAmountAmount must be positiveSend a positive amount.
6047MathOverflowArithmetic overflowLower the amounts.
6048EpochStillOpenEmission epoch has not endedWait for the epoch to end.
6049EpochMarketsIncompleteEpoch close needs every market and its price, in index orderPass every market with its price in index order.
6050BuybackTooSoonBuyback called again before its intervalWait buyback_interval_secs.
6051NothingToBuyBackNo USDC in the buyback bucketFees have not reached the bucket yet.
6052BuybackPoolMismatchBuyback pool not set, or not the one configuredPass the configured pool.
6053BuybackSlippageBuyback swap returned less than the minimumRetry when the pool price settles.
NextFAQ