Transaction

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.

  1. 01Calling `createAccount` with `lamports: 0` or under the rent-exempt threshold.
  2. 02Creating a token ATA without enough SOL in the payer to cover the 0.002 SOL rent.
  3. 03Subtracting lamports from an account without checking that the remaining balance is still rent-exempt.

Fix steps

  1. 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. 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. 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

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.