Tx Doctor / Solana error library / Invalid token ledger
Solana error: Invalid token ledger (Jupiter 6013)
The token ledger account passed to the swap is uninitialized, closed, or not a valid ledger. Integration bug.
Why it happens
- Token ledgers are program-derived accounts created by a separate create_token_ledger instruction. If that instruction is missing or executed in the wrong order, the ledger is not there when the swap looks for it.
- Only visible in custom integrations — jup.ag handles ledger creation for you.
How to fix it
- Re-quote and use the transaction as returned; do not drop the ledger setup instruction to save space.
- Developers: ensure create_token_ledger runs before set_token_ledger, and set_token_ledger before the route instruction.
What it looks like in the logs
Program JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 failed: custom program error: 0x177d RPC simulation: Transaction simulation failed: Error processing Instruction: custom program error: 0x177d Wallet UI: "Transaction failed" — custom program error 0x177d (6013)
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 | 0x177d = 6013 |
|---|---|
| Raydium CPMM | Invalid fee model |
| Raydium LaunchLab | No vesting schedule |
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