Ethereum Gas Fee Cost
Finds: the cost of a blockchain transaction.
When to use it: Use it to see what a transaction or smart-contract call costs. Fees rise when the network is busy and depend on how much computation the contract uses, not on the amount of money sent. A swap in a decentralized exchange may use five to ten times the gas of a plain transfer.
The formula
In words: Fee in ETH = gas used x (base fee + priority tip) in gwei x 0.000000001; Fee in money = fee in ETH x price of ETH; The base fee is burned, so burned part = gas used x base fee; Simple transfers use 21,000 gas and smart-contract calls use much more
What each symbol means
| G | Gas units the transaction uses (a measure of computation) | units |
| b | Base fee per unit of gas, set by network demand | gwei |
| t | Priority tip to the block producer | gwei |
| P | Price of ETH | money |
Worked example
A plain transfer uses 21,000 gas. The base fee is 18 gwei, the tip is 2 gwei and ETH is 3,000. A token swap uses 150,000 gas.
| Fee in ETH | 21,000 × (18 + 2) ÷ 1,000,000,000 | 0.000420 |
| Fee in money | 0.00042 × 3,000 | 1.26 |
| Burned part in ETH | 21,000 × 18 ÷ 1,000,000,000 | 0.000378 |
| Cost of the swap in money | 150,000 × (18 + 2) ÷ 1,000,000,000 × 3,000 | 9 |
The transfer costs 0.000420 ETH, which is 1.26 in money. Of this, 0.000378 ETH is burned. A 150,000 gas swap at the same prices costs 9.