The maximum displayed network cost is a spending bound. It is not necessarily the fee that will leave your wallet. On Ethereum, distinguish the gas limit, the maximum price per gas, the consumed gas and the effective price actually paid.
Work through the ceiling
Consider a hypothetical transaction with a gas limit of 250,000, a maximum fee of 10 gwei per gas and a maximum priority fee of 2 gwei. Its simple maximum execution-fee budget is 0.0025 ETH.
Suppose inclusion occurs when the base fee is 4 gwei and the transaction consumes 180,000 gas. With a 2-gwei priority payment, the effective price is 6 gwei. The actual execution fee is 180,000 × 6 gwei, or 0.00108 ETH.
The result follows the fee-cap treatment in EIP-1559. The 10-gwei cap permits inclusion up to the specified bound; it does not force payment of 10 gwei when less applies.
Do not invent a refund transfer
The difference between a maximum budget and the eventual charge is unspent allowance in the economic comparison. It need not appear as a separate incoming transfer matching that difference. A wallet's presentation of reserved balances is not the same as the final fee accounting.
Use the right number for the question
For sufficient-balance checks, a maximum bound can matter. For comparing expected route costs, use the supported estimate and label it estimated. For historical cost reporting, use the actual receipt.
Do not cut a gas limit merely to make the displayed maximum smaller. That changes the execution budget and can cause an otherwise valid operation to run out of gas. This page explains the accounting distinction; the appropriate limit depends on the transaction being executed. Other networks may use different fee rules or additional components.
Sources & verification (1)
Source-check date is recorded in the article details. URLs are provided for manual verification. Use Copy to keep this page open.
- EIP-1559: Fee market change for ETH 1.0 chain
Maximum gas price, priority fee cap, effective gas price and unused budget.
https://eips.ethereum.org/EIPS/eip-1559