Skip to content

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 ​

CodeNameCauseWhat to do
6001InvalidParamDeposit 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 awayFix the amount or expiry
6002PausedNew 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.
6003MarketRetiredThe market takes no new opensTrade another market; you can still close existing positions
6004LeverageTooHighLeverage is 0 or above the market's max_leverageUse 1 to max_leverage
6005InsufficientBalanceMargin or withdrawal is larger than your available balanceDeposit, or lower the amount. Pending margin and queued wins aren't available.
6006OiCapAt 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
6015UnauthorizedThe signer is neither the account owner nor a live session key, often because the session key expired or was revokedRe-enable 1-click trading, or sign with your wallet
6018RequestExpiredA fill was attempted after expires_tsCancel the request to get your refund
6019RequestNotExpiredCancel attempted at or before expires_tsWait until after expires_ts; until then the request can still fill. Ordinary cancellation always needs expiry (an inadmissible close can be voided instead).
6020MarginTooSmallMargin below the market's min_marginIncrease margin
6021PositionTooLargemargin × leverage above max_position_notionalLower margin or leverage
6022TraderNotionalCapYour open plus pending notional would exceed max_trader_notionalClose positions or wait for pending opens to resolve
6027MarketSettledThe 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.
6029NotLaunchedDeposit, open or governance proposal before launchWait for launch
6030StaleHeartbeatThe market's oracle watermark is more than 60 s old, or there has never been oneRetry 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.
6031ClosePendingThe 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
6035BadDestinationWithdrawal (or dev-fee claim) destination is the vaultWithdraw to your own USDC account
6036ClockLagThe oracle watermark is more than 5 s ahead of the Solana clock, which means the clock is laggingRetry when the clock catches up
6038SamplesExceededThe 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
6039SettlementPendingThe retired market has a pending settlement, and your close would be pinned at or after its settlement pinNothing 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 ​

CodeNameCause
6000OverflowChecked arithmetic overflowed or underflowed, including when a positive oracle price or confidence is too large to normalize to 8 decimals in a u64
6008BadOracleThe 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.
6009StalePriceLiquidation or heartbeat price older than liq_max_age_s
6010PriceBeforeRequestLiquidation price not published after the position's entry price. (The message says "predates the request".)
6011PriceUncertainconf × 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.
6012NotLiquidatableThe position isn't bust after the confidence band, and isn't underwater at the midpoint
6013BadQueueOrderHarvest 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
6014MismatchAccounts 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.)
6016PriceNotPinnedFill 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)
6017EmaDeviation|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.
6026NotSettledsettle_retired on a market without a settlement price, or a settlement proposal for a market that isn't retired or whose retirement changed
6028WrongMarketPosition 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
6037CloseFillablevoid_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.
6039SettlementPendingAlso: liquidate with a price published at or after the market's settlement pin; execute_close for a close pinned at or after it
6007NotKeeperNot used. Fills are permissionless and this error is never returned.

Admin and governance errors ​

CodeNameCause
6015UnauthorizedAlso: 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
6023AlreadyLaunchedPre-launch setup instruction after launch, or a second launch
6024ProposalNotPendingProposal already executed or cancelled
6025TimelockActiveExecuting before eta
6032ProposalExpiredExecuting more than 7 days after eta
6033SettlePriceOutOfRangeProposed 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.
6039SettlementPendingAlso: 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
6034NotUpgradeAuthorityinitialize not signed by the program's upgrade authority
6001InvalidParamAlso: 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
6005InsufficientBalanceAlso: harvest_one with no backing cash; claiming more dev fees than accrued

Papersol is experimental software. Trading with leverage can lose your whole margin.