Gas Fees Explained: Why Transactions Cost Money (And How to Track It for Taxes)
You tried to swap $100 of ETH for USDC on Uniswap.
Gas fee: $43
You paid 43% just to make the swap.
What the hell is "gas," why does it cost so much, and how do you account for it on your taxes?
What Gas Actually Is
Gas = the fee you pay to execute a transaction on a blockchain.
Think of it like:
- Postage for mail - You pay to have your letter delivered
- Credit card processing fees - Merchant pays 2.5% per transaction
- AWS server costs - You pay for computational resources
In blockchain:
- Validators/miners process your transaction
- They use computational resources (electricity, hardware)
- You pay them to include your transaction in a block
No gas payment = no transaction.
Why Gas Exists: The Computational Cost
Every transaction requires:
- Computation: Running smart contract code
- Storage: Writing data to the blockchain forever
- Bandwidth: Distributing transaction to all nodes
Simple Transactions Use Less Gas
Example: Send ETH to a friend
Computational steps:
1. Check sender has balance
2. Subtract from sender
3. Add to receiver
4. Update state
Gas used: ~21,000 units
Complex Transactions Use More Gas
Example: Uniswap swap
Computational steps:
1. Check sender approved Uniswap to spend USDC
2. Transfer USDC from sender to pool
3. Calculate ETH output based on pool ratio
4. Transfer ETH from pool to sender
5. Update pool reserves
6. Emit swap event
7. Update price oracle
Gas used: ~150,000 units
More computation = more gas.
How Gas Is Calculated
Gas cost has two components:
Total Cost = Gas Used Γ Gas Price
Gas Used (Units of Work)
Fixed per transaction type:
Transaction Type | Gas Used |
---|---|
Send ETH | 21,000 |
ERC-20 transfer | 65,000 |
ERC-20 approval | 45,000 |
Uniswap swap | 150,000 |
NFT mint | 100,000 |
Liquidity deposit | 200,000 |
Complex DeFi | 500,000+ |
This is determined by the code you're executing.
Gas Price (Gwei)
Variable based on network demand:
Gwei = "giga-wei" = 0.000000001 ETH
Gas prices fluctuate wildly:
- Low congestion: 10-20 gwei
- Medium congestion: 30-50 gwei
- High congestion: 100-300 gwei
- NFT drop / bull market: 500+ gwei
Think of it like Uber surge pricing:
- Normal: $10 ride
- Friday night: $25 ride
- New Year's Eve: $75 ride
Higher gas price = your transaction is processed faster (miners prioritize high-paying transactions).
The Calculation
Example: Uniswap swap during medium congestion
Gas used: 150,000 units
Gas price: 50 gwei
Total gas: 150,000 Γ 50 = 7,500,000 gwei
Convert to ETH: 7,500,000 Γ 0.000000001 = 0.0075 ETH
If ETH = $2,000:
Gas cost = 0.0075 Γ $2,000 = $15
Same swap during high congestion (200 gwei):
Gas: 150,000 Γ 200 = 30,000,000 gwei = 0.03 ETH
Cost: 0.03 Γ $2,000 = $60
4x higher gas price = 4x higher cost.
[Visual suggestion: Graph showing gas prices over 24 hours]
Why Ethereum Gas Is So Expensive
Ethereum processes ~15 transactions per second.
Demand far exceeds supply:
- Millions of users worldwide
- DeFi protocols processing 24/7
- NFT drops with 10,000+ people trying to mint at once
Basic economics: High demand + limited supply = high prices.
When Gas Spikes
Typical gas price patterns:
Time of day:
- US daytime (9am-5pm EST): Higher (30-80 gwei)
- US night (2am-6am EST): Lower (10-25 gwei)
Day of week:
- Weekdays: Higher activity
- Weekends: Slightly lower
Market events:
- Bull run: 100-500 gwei
- Bear market: 10-30 gwei
- Major NFT drop: 1000+ gwei (yes, really)
Real example:
- Bored Ape Yacht Club land sale (April 2022): Gas hit 8,000 gwei
- Users paid $5,000-10,000 in gas per transaction
Gas Across Different Blockchains
Ethereum's high gas fees drove creation of alternative chains:
Ethereum L1
- Gas token: ETH
- Typical cost: $5-50 per transaction
- Why: Limited throughput (15 tx/sec)
Arbitrum (L2)
- Gas token: ETH
- Typical cost: $0.50-2
- Why: Bundles many L2 txs into one L1 tx (50-100x cheaper)
Optimism (L2)
- Gas token: ETH
- Typical cost: $0.50-2
- Why: Same as Arbitrum (optimistic rollup)
Base (L2)
- Gas token: ETH
- Typical cost: $0.10-1
- Why: OP Stack rollup, newer/less congested
Polygon
- Gas token: MATIC
- Typical cost: $0.01-0.10
- Why: Separate PoS chain, very high throughput
zkSync Era (L2)
- Gas token: ETH
- Typical cost: $0.20-1
- Why: ZK rollup, efficient proofs
This is why DeFi users moved to L2s: Same apps, 50-100x cheaper gas.
[Visual suggestion: Bar chart comparing gas costs across chains]
Gas Optimization Strategies
1. Time Your Transactions
Check gas prices before transacting:
Tools:
- Etherscan Gas Tracker
- Gas Now
- Built into MetaMask
Best times:
- Weekends
- 2am-6am EST
- During bear markets
Savings: 50-70% by timing well.
2. Use Lower Gas Prices for Non-Urgent Transactions
MetaMask lets you set custom gas:
- Low: Slow (may take 10+ min)
- Medium: Normal (~2 min)
- High: Fast (~30 sec)
Non-urgent transactions (staking rewards claim): Use low
Urgent transactions (buying a token about to pump): Use high
3. Batch Transactions
Instead of:
- Claim rewards from 5 protocols = 5 transactions = 5x gas
Use batching tools:
- Claim all 5 at once = 1 transaction = 1x gas
Example tools:
- Disperse.app - batch transfers
- Protocol-specific batch claim features
4. Use L2s for High-Frequency Activity
Ethereum: Large transactions, long-term holds, security-critical
L2 (Arbitrum/Base): Daily trading, DeFi farming, frequent swaps
Example:
- 100 swaps on Ethereum @ $35 each = $3,500 in gas
- 100 swaps on Arbitrum @ $0.80 each = $80 in gas
Savings: $3,420
5. Approve Unlimited Spending (Carefully)
Typical flow:
- Approve Uniswap to spend USDC ($5 gas)
- Swap USDC for ETH ($15 gas)
- Total: $20
With unlimited approval:
- Approve Uniswap to spend unlimited USDC (one-time $5 gas)
- Swap USDC for ETH ($15 gas)
- Future swaps: Only $15 gas (no re-approval needed)
Over 10 swaps: Save $45 in approval gas
β οΈ Risk: If Uniswap is hacked, attacker can drain all your USDC.
Best practice:
- Unlimited approval for trusted protocols (Uniswap, Aave, Curve)
- Limited approval for new/unaudited protocols
Gas and Taxes: How to Account for It
Gas fees are deductible, but the method depends on your tax situation.
Option 1: Reduce Capital Gains (Most Common)
Gas is added to cost basis or subtracted from proceeds.
Example: Buy + Sell
Buy 1 ETH for $2,000 + $10 gas
Cost basis: $2,010
Sell 1 ETH for $2,500, pay $15 gas
Proceeds: $2,485
Capital gain: $2,485 - $2,010 = $475
IRS logic: Gas is part of the transaction cost, just like broker fees for stocks.
Option 2: Business Expense (For Traders)
If you qualify as a "trader" (not investor):
- File Schedule C
- Deduct gas fees as operating expenses
- Can deduct against ordinary income (potentially better)
Requirements:
- Substantial trading activity (hundreds of trades/year)
- Devote significant time to trading
- Seek to profit from short-term price movements
Consult a CPA to see if you qualify.
The Tracking Problem
You need to track:
- Gas for every transaction
- Convert to USD on transaction date
- Add to cost basis or expenses
Example year:
- 200 transactions
- Average gas: $12
- Across 5 blockchains (ETH, Arbitrum, Base, Polygon, Optimism)
- Each gas payment in different native token
Manual tracking: 5-10 hours
How Moonscape Handles Gas Fees
Auto-Tracking
Every transaction includes gas:
Instead of:
Swapped 1000 USDC for 0.45 ETH
(You have to manually find the gas cost in block explorer)
You see:
Swapped 1000 USDC for 0.45 ETH
Gas: 0.008 ETH ($16.00)
Net proceeds: 0.442 ETH
Automatically pulled from blockchain data.
Cross-Chain Gas Tracking
We track gas across all chains:
Chain | Transactions | Total Gas (Native) | Total Gas (USD) |
---|---|---|---|
Ethereum | 50 | 0.4 ETH | $800 |
Arbitrum | 120 | 0.06 ETH | $120 |
Base | 80 | 0.02 ETH | $40 |
Polygon | 30 | 15 MATIC | $12 |
Total | 280 | $972 |
See exactly how much you spent on gas across all chains.
Auto-Adjust Cost Basis
For each transaction, we automatically:
Buy:
Bought 1 ETH for $2,000
Gas: $10
Cost basis: $2,010 (gas included)
Sell:
Sold 1 ETH for $2,500
Gas: $15
Proceeds: $2,485 (gas subtracted)
Gain calculation:
$2,485 proceeds - $2,010 basis = $475 gain
Gas is already factored into your capital gains.
Total Gas Report
At tax time, you get:
π 2024 Gas Summary
Ethereum L1: $2,450
Arbitrum: $180
Base: $95
Optimism: $120
Polygon: $22
Total Gas Paid: $2,867
Show this to your CPA if you're claiming business deductions.
EIP-1559: The Gas Fee Update (Post-2021)
In August 2021, Ethereum changed how gas works:
Old System (Pre-EIP-1559)
- You bid a gas price
- All gas goes to miners
New System (Post-EIP-1559)
Gas = Base Fee + Priority Fee
Base Fee:
- Algorithmically determined by network demand
- Burned (destroyed) β no one receives it
- Adjust up/down based on block fullness
Priority Fee (Tip):
- You set this to incentivize miners
- Typically 1-2 gwei
- Goes to miners/validators
Example:
Base fee: 30 gwei (burned)
Priority fee: 2 gwei (to miner)
Total: 32 gwei
Tax Implication of Burning
When ETH is burned:
- You paid for it (reduces your cost basis)
- It's destroyed (deflationary for ETH)
Some argue burned ETH should be treated differently, but:
IRS hasn't given guidance. Most tax pros treat it the same as any transaction fee.
Real-World Gas Cost Examples
Example 1: Casual DeFi User
Activity:
- Buy ETH on Coinbase (no gas, CEX)
- Withdraw to wallet ($8 gas)
- Approve USDC on Uniswap ($5 gas)
- Swap ETH β USDC ($15 gas)
- Bridge to Arbitrum ($12 gas)
Total gas: $40
Example 2: Active Trader (Ethereum L1)
Activity (over 1 year):
- 50 swaps Γ $20 = $1,000
- 20 approvals Γ $5 = $100
- 10 LP deposits Γ $30 = $300
- 10 LP withdrawals Γ $30 = $300
- 5 bridges Γ $12 = $60
Total gas: $1,760
Example 3: Active Trader (Arbitrum L2)
Same activity as Example 2, but on Arbitrum:
- 50 swaps Γ $0.80 = $40
- 20 approvals Γ $0.30 = $6
- 10 LP deposits Γ $1.20 = $12
- 10 LP withdrawals Γ $1.20 = $12
- 5 bridges Γ $0.50 = $2.50
Total gas: $72.50
Savings by using L2: $1,687.50
The Bottom Line
Gas fees:
- Pay for computational resources on blockchain
- Vary based on network congestion
- Much cheaper on L2s (Arbitrum, Base, Optimism)
- Are tax deductible (reduce capital gains or business expense)
For active DeFi users:
- Gas can be 5-10% of portfolio value per year on Ethereum L1
- Moving to L2s saves 90-98% on gas
- Tracking gas for taxes is essential but tedious
Most tax software doesn't automatically include gas in cost basis calculations.
You're left with:
- Manually looking up gas for each transaction
- Converting to USD on transaction date
- Adjusting cost basis by hand
Moonscape does this automatically.
Auto-Track Your Gas Fees
Moonscape automatically:
β
Pulls gas cost for every transaction
β
Converts to USD on transaction date
β
Adjusts cost basis automatically
β
Tracks gas across all chains
β
Generates total gas report for CPAs
Built for people who'd rather track than guess.
Moonscape β your crypto, your taxes, fully decoded.
Follow us on X (@MoonscapeHQ)
Related Reading
- What is Layer 2? (And Why Your ETH Lives on 5 Different Chains)
- Cross-Chain DeFi: Your Complete Guide to Multi-Chain Strategies
- What Are Smart Contracts? (The Addresses That Control Your DeFi)
Tags: #GasFees #Ethereum #Layer2 #CryptoTax #DeFi #Arbitrum