Apply the fee cap and unit conversion
When maximum fee is at least the base fee, effective gas price is min(maximum fee, base fee + maximum priority fee). Estimated ETH cost equals gas limit × effective gas price in gwei × 10⁻⁹. Quote-currency cost equals ETH cost × ETH price. A maximum fee below the entered base fee is invalid for this scenario. The cap can reduce the paid priority fee below the requested maximum.
Work through an illustrative gas budget
Take a hypothetical gas limit of 100,000, base fee of 20 gwei, maximum priority fee of 2 gwei, and maximum fee of 30 gwei. Effective price is 22 gwei, giving a gas-limit budget of 0.0022 ETH. At an assumed ETH price of $2,000, that is $4.40. If the maximum fee were 21 gwei instead, the effective price would be 21 and the priority portion only 1 gwei.
Distinguish budget from actual gas consumed
The calculation multiplies by gas limit, so it is an upper bound on gas consumption at the supplied effective price. Actual execution generally pays for gas used, with unused gas refunded. The maximum authorized gas-fee ceiling is gas limit × maximum fee, which may exceed this scenario estimate. Future base fees can change inclusion and payment. This model excludes transferred ETH value and any separate rollup, data, or application-level charges.