Tx Doctor / Solana error library / Wrong accounts number

Raydium AMM 24 (0x18)0x18

Solana error: Wrong accounts number (0x18)

The instruction arrived with the wrong number of accounts. Raydium AMM v4 expects a fixed, ordered account list and validates its length before reading anything.

Why it happens

How to fix it

  1. Use the official SDK to build the instruction — it encodes the exact account order for the deployed program version.
  2. If you build manually, compare your list against a transaction that succeeded on the same instruction and diff the keys in order.
  3. Never omit optional accounts by truncating the list; pass the expected placeholders instead.
  4. Pin the SDK and the program version together; upgrading one without the other is the usual source of this error.

What it looks like in the logs

Program 675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8 failed: custom program error: 0x18

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

Wallet UI:
  "Transaction failed" — custom program error 0x18 (24)

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.

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)

Expected mint

Raydium AMM 2 (0x2)

Invalid target owner

Raydium AMM 26 (0x1a)

Position not empty — cannot close

Raydium CLMM 6003 (0x1773)

Tick out of range

Raydium CLMM 6004 (0x1774)