TxWhy

Error codes / OKX DEX Aggregation Router V2

InvalidTokenAccount

OKX DEX Aggregation Router V2 · Custom(6011) · 0x177b

custom program error: 0x177b

What it means

One of the token accounts passed with this swap is not what the program expects for its mint and owner: a token account for the wrong mint or token program, or one that is not the trader's own. The transaction was built with the wrong account, so no price or budget change can make it pass.

The program's own message: “Invalid token account”

What to do

Rebuild the swap with the SDK so it derives the right token accounts for the mints and token program; retrying this transaction cannot succeed.

Have the transaction that failed with this?

Paste its signature. TxWhy shows the exact instruction and inner call that raised the error, and rebuilds the transaction when the cause is one it can fix (compute limit, expired blockhash, priority fee, a stale swap quote or a moved limit).

Code 6011 means something else in other programs

Custom codes are private to each program. Check which program actually raised it: it is the innermost failed call, not necessarily the program you called.