InsufficientFundsForRent
Your transaction created an account or ATA but didn't fund it above the rent-exempt minimum. Solana requires every account to pre-pay rent for two years — currently 890,880 lamports (~$0.03) for the smallest useful account.
Root causes
Ranked by frequency. First cause is the one to check first.
- 01Calling `createAccount` with `lamports: 0` or under the rent-exempt threshold.
- 02Creating a token ATA without enough SOL in the payer to cover the 0.002 SOL rent.
- 03Subtracting lamports from an account without checking that the remaining balance is still rent-exempt.
Fix steps
- 1
Query the rent-exempt minimum
`await connection.getMinimumBalanceForRentExemption(accountSize)`. Pass the exact size in bytes of the account data. For a token ATA that's 165 bytes; for a Metaplex metadata account that's 679 bytes.
- 2
Top up the payer before the instruction
The payer needs enough SOL to cover the rent-exempt lamports PLUS the transaction fee (~5000 lamports). A trading bot should maintain a floor balance of at least 0.01 SOL.
- 3
Close unused accounts to reclaim rent
When you're done with a token position (balance = 0), call `closeAccount` to reclaim the 0.002 SOL of rent. Over thousands of trades this adds up — some bots reclaim 5+ SOL/month from aggressive account hygiene.
Related errors
- BlockhashNotFound on sendTransactionYour transaction failed with `BlockhashNotFound`. You used a blockhash the validator that received your submit no longer has in its recent cache — either stale, or you got it from a different node in a load-balanced pool.
- TransactionExpiredBlockheightExceededErrorYour transaction was submitted but not included before its blockhash expired. Either the network is congested and the validator dropped your tx for lack of priority fee, or your submit path is slow enough that 150 slots elapsed between fetch and inclusion.
Want an endpoint that just works?
Subglow is flat-priced Solana gRPC + JSON-RPC on a single API key. Pre-parsed JSON, dedicated sendTransaction bucket, 99.9% latency SLA on Dedicated. No credit juggling, no surprise bills.