Custom program error

0x11

Appears in logs as custom program error: 0x1. Defined by 2 programs: SPL Token, System. Check which program failed in your logs.

Which one is yours?
The log line Program <id> failed: custom program error: 0x1 names the program that returned the code. Match that id to the program below. Anchor programs also print Error Code: … Error Number: … right above the failure.
SPL TokenTokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA

InsufficientFunds

“Insufficient funds”

The source token account does not hold enough tokens for the transfer, burn or approve amount. This is the most common SPL Token error and shows up as custom program error: 0x1.

Common causes

  • The wallet simply does not own that many tokens, or the balance is in a different token account for the same mint.
  • Decimal mistakes: sending 1 when you meant 1 * 10^decimals, or the reverse.
  • A previous transaction already moved the tokens and the client state is stale.
  • Transfer fees on a Token-2022 mint push the required amount above the balance.

How to fix it

  • Fetch the token account balance right before sending and compare it to the raw amount (in base units) you are transferring.
  • Check for multiple token accounts for the same mint using getTokenAccountsByOwner and pick the one with the balance.
  • If you see this from the System Program (code 0x1 as well), the issue is SOL balance, not tokens. Check which program logged the error.
System11111111111111111111111111111111

ResultWithNegativeLamports

“account does not have enough SOL to perform the operation”

The account funding a transfer or account creation does not hold enough lamports for the amount requested plus rent.

Common causes

  • The payer wallet balance is lower than the transfer amount, or lower than the rent-exempt minimum for the account being created.
  • You computed the lamports for create_account with the wrong data size, so the rent-exempt amount is bigger than expected.
  • On devnet or localnet, the wallet was never airdropped.

How to fix it

  • Fund the payer. Remember the payer needs the amount being sent, plus rent for any new accounts, plus the transaction fee.
  • Use the rent calculator on this site or getMinimumBalanceForRentExemption(space) to size the deposit correctly.
  • On devnet, run solana airdrop 2 or use a faucet.

Decode another error

Try: