in-solana by Supanode

custom program error: 0x1

A program-specific error with code 0x1 (decimal 1). The meaning depends on which program emitted it. In the SPL Token program, 0x1 is InsufficientFunds — the source token account does not have enough tokens for the transfer.

Common meanings by program

ProgramError 0x1 meaning
SPL Token / Token-2022InsufficientFunds — not enough tokens
System ProgramResultWithNegativeLamports
Anchor programsCustom — check the program’s IDL

How to fix (SPL Token)

  1. Check the source token account balance with getTokenAccountBalance.
  2. Verify you are using the correct token account (not the mint or wallet address).
  3. Account for token decimals — amount is in the smallest unit (e.g., for a 6-decimal token, 1.0 token = 1,000,000 in amount).

How to fix (other programs)

  1. Find the program ID in the transaction’s error logs.
  2. Look up error code 1 in that program’s source code or IDL.
  3. The transaction logs from getTransaction show which instruction failed and the log messages leading to the error.

FAQ

How do I decode custom program errors? Check the program’s error definitions: Rust source code (the Error enum), the Anchor IDL (errors array), or the program’s documentation. Error 0x1 is always index 1 in the enum.

Is 0x1 always InsufficientFunds? Only for SPL Token. Each program defines its own error codes. The same hex code means different things in different programs.

Error text variants

  • custom program error: 0x1
  • Program returned error: 0x1

Updated: