Calculation guide
Execution gas only, in gwei per gas. A transaction cannot be included if its fee cap is below base fee. Actual gas used may differ from the gas limit. Blob and L2 costs are excluded.
Inputs
Gas used
Example entry 21000. Use whole numbers.
Transaction gas limit
Example entry 30000. Use whole numbers.
Base fee (gwei/gas)
Example entry 20.
Maximum priority fee (gwei/gas)
Example entry 3.
Maximum total fee (gwei/gas)
Example entry 22.
Worked example
| Input | Value |
|---|---|
| Gas used | 21,000 |
| Transaction gas limit | 30,000 |
| Base fee (gwei/gas) | 20 |
| Maximum priority fee (gwei/gas) | 3 |
| Maximum total fee (gwei/gas) | 22 |
| Result | Value |
|---|---|
| Actual execution charge (ETH) | 0.000462 |
| Maximum fee exposure (ETH) | 0.00066 |
| Effective gas price (gwei) | 22 |
Calculation steps
Actual execution charge (ETH) = ((Gas used × min(Maximum total fee (gwei/gas), (Base fee (gwei/gas) + Maximum priority fee (gwei/gas)))) ÷ 1,000,000,000)
((21,000 × min(22, (20 + 3))) ÷ 1,000,000,000) = 0.000462
Maximum fee exposure (ETH) = ((Transaction gas limit × Maximum total fee (gwei/gas)) ÷ 1,000,000,000)
((30,000 × 22) ÷ 1,000,000,000) = 0.00066
Effective gas price (gwei) = min(Maximum total fee (gwei/gas), (Base fee (gwei/gas) + Maximum priority fee (gwei/gas)))
min(22, (20 + 3)) = 22
How each input affects this example
Each row starts from the worked example and changes one input.
| Input | Original input | New input | Affected result | Original result | New result |
|---|---|---|---|---|---|
| Gas used | 21,000 | 23,100 | Actual execution charge (ETH) | 0.000462 | 0.000508 |
| Transaction gas limit | 30,000 | 33,000 | Maximum fee exposure (ETH) | 0.00066 | 0.000726 |
| Base fee (gwei/gas) | 20 | 18 | Actual execution charge (ETH) | 0.000462 | 0.000441 |
| Maximum priority fee (gwei/gas) | 3 | 0 | Actual execution charge (ETH) | 0.000462 | 0.00042 |
| Maximum total fee (gwei/gas) | 22 | 24 | Actual execution charge (ETH) | 0.000462 | 0.000483 |
