# Insufficient funds for gas * price + value: cause and fix

> Insufficient funds means the sender cannot pay the gas limit times the max fee, plus the value. See what the node checks, why it fires, and how to fix it.

Source: https://hashspan.dev/errors/insufficient-funds

## Short answer

Before it accepts a transaction, the node checks that the sender can pay for it: the gas limit times the max fee per gas, plus the value. If the balance is lower, the transaction is refused with "insufficient funds" and nothing is spent. Fund the account on that chain, send less, or lower the gas limit and fee cap you set.

## What you will see

- `insufficient funds for gas * price + value`
- `The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account.`
- `exceeds transaction sender account balance`

## Where does it stop?

Figure: A transaction's path from your code to the node, the mempool, a block and a receipt. The node's check is marked in red with the error insufficient funds for gas times price plus value, and the later steps are dashed: no hash and no receipt.

The node checks the balance before it accepts the transaction. If the check fails, the transaction never enters the mempool: no hash, no block, and no gas spent.

## What does the node check?

[EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) says the signer must be able to afford `gas_limit * max_fee_per_gas`. Clients add the value you send, which is why the message reads gas * price + value.

Figure: The node adds the gas limit times maxFeePerGas to the value and compares the sum with the sender's balance. A balance of 0 ETH against a value of 1 ETH is refused with insufficient funds for gas times price plus value, and no hash is named.

The check uses the limits you set, not what the transaction will end up using. A high gas limit or max fee reserves more than the transaction may need.

## Why does it happen?

- **The balance is too low.** The account simply does not hold the value plus the fees.
- **You send the whole balance.** The value equals everything the account has, and nothing is left for gas.
- **The limits are set too high.** A generous gas limit or `maxFeePerGas` raises the amount the node wants to see.
- **The funds are on another chain.** A balance belongs to one network, and the transaction is for another.

## How do I fix it?

1. **Read the balance on the chain you send to.** `getBalance` on a client for that chain shows what the node sees.
2. **Fund the account, or send less.** Leave room for the fees: value plus gas limit times max fee must fit in the balance.
3. **Lower the limits if they are generous.** A smaller gas limit or `maxFeePerGas` lowers the amount reserved, but a `maxFeePerGas` below the block's base fee is refused as well.
4. **In an agent, check the balance before the tool sends,** and return a clear message to the model instead of a raw transaction error.

## What does it look like in a trace?

Like every refusal by the node, it is a `send` span that ends with an error and no hash:

<AttributeCard
span="send 31337"
status="bad"
rows={[
['error.type', 'InsufficientFundsError'],
['exception.message', 'The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account.'],
['blockchain.tx.hash', 'not set'],
]}
caption="From the run above (an account at balance 0 sending 1 ETH). exception.message appears only with errorMessages set to sanitized."
/>

By default only the error type is recorded, and for this refusal it is `InsufficientFundsError`. See [nonce too low](https://hashspan.dev/errors/nonce-too-low#what-does-it-look-like-in-a-trace) for how to read the node's wording in a trace. If you want the gas side of a transaction that did run, the [L1 data fee](https://hashspan.dev/learn/l1-data-fee) explains the second part of its cost on OP-stack chains.

## FAQ

### Does a transaction refused for insufficient funds cost gas?

No. The node refuses it before it reaches a block, so nothing is mined and no gas is spent. A transaction that is mined and then fails, such as one that runs out of gas, does cost gas.

### Does the check use the gas the transaction will use?

No. It uses the limits you set: the gas limit times maxFeePerGas, plus the value. EIP-1559 requires the signer to afford gas_limit times max_fee_per_gas, so a high limit or fee cap reserves more than the transaction may need.

### Why does it fire when my balance looks high enough?

Check the chain first: a balance is per network. Then check the limits: a large gas limit or maxFeePerGas raises the amount the node wants to see, even if the transaction would cost less.
