Tx Doctor / Solana error library / Account would not be rent exempt
Solana error: Account would not be rent exempt (0x0)
The token account would end up below the rent-exempt threshold, which the token program refuses to allow.
Why it happens
- You are withdrawing almost all SOL or tokens from an account that must keep a minimum balance.
- The account was funded with an amount just under the threshold.
- A close-account instruction was skipped before the withdrawal.
How to fix it
- Leave at least the rent-exempt minimum in the account.
- Close the account properly instead of draining it.
- Top up the account so it clears the threshold.
What it looks like in the logs
Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA failed: custom program error: 0x0
Seeing this error right now? Paste your transaction signature and get the exact instruction, program and code that failed.
Diagnose my transaction