blockchain

Gas Fees

Transaction fees paid to blockchain validators to compensate for the computational resources required to process and record transactions on the blockchain.

Gas fees in cryptocurrency

Gas fees are payments made to blockchain network validators (miners or stakers) to compensate them for the computational resources used to process and confirm transactions. Gas fees are an integral part of blockchain economics and a significant cost consideration for active crypto users, particularly in DeFi.

Origin of the term "gas"

The term "gas" originated on Ethereum. Just as a car requires fuel to run, every operation on the Ethereum Virtual Machine (EVM) requires "gas" to execute. The gas fee is calculated as:

Total Fee = Gas Used × Gas Price (in Gwei)

Where 1 Gwei = 0.000000001 ETH (one billionth of an ether).

How gas fees are determined

On Ethereum (post-EIP-1559)

Since Ethereum's London Hard Fork in August 2021, fees are split into:

  • Base fee: Set algorithmically by the network based on congestion. This fee is burned (not paid to validators).
  • Priority fee (tip): An optional tip you pay to incentivize validators to include your transaction sooner.
Total Fee = (Base Fee + Priority Fee) × Gas Limit

You set a gas limit, the maximum gas you are willing to consume. Unused gas is refunded. If the transaction requires more gas than your limit, it fails but you still pay the fee.

On other chains

Different blockchains have different fee structures:

ChainFee Model
EthereumEIP-1559 (base fee + tip)
BitcoinSat/vByte (size-based)
SolanaFixed + priority fee
PolygonGas-based (like Ethereum, lower amounts)
ArbitrumL2 execution + L1 data posting fee
OptimismL2 gas + L1 security fee

Layer 2 fees

L2 networks like Arbitrum and Optimism generally charge much lower fees than Ethereum mainnet, though they still collect small L1 data publication fees.

Why gas fees matter for crypto accounting

Gas fees are significant for accounting and tax purposes for several reasons:

1. Acquisition cost addition

When you buy cryptocurrency and pay a gas fee, that fee increases your cost basis:

  • Purchase: 1 ETH at $2,000
  • Gas fee: $10
  • Total cost basis: $2,010

2. Disposal cost reduction

When you sell or exchange cryptocurrency, gas fees paid reduce your proceeds, lowering your capital gain:

  • Sale proceeds: $3,000
  • Gas fee paid: $15
  • Net proceeds: $2,985

3. Business expense deduction

For businesses and professional traders, gas fees may be deductible as ordinary business expenses rather than capital costs, depending on the nature of the activity.

4. Failed transaction fees

Gas fees for failed transactions are still consumed and taxable as expenses, even though the intended transaction did not complete. These are generally treated as ordinary losses.

5. DeFi interaction costs

Every DeFi interaction, including swapping tokens, providing liquidity, claiming rewards, and voting on governance, incurs gas fees. Over a year of active DeFi usage, these fees can add up to thousands of dollars.

Gas fee optimization strategies

Active DeFi users employ several strategies to minimize gas costs:

  • Timing transactions: Gas prices fluctuate with network congestion. Weekends and off-peak hours often have lower fees.
  • Batch transactions: Protocols like Safe (formerly Gnosis Safe) enable multiple actions in a single transaction.
  • Using L2s: Arbitrum, Optimism, Base, and other L2s offer EVM-compatible execution at a fraction of mainnet gas costs.
  • Gas limit optimization: Setting an appropriate gas limit avoids overpaying for simple transactions.

Tracking gas fees with Tokenbooks

Tokenbooks captures gas fees from on-chain transaction data for supported chains and flows:

  • Each transaction's gas fee is denominated in the native chain token and converted to your reporting currency at the transaction timestamp
  • Gas fees are correctly allocated to cost basis adjustments or expense line items based on transaction type
  • Failed transaction gas fees are tracked as separate expense events
  • Multi-chain gas fee summaries help you understand your total network costs across all chains

Learn how gas fees affect your cost basis in our guide to cost basis tracking.