Solana error codes › 0x1816

custom program error: 0x1816 (6166)

0x1816 is decimal 6166. Its meaning depends on the program that failed: InvalidPerpPositionDetected in Drift V2.

Programs that use Anchor-style numbering start their own error list at 6000 (0x1770), so 6166 is the error at index 166 of the failing program's list. The same number means something different in every program.

0x1816 by program

ProgramError
Drift V2InvalidPerpPositionDetected

Same code, other formats

custom program error: 0x1816 · {"Custom":6166} · Custom(6166) · Error Number: 6166

How to tell which program failed

  1. Open the failed transaction in an explorer (or the simulation result in your code) and read the program logs.
  2. Find the line Program <address> failed: custom program error: 0x…. If several programs failed with the same code, the first one listed is the deepest call, the one that raised it.
  3. Look the code up for that program. Error processing Instruction 2 is a zero-based index, so it points to the third instruction (often the first one after two Compute Budget instructions).

Decode your exact error

Free, no sign-up, nothing to connect. Works offline from a bundled list; we do not look anything up on-chain.

Swapping a token you do not know? A free Rugsight check shows mint and freeze authority, Token-2022 extensions, holder concentration and liquidity before you trade.

← 0x1815 · 0x1817 → · All Solana error codes

Data: program error lists from published IDLs (solana-idls 1.2.1, MIT) and the System, SPL Token, Token-2022 and Associated Token Account source code, snapshot 2026-11-16. Programs can be upgraded and add or change errors; the failing program's current IDL is the final word.