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#
| Code | Name | Usually means |
|---|
| 6000 | InvalidConfig | An argument or the account count is out of range: fees, caps, permissions, tick spacing, an empty amount. |
| 6001 | InvalidPda | An account isn't at the address Socket derives for it. |
| 6002 | InvalidToken | A mint or token account isn't acceptable: Token-2022, frozen, delegated, wrong mint or owner. |
| 6003 | Locked | The pool is mid-callback: a hook tried to call back into it. |
| 6004 | PositionOwner | Only the position's owner, or the pool's creator for hook fees, may do this. |
| 6005 | InvalidRange | The ticks are off the spacing, out of the domain, or not lower < upper. |
| 6006 | Math | The 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. |
| 6007 | Slippage | The result crossed the swap's threshold or max_total_input, or a deposit or withdrawal crossed its limits. |
| 6008 | TickCapacity | The pool already has 64 initialized tick boundaries. |
| 6009 | InvalidHook | The hook program is wrong, not executable, or a built-in initialization doesn't match the pool. |
| 6010 | InvalidExtra | The hook accounts passed don't match the pool's list. |
| 6011 | InvalidReply | The hook's return data is missing, too long, malformed, from another program, or for another phase. |
| 6012 | HookFeeCap | The hook set a fee above the max fee, outside before swap, or without fee override. |
| 6013 | HookDeltaCap | The hook added a surcharge above the cap, outside after swap, or without the permission. |
| 6014 | HookComputeCap | One hook call used more compute than the pool's hook budget. |
| 6015 | InsufficientLiquidity | A withdrawal asks for more liquidity than the position holds, or a swap would move no tokens at all. |
| 6016 | ForbiddenAlias | An account appears twice where it must be unique. |
| 6017 | Arithmetic | An amount overflowed. |
Built-in hooks program#
| Code | Name | Usually means |
|---|
| 7000 | InvalidProgram | The hooks program was invoked under an address other than its own. |
| 7001 | Unauthorized | The call isn't signed by the pool's hook authority, or a cancel isn't signed by the owner. |
| 7002 | InvalidAccount | The 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. |
| 7003 | InvalidState | The hook state has the wrong owner, size, tag or version, or belongs to another pool. |
| 7004 | InvalidConfig | A hook setting is out of range at initialization, or Observe was called on a pool whose hook isn't a TWAP. |
| 7005 | InvalidCall | The call's version, phase, timestamp, tick or fee limits are invalid. |
| 7006 | ArithmeticOverflow | A value overflowed. |
| 7007 | ClockWentBackwards | The cluster Clock is earlier than the last recorded call. |
| 7008 | InsufficientHistory | A TWAP window is shorter than the minimum or older than the retained history. |
| 7009 | OrderOwnerMismatch | Someone other than the range order's owner changed liquidity. |
| 7010 | OrderRangeMismatch | A position doesn't use the order's exact range, or isn't the order's position. |
| 7011 | OrderMustBeOneSided | The first deposit wasn't entirely on one side of the price. |
| 7012 | OrderNotActive | Liquidity was added after the order filled or closed. |
| 7013 | FilledOrderReentry | The swap would move the price back into a filled order's range. |
Listing program#
| Code | Name | Usually means |
|---|
| 8000 | InvalidConfig | A registry with no authority or a stake outside the supply, or the wrong System Program. |
| 8001 | InvalidPda | A registry, listing or stake vault isn't at its derived address, or a listing belongs to another registry. |
| 8002 | InvalidMint | The mint can still be minted or frozen, or isn't the registry's mint. |
| 8003 | InvalidToken | The author's account isn't theirs, holds another mint, or holds less than the stake. |
| 8004 | InvalidHook | The proposed hook isn't an executable program. |
| 8005 | NotAuthority | Only the registry authority, Socket's governance, can list, remove or burn. |
| 8006 | NotAuthor | Only the listing's author can withdraw, and a burn pays its rent to the author only. |
| 8007 | WrongStatus | Listed hooks keep their stake; a listing is approved once, and a removed one can only be burned. |
| 8008 | Arithmetic | A lamport total or a time overflowed. |
| 8009 | StakeLocked | The stake was proposed or removed less than the registry's lock ago. |
Not from Socket#
| Error | Meaning |
|---|
Custom: 1 from SPL Token | Not enough tokens in the account. |
ComputationalBudgetExceeded | The transaction ran out of compute. Raise its limit, or the route crosses too many ticks. |
BlockhashNotFound | The transaction expired before it landed. Prepare it again. |
InsufficientFundsForFee | The fee payer has too little SOL. |