Every error the program returns. Anchor numbers custom errors from 6000 in declaration order.
Errors
| Code | Name | Message | What to do |
|---|---|---|---|
| 6000 | Unauthorized | Signer is not the admin | Sign with the admin key. |
| 6001 | NotPendingAdmin | Signer is not the pending admin | Only the address named in transfer_admin can accept. |
| 6002 | NotUpgradeAuthority | Initializer is not the program upgrade authority | Initialize with the program's upgrade authority. |
| 6003 | InvalidParams | Protocol parameter out of range | Check every Params field against its bound. |
| 6004 | InvalidMarketParams | Market parameter out of range | Keep max_leverage x bust_buffer_bps under 10,000 and the impact base at most 50%. |
| 6005 | InvalidExponent | Price exponent out of range | Use the feed's own price exponent. |
| 6006 | OpensPaused | New positions are paused | Wait until the admin resumes opens. Closes still work. |
| 6007 | MarketClosedForOpens | This market is not accepting new positions | Pick another market or wait until it reopens. |
| 6008 | MarginTooSmall | Margin below the minimum | Raise margin to at least min_margin. |
| 6009 | InvalidLeverage | Leverage must be between 1 and the market maximum | Pick leverage from 1 to the market maximum. |
| 6010 | NotionalTooLarge | Position notional above the maximum | Lower margin or leverage. |
| 6011 | OpenInterestCap | Open interest cap for this side reached | Wait for the pool to grow or for open interest on this side to fall. |
| 6012 | WrongStatus | Position is not in the state this action needs | Check the position's status first. |
| 6013 | MarketMismatch | Position belongs to another market | Pass the position's own market. |
| 6014 | OwnerMismatch | Account is not the owner's | Use the position owner's token account. |
| 6015 | ProgramOwnedDestination | Payee may not be an account the program itself controls | Pay out to the owner's own token account. |
| 6016 | OracleWrongOwner | Price account is not a price this program posted | Pass a price account posted with post_price. |
| 6017 | OracleMalformed | Price account data is malformed | Pass a price account posted with post_price, not another account of this program. |
| 6018 | OracleNotConfigured | Price signers are not set | The admin sets the signers with set_oracle_signers before any price can be posted. |
| 6019 | OracleSignersInvalid | Signer list must hold 1 to 3 distinct keys and a threshold between 1 and their count | Pass one to three distinct keys and a threshold between one and their count. |
| 6020 | OracleSignatureMissing | Price must follow an ed25519 signature check in the instruction just before it | Put the ed25519 signature check right before post_price in the same transaction. |
| 6021 | OracleSignatureLayout | Signature check does not have the exact layout a price needs | Build 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. |
| 6022 | OracleUnknownSigner | Price signed by a key outside the signer set | Use signatures from keys in the signer set. |
| 6023 | OracleDuplicateSigner | Same signer counted twice | Use distinct signers. |
| 6024 | OracleWrongDomain | Signed message is not a price for this program | Post a message signed for this program. |
| 6025 | OracleMessageMismatch | Signed message does not match the account being posted | Pass the feed id and second of the signed message. |
| 6026 | OracleTimesInvalid | Price times must satisfy prev_publish_time < publish_time | Post a message whose previous second is earlier than its own. |
| 6027 | OracleNotPayer | Only the payer can close this price account | Close it with the key that posted it. |
| 6028 | OracleFeedMismatch | Price update is for another feed | Use a price posted for the market's own feed. |
| 6029 | OraclePriceInvalid | Price must be positive | Use another second. |
| 6030 | OracleConfidenceTooWide | Price confidence interval too wide | The exchanges disagreed too much that second; use the next one. |
| 6031 | FillNotFirstAfterTarget | Fill needs the first signed price at or after the target time | Post the first signed second at or after the target time. |
| 6032 | FillTooLate | Fill update published too long after the target time | The fill window passed; cancel the open after the grace. |
| 6033 | PriceBeforeEntry | Price update predates the position's entry | Use a second at or after the entry. |
| 6034 | PriceAfterExit | Price update is after the pending close's exit time | Use a second no later than the close's fill target. |
| 6035 | NotLiquidatable | Position is above its liquidation price | The position is above its bust price. |
| 6036 | CancelTooEarly | Pending open can only be cancelled after its fill window and grace | Wait for the fill window and the grace to pass. |
| 6037 | NotQueueHead | Position is not at the head of the payout queue | Harvest the head of the queue first. |
| 6038 | NothingToHarvest | Pool has no cash for the queue | Wait for losses to add cash. |
| 6039 | QueueNotEmpty | Payout queue must be empty | Harvest queued winners first. |
| 6040 | NoSurplus | Pool cash is not above the soft cap | Pool cash is under the cap. |
| 6041 | NoStakers | Nobody is staked | Stake first. |
| 6042 | StakeLocked | Stake is still in its cooldown | Wait for the cooldown to end. |
| 6043 | InsufficientStake | Amount exceeds the stake | Unstake at most your stake. |
| 6044 | StakeNotEmpty | Stake account still holds tokens or rewards | Unstake everything and collect rewards first. |
| 6045 | NothingToClaim | No rewards to claim | Nothing has accrued yet. |
| 6046 | ZeroAmount | Amount must be positive | Send a positive amount. |
| 6047 | MathOverflow | Arithmetic overflow | Lower the amounts. |
| 6048 | EpochStillOpen | Emission epoch has not ended | Wait for the epoch to end. |
| 6049 | EpochMarketsIncomplete | Epoch close needs every market and its price, in index order | Pass every market with its price in index order. |
| 6050 | BuybackTooSoon | Buyback called again before its interval | Wait buyback_interval_secs. |
| 6051 | NothingToBuyBack | No USDC in the buyback bucket | Fees have not reached the bucket yet. |
| 6052 | BuybackPoolMismatch | Buyback pool not set, or not the one configured | Pass the configured pool. |
| 6053 | BuybackSlippage | Buyback swap returned less than the minimum | Retry when the pool price settles. |