Appearance
Errors
Program errors appear in transaction logs as Error Code: <Name> or custom program error: 0x…. Codes 6000–6039 are this program's declared errors, listed below. A transaction can also fail in the Anchor framework (for example an address constraint, an account that already exists or hasn't been created), in Solana itself (insufficient SOL for fees or rent), or in a program this one calls (SPL Token, System Program). Numeric custom error codes are only unique per program, so check the logs to see which program emitted the error.
Errors traders can hit
| Code | Name | Cause | What to do |
|---|---|---|---|
| 6001 | InvalidParam | Deposit or withdrawal of 0; stake or unstake of 0 or more than your unstaked/staked balance; a session key that is your own wallet or the null key; a session expiry at or before the current time, or more than 30 days away | Fix the amount or expiry |
| 6002 | Paused | New opens are paused (request or fill) | Wait. Closes, withdrawals and staking still work. A pending open that fails its fill stays pending: it can still fill if the pause is lifted before its deadline, otherwise it expires and cancelling it refunds the margin. |
| 6003 | MarketRetired | The market takes no new opens | Trade another market; you can still close existing positions |
| 6004 | LeverageTooHigh | Leverage is 0 or above the market's max_leverage | Use 1 to max_leverage |
| 6005 | InsufficientBalance | Margin or withdrawal is larger than your available balance | Deposit, or lower the amount. Pending margin and queued wins aren't available. |
| 6006 | OiCap | At request: live + pending + your order would exceed the side's limit (equal is allowed). At fill: live + pending, which already includes your order, exceeds the ceiling or brake after one was lowered. | Try a smaller size, or retry later; the trailing limit rises with open interest |
| 6015 | Unauthorized | The signer is neither the account owner nor a live session key, often because the session key expired or was revoked | Re-enable 1-click trading, or sign with your wallet |
| 6018 | RequestExpired | A fill was attempted after expires_ts | Cancel the request to get your refund |
| 6019 | RequestNotExpired | Cancel attempted at or before expires_ts | Wait until after expires_ts; until then the request can still fill. Ordinary cancellation always needs expiry (an inadmissible close can be voided instead). |
| 6020 | MarginTooSmall | Margin below the market's min_margin | Increase margin |
| 6021 | PositionTooLarge | margin × leverage above max_position_notional | Lower margin or leverage |
| 6022 | TraderNotionalCap | Your open plus pending notional would exceed max_trader_notional | Close positions or wait for pending opens to resolve |
| 6027 | MarketSettled | The market has a final settlement price, so new close requests and liquidations are refused. A close requested before the settlement pin still fills at its own pin. (Governance also gets this error for a second settlement or for un-retiring a settled market.) | The position is closed with settle_retired, which anyone can call. The Papersol keeper calls it automatically, and the app has a Settle button. |
| 6029 | NotLaunched | Deposit, open or governance proposal before launch | Wait for launch |
| 6030 | StaleHeartbeat | The market's oracle watermark is more than 60 s old, or there has never been one | Retry shortly. If it persists, the market has no recent accepted oracle observation: Pyth updates may be unavailable or inadmissible, posting may be failing, or keepers may be down. Withdrawals still work. |
| 6031 | ClosePending | The position already has a pending close. (For liquidators: the price was published at or after that close's pin. For settle_retired: a settled market's position with a pending close isn't settled until that close is filled, voided, or expired and cancelled.) | Wait for the close to fill, or for it to expire, then cancel it |
| 6035 | BadDestination | Withdrawal (or dev-fee claim) destination is the vault | Withdraw to your own USDC account |
| 6036 | ClockLag | The oracle watermark is more than 5 s ahead of the Solana clock, which means the clock is lagging | Retry when the clock catches up |
| 6038 | SamplesExceeded | The request would use more price samples than you allowed. This can't happen in production builds, which always use one sample. | Re-quote and resubmit |
| 6039 | SettlementPending | The retired market has a pending settlement, and your close would be pinned at or after its settlement pin | Nothing to do: once the settlement executes, the position settles at the market's final price. The Papersol keeper calls settle_retired automatically, and the app has a Settle button. |
Errors fillers, liquidators and integrators can hit
| Code | Name | Cause |
|---|---|---|
| 6000 | Overflow | Checked arithmetic overflowed or underflowed, including when a positive oracle price or confidence is too large to normalize to 8 decimals in a u64 |
| 6008 | BadOracle | The price account isn't an authentic, fully verified Pyth update from the hard-coded receiver for this market's feed, or is malformed; its exponent is outside ±18; its price or EMA is non-positive or rounds to 0 at 8 decimals; prev_publish_time > publish_time; or (for fills and voids) it was published more than 60 s ahead of the Solana clock. Also returned by set_mock_price in production builds. |
| 6009 | StalePrice | Liquidation or heartbeat price older than liq_max_age_s |
| 6010 | PriceBeforeRequest | Liquidation price not published after the position's entry price. (The message says "predates the request".) |
| 6011 | PriceUncertain | conf × 10,000 > price × max_conf_bps (50), compared exactly. Fills and heartbeats only; liquidate doesn't apply this check. A fill uses the limit recorded in its request when the request was made. |
| 6012 | NotLiquidatable | The position isn't bust after the confidence band, and isn't underwater at the midpoint |
| 6013 | BadQueueOrder | Harvest claims passed out of FIFO order, or a malformed claim list; or, when a win queues, the claim address for that position (["claim", owner, position_id]) isn't an empty system account |
| 6014 | Mismatch | Accounts don't belong together: request vs position, a wrong claim rent payer or trader in harvest, a wrong or read-only fee recipient (it must be the price update's poster), a missing or wrong position account when cancelling a close, a wrong number of sample accounts; migrate_request on an account that isn't a pre-upgrade request. (A wrong rent-payer account on fills, cancels and closes fails Anchor's address constraint instead.) |
| 6016 | PriceNotPinned | Fill before the pin, or the update isn't the unique first one at or after the pin (for a settlement: at or after the settlement pin) |
| 6017 | EmaDeviation | |price − ema| × 10,000 > ema × max_ema_dev_bps (500), compared exactly. Fills, heartbeats and liquidations. A fill uses the limit recorded in its request when the request was made. |
| 6026 | NotSettled | settle_retired on a market without a settlement price, or a settlement proposal for a market that isn't retired or whose retirement changed |
| 6028 | WrongMarket | Position or proposal refers to a different market than the account passed, or a required market account is missing (cancelling a settlement proposal needs it too); migrate_market on an account that isn't a pre-upgrade market |
| 6037 | CloseFillable | void_close was given a pinned update that is admissible (under the limits recorded in the close request), so this proof can't void the close. Other conditions, such as expiry, may still prevent the close from filling. |
| 6039 | SettlementPending | Also: liquidate with a price published at or after the market's settlement pin; execute_close for a close pinned at or after it |
| 6007 | NotKeeper | Not used. Fills are permissionless and this error is never returned. |
Admin and governance errors
| Code | Name | Cause |
|---|---|---|
| 6015 | Unauthorized | Also: pause, unpause, OI brake, OI limits, cancel proposal or accept admin by the wrong key; a guardian trying to raise the brake; a settlement executed without a price update (the dead-feed path) by anyone but the admin |
| 6023 | AlreadyLaunched | Pre-launch setup instruction after launch, or a second launch |
| 6024 | ProposalNotPending | Proposal already executed or cancelled |
| 6025 | TimelockActive | Executing before eta |
| 6032 | ProposalExpired | Executing more than 7 days after eta |
| 6033 | SettlePriceOutOfRange | Proposed settlement price more than 10% from the last verified oracle price, or no oracle price recorded. Checked at proposal, and again at execution only on the dead-feed path. |
| 6039 | SettlementPending | Also: a SettleMarket proposal for a market that already has a pending one (unless it lapsed unexecuted); cancelling a settlement proposal, or executing a SetMarket that re-opens (retired = false) its market, once the Solana clock or the market's last_oracle_ts has reached 1 h before the pin (2 s in test and devnet-feature builds) and until the settlement lapses (7 days after the pin); executing one before pin + 120 s, or when the market's settlement pin isn't this proposal's eta; the dead-feed path less than 24 h after the pin, or after an update at or after the pin was recorded |
| 6034 | NotUpgradeAuthority | initialize not signed by the program's upgrade authority |
| 6001 | InvalidParam | Also: any parameter outside its program bounds (Markets and parameters), including, in production builds, reward_stream_s under 3,600 s or pin_delay_s under 4 s; launch with a timelock under 24 h (production builds); a SetTimelockDelay below the lesser of the current delay and 24 h; a trailing OI limit below usage or above the ceiling |
| 6005 | InsufficientBalance | Also: harvest_one with no backing cash; claiming more dev fees than accrued |