Tx Doctor / Solana error library / Expected mint
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
- Account order in the instruction is off by one, a very common result of mixing SDK versions.
- A UI or script passed the user's token account instead of the mint when building a custom instruction.
- The pool was created with a different mint layout than the client assumes, for example a Token-2022 mint.
- You are reusing a transaction template that was written for a different pair.
How to fix it
- 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).
- Rebuild with the official SDK rather than patching a template.
- For Token-2022 pools, check that the mint account is the Token-2022 one and not a legacy SPL mint with a similar name.
- 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.
| Program | 0x2 = 2 |
|---|---|
| SPL Token | Invalid mint account |
| Token-2022 | Invalid 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 transactionRelated 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)