Docs

Developers

Errors

Every custom error the Socket program, the built-in hooks program and the listing program can return, and what usually causes it.

A failed transaction reports InstructionError: [index, { Custom: code }]. Codes from 6000 come from Socket, codes from 7000 from the built-in hooks program, codes from 8000 from the listing program. An external hook returns its own codes.

Socket program#

CodeNameUsually means
6000InvalidConfigAn argument or the account count is out of range: fees, caps, permissions, tick spacing, an empty amount.
6001InvalidPdaAn account isn't at the address Socket derives for it.
6002InvalidTokenA mint or token account isn't acceptable: Token-2022, frozen, delegated, wrong mint or owner.
6003LockedThe pool is mid-callback: a hook tried to call back into it.
6004PositionOwnerOnly the position's owner, or the pool's creator for hook fees, may do this.
6005InvalidRangeThe ticks are off the spacing, out of the domain, or not lower < upper.
6006MathThe CLMM math refused: a price limit on the wrong side, an exact-output swap the pool can't fill, an output that rounds to zero.
6007SlippageThe result crossed the swap's threshold or max_total_input, or a deposit or withdrawal crossed its limits.
6008TickCapacityThe pool already has 64 initialized tick boundaries.
6009InvalidHookThe hook program is wrong, not executable, or a built-in initialization doesn't match the pool.
6010InvalidExtraThe hook accounts passed don't match the pool's list.
6011InvalidReplyThe hook's return data is missing, too long, malformed, from another program, or for another phase.
6012HookFeeCapThe hook set a fee above the max fee, outside before swap, or without fee override.
6013HookDeltaCapThe hook added a surcharge above the cap, outside after swap, or without the permission.
6014HookComputeCapOne hook call used more compute than the pool's hook budget.
6015InsufficientLiquidityA withdrawal asks for more liquidity than the position holds, or a swap would move no tokens at all.
6016ForbiddenAliasAn account appears twice where it must be unique.
6017ArithmeticAn amount overflowed.

Built-in hooks program#

CodeNameUsually means
7000InvalidProgramThe hooks program was invoked under an address other than its own.
7001UnauthorizedThe call isn't signed by the pool's hook authority, or a cancel isn't signed by the owner.
7002InvalidAccountThe pool isn't a Socket pool, the hook state isn't at its address for this pool, or an account that must be writable isn't.
7003InvalidStateThe hook state has the wrong owner, size, tag or version, or belongs to another pool.
7004InvalidConfigA hook setting is out of range at initialization, or Observe was called on a pool whose hook isn't a TWAP.
7005InvalidCallThe call's version, phase, timestamp, tick or fee limits are invalid.
7006ArithmeticOverflowA value overflowed.
7007ClockWentBackwardsThe cluster Clock is earlier than the last recorded call.
7008InsufficientHistoryA TWAP window is shorter than the minimum or older than the retained history.
7009OrderOwnerMismatchSomeone other than the range order's owner changed liquidity.
7010OrderRangeMismatchA position doesn't use the order's exact range, or isn't the order's position.
7011OrderMustBeOneSidedThe first deposit wasn't entirely on one side of the price.
7012OrderNotActiveLiquidity was added after the order filled or closed.
7013FilledOrderReentryThe swap would move the price back into a filled order's range.

Listing program#

CodeNameUsually means
8000InvalidConfigA registry with no authority or a stake outside the supply, or the wrong System Program.
8001InvalidPdaA registry, listing or stake vault isn't at its derived address, or a listing belongs to another registry.
8002InvalidMintThe mint can still be minted or frozen, or isn't the registry's mint.
8003InvalidTokenThe author's account isn't theirs, holds another mint, or holds less than the stake.
8004InvalidHookThe proposed hook isn't an executable program.
8005NotAuthorityOnly the registry authority, Socket's governance, can list, remove or burn.
8006NotAuthorOnly the listing's author can withdraw, and a burn pays its rent to the author only.
8007WrongStatusListed hooks keep their stake; a listing is approved once, and a removed one can only be burned.
8008ArithmeticA lamport total or a time overflowed.
8009StakeLockedThe stake was proposed or removed less than the registry's lock ago.

Not from Socket#

ErrorMeaning
Custom: 1 from SPL TokenNot enough tokens in the account.
ComputationalBudgetExceededThe transaction ran out of compute. Raise its limit, or the route crosses too many ticks.
BlockhashNotFoundThe transaction expired before it landed. Prepare it again.
InsufficientFundsForFeeThe fee payer has too little SOL.