Insufficient funds for fee
The account designated as the fee payer does not have enough SOL to cover the transaction’s base fee plus any priority fee.
Common causes
- Balance too low. The fee payer’s balance is less than the base fee (5,000 lamports = 0.000005 SOL) plus the priority fee.
- Transaction drains the account. A transfer instruction sends all SOL, leaving nothing for the fee. The fee is deducted in addition to the transfer amount.
- Priority fee set too high. A high compute unit price multiplied by the compute unit limit can result in a large fee.
How to fix
- Check the fee payer’s balance with getBalance.
- Ensure the balance covers: transfer amount + base fee (5,000 lamports) + priority fee + rent-exempt minimum.
- For max-transfer scenarios, calculate:
maxTransfer = balance - baseFee - priorityFee - rentExemptMinimum.
import { createSolanaRpc } from "@solana/kit";
const rpc = createSolanaRpc("https://api.mainnet-beta.solana.com");
const balance = await rpc.getBalance(feePayer).send();
const rentExempt = await rpc.getMinimumBalanceForRentExemption(0n).send();
const baseFee = 5000n;
const priorityFee = 10000n; // your priority fee
const maxTransfer = balance.value - baseFee - priorityFee - rentExempt;
FAQ
How much is the base fee? The base fee is 5,000 lamports (0.000005 SOL) per signature. Most transactions have one signature.
Does the priority fee come from the same account?
Yes. The fee payer pays both the base fee and the priority fee. The priority fee is calculated as computeUnitPrice * computeUnitLimit / 1,000,000.
Can someone else pay the fee? Yes. The first signer in the transaction is the fee payer. You can structure the transaction so a different account pays the fee.
Error text variants
-
Insufficient funds for fee -
insufficient lamports
Sources
Updated: