First calculate the fee in its payment asset. Then multiply by a stated price for that asset in your comparison currency. Do not combine a gas-unit count with a dollar token price before converting the units of the gas price.
A complete unit chain
In this hypothetical Ethereum example, a transaction uses 180,000 gas and pays 2 gwei per gas. One gwei is one billionth of an ETH, as described in Ethereum's gas documentation.
180,000 gas × 2 gwei/gas = 360,000 gwei
360,000 gwei × 0.000000001 ETH/gwei = 0.00036 ETH
0.00036 ETH × $2,500/ETH = $0.90The $2,500 value is an invented valuation assumption, not a current ETH price. If the desired comparison asset is an output token worth $0.25 under the same assumptions, the gas is economically equivalent to 3.6 output tokens.
Keep payment and valuation separate
The receipt records native units paid. The dollar amount depends on when and where you value those units. Valuing the same 0.00036 ETH at $2,600 produces $0.936 without changing the transaction fee in ETH.
For competing quotes observed together, use one consistent price snapshot. For historical cash-cost reporting, state whether you use the submission, inclusion or another accounting-time price. Do not quietly value one route at today's native-token price and another at yesterday's.
Check the chain's actual fee model
Do not assume every network's total charge is exhausted by one Ethereum-style gas calculation. A rollup can expose additional data-related components; another network may display fees in different units. Use the complete fee field for the network and preserve its breakdown where available.
When the output asset has an uncertain price, report the native-token fee directly and show any converted amount as an estimate. Accurate units are more valuable than a misleadingly precise dollar total.
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.
- Ethereum gas and fees: technical overview
Gas cost calculation, maximum fee versus actual cost, and fees for executed failed transactions.
https://ethereum.org/developers/docs/gas/