FixesUpdated 23 Oct 20261 min read

pump.fun error 6040 or 6041: not enough SOL for rent or fees

The fix

Your wallet has enough for the buy itself but not for the extra costs: rent for new accounts (6040) or the trading fees (6041).

Tools covered

  1. Pump.funA Solana platform for creating and trading tokens on a bonding curve, with automatic migration to PumpSwap.UpVisit

What the error means

Error Code: BuyNotEnoughSolToCoverRent. Error Number: 6040. Error Message: Buy: Not enough SOL to cover for rent exemption.  /  Error Code: BuyNotEnoughSolToCoverFees. Error Number: 6041.

Your wallet has enough for the buy itself but not for the extra costs: rent for new accounts (6040) or the trading fees (6041).

Where it comes frompump.fun bonding curve program
Code6040 (0x1798) and 6041 (0x1799)

How to fix it

  1. Keep a buffer of SOL beyond the buy amount for fees, rent and priority fees.
  2. Reduce the buy amount slightly.
  3. Close empty token accounts to recover rent if your wallet is low, see reclaim SOL rent.

If that is not it

  • If the error is 6002, the problem is slippage, not balance.

More fixes: how to decode any Solana error code and why Solana transactions fail.

Source

Error text and code from pump.fun program IDL (pump-fun/pump-public-docs, idl/pump.json), read on 24 October 2026.

Questions people ask

Why do I need more SOL than my buy amount?

A buy also pays the curve fee, network and priority fees, and rent for your token account the first time you buy.

How much buffer should I keep?

A few hundredths of a SOL covers most buys, more if your bot sets high priority fees or tips.