Tx Doctor / Solana error library / Expected mint

Raydium AMM 2 (0x2)0x2

Solana error: Expected mint (0x2)

A token account was passed where a mint account is required. The program checks the account's data shape and rejects a balance-holding account in a mint slot.

Why it happens

How to fix it

  1. List the accounts in the failing instruction with their roles and confirm every mint slot holds a mint (data length 82, or the Token-2022 length).
  2. Rebuild with the official SDK rather than patching a template.
  3. For Token-2022 pools, check that the mint account is the Token-2022 one and not a legacy SPL mint with a similar name.
  4. Log the account keys in the order the program received them; the mismatch is almost always visible immediately.

What it looks like in the logs

Program 675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8 failed: custom program error: 0x2

RPC simulation:
  Transaction simulation failed: Error processing Instruction : custom program error: 0x2

Wallet UI:
  "Transaction failed" — custom program error 0x2 (2)

One failure, three places it shows up: the raw transaction log, the RPC simulation error, and the wallet's short message. Match on the code, never on the wording.

The same number means something else on another program

Anchor assigns custom error codes by enum order starting at 6000, so this number is local to this program. The rows below show what the very same number means on the other programs.

Program0x2 = 2
SPL TokenInvalid mint account
Token-2022Invalid mint account

What this means for your funds

Solana transactions are atomic: if any instruction fails, every state change in that transaction is reverted, so token balances end exactly where they started. The network fee is still charged, because validators did the work of executing and rejecting it. A failed transaction never moves your tokens to someone else.

Seeing this error right now? Paste your transaction signature and get the exact instruction, program and code that failed.

Diagnose my transaction

Related Solana errors

Not enough tick array accounts

Raydium CLMM 6023 (0x1787)

Not enough remaining accounts

Raydium LaunchLab 6018 (0x1782)

Wrong accounts number

Raydium AMM 24 (0x18)

Invalid target owner

Raydium AMM 26 (0x1a)

Position not empty — cannot close

Raydium CLMM 6003 (0x1773)

Tick out of range

Raydium CLMM 6004 (0x1774)