Building a Personal EIP-1559 Gas Baseline

Why I track a personal gas baseline

Gas cost is the most predictable drag on a small wallet. If I do not know the typical fee range for a swap, approve, or deposit, I cannot tell whether I am overpaying, or whether the chain is simply expensive that day. This post is my short, repeatable process for building a gas baseline from real receipts and using EIP-1559 math to interpret those receipts.

I am focused on sub-$1k wallets, so the baseline is a guardrail: it tells me which workflows are too expensive to run at small size and when I should wait for lower base fees.

How EIP-1559 fees actually show up in receipts

EIP-1559 splits the fee into two parts: the base fee that is burned and a priority fee (tip) that goes to the block builder. The base fee updates every block based on how full the previous block was, and the adjustment is capped at 12.5% per block. (EIP-1559)

Receipts for post-1559 transactions include effectiveGasPrice, which is the actual gas price paid after the fee cap logic runs. This is the number I use to compute the real cost alongside gasUsed. (Ethereum JSON-RPC: eth_getTransactionReceipt)

The math I use for costs is simple:

fee_paid = gas_used * effective_gas_price

If I want to sanity-check a transaction before sending it, I can estimate the effective gas price using the EIP-1559 rule:

effective_gas_price = base_fee + min(max_priority_fee, max_fee - base_fee)

This is not necessary for the baseline, but it helps explain why a transaction with a high maxFeePerGas still clears at a lower effective price when base fees are calm. (EIP-1559)

Baseline workflow: three real receipts and a simple table

I do not need a full data pipeline to understand gas for a small wallet. I take three receipts for each action (approve, swap, deposit) and compute the fee paid in ETH. That gives me a min/median/max range I can compare against future transactions.

Here is a small Python snippet that does the same calculation on a tiny sample list. The values are placeholders, but the math is identical to what I run on receipts pulled from eth_getTransactionReceipt.

from dataclasses import dataclass
from decimal import Decimal


@dataclass
class Receipt:
    tx_hash: str
    gas_used: int
    effective_gas_price_wei: int


def fee_paid_eth(receipt: Receipt) -> Decimal:
    """Return the fee paid in ETH using gasUsed * effectiveGasPrice."""
    fee_wei = Decimal(receipt.gas_used) * Decimal(receipt.effective_gas_price_wei)
    return fee_wei / Decimal("1e18")


sample_receipts = [
    Receipt(tx_hash="0xaaa", gas_used=51234, effective_gas_price_wei=18_000_000_000),
    Receipt(tx_hash="0xbbb", gas_used=48901, effective_gas_price_wei=22_000_000_000),
    Receipt(tx_hash="0xccc", gas_used=53012, effective_gas_price_wei=16_000_000_000),
]

fees = [fee_paid_eth(r) for r in sample_receipts]
print("min", min(fees), "median", sorted(fees)[len(fees) // 2], "max", max(fees))

When I run this against real receipts, I record the range in a simple markdown note. For a small wallet, this is enough to answer: “Is today’s approval fee normal or spiking?” If the fee is above the max range, I pause and check the base fee trend before trying again.

Risk analysis: what can go wrong with gas baselines

  • Technical risk (incorrect receipt fields): Some third-party APIs omit effectiveGasPrice or provide gasPrice for legacy transactions. If you mix those, your baseline gets polluted and the comparison becomes meaningless. (Ethereum JSON-RPC: eth_getTransactionReceipt)
  • Economic risk (changing contract paths): A swap executed through a different router or pool can move the gas cost even if the UI looks the same. That can inflate the baseline and make you think the chain is expensive when it is just a more complex path.
  • Operational risk (base fee spikes): Base fees can jump quickly during congestion, and the 12.5% cap still compounds across multiple blocks. If you send transactions without checking the base fee, a routine approve can become disproportionate relative to a sub-$1k wallet. (EIP-1559)

Practical takeaways for small wallets

  • Pull three receipts per action and compute fee ranges using gasUsed * effectiveGasPrice.
  • Treat any fee above the personal max range as a reason to pause and re-check base fees.
  • Keep baselines per chain; L2s behave differently from mainnet and each other.
  • Rebuild the baseline whenever you change routers or upgrade the workflow.