Max fee vs max priority fee: Best Must-Read EVM gas 101

Max fee vs max priority fee: Best Must-Read EVM gas 101

Gas decides how fast your Ethereum or EVM transaction lands. Since EIP-1559, two fields steer the cost and speed: max fee per gas and max priority fee per gas. Know them, and you avoid overpaying, stuck transactions, and guesswork. This guide breaks it down with simple rules and live‑style examples.

Key terms in plain language

Each block sets a moving base fee. This base fee burns. You add a tip for the validator. Your caps keep costs under control. These are the pieces that matter.

  • Base fee: Protocol-set minimum per gas for the next block, burns on inclusion.
  • Priority fee (tip): Extra per gas you offer to the validator for faster inclusion.
  • Max fee per gas (maxFeePerGas): The ceiling you are willing to pay per gas. Must cover base fee + tip.
  • Max priority fee per gas (maxPriorityFeePerGas): The ceiling for your tip.
  • Effective gas price: min(maxFeePerGas, baseFee + maxPriorityFeePerGas).
  • Gas limit: Upper bound of gas units your transaction can use.

Think of a coffee line. The cafe sets the base price. You add a small cash tip to get served a bit faster. You also say the most you will spend in total. The cashier cannot charge above your cap.

How EIP-1559 pricing works

The network adjusts base fee up or down by block demand. Tips help choose between similarly priced transactions. Your total payment equals gas used times your effective gas price. The burn and reward split is automatic.

Validator reward per gas equals min(maxPriorityFeePerGas, maxFeePerGas - baseFee). Anything above base fee plus the realized tip stays in your wallet.

Max fee vs max priority fee: what changes what

Max fee controls safety against base fee spikes. Max priority fee controls your competitiveness versus other transactions in the mempool. Set them with different goals in mind.

Max fee vs max priority fee at a glance
Field Purpose Good default Risk if too low Risk if too high
Max fee per gas Cap total price; absorb base fee swings Base fee estimate × 1.2–2.0 Transaction fails if base fee rises above cap You do not overpay; unused cap is refunded
Max priority fee per gas Tip to validators; improve inclusion speed 1–3 gwei on L1; more in rush periods Slower inclusion next to better-tipped transactions You can overpay tip; it is not refunded

A high max fee does not increase your paid price by itself. It only allows the base fee to rise without breaking your transaction. A high priority fee is real money to the validator. It buys speed when mempools are crowded.

Concrete fee scenarios

Assume base fee is 20 gwei. You set maxFeePerGas=60, maxPriorityFeePerGas=2. Your effective price is 20 + 2 = 22 gwei. You do not pay 60; you pay 22.

If base fee jumps to 45 gwei before inclusion, your effective price becomes 45 + 2 = 47 gwei, still below your cap of 60, so the transaction proceeds. If base fee spikes to 65 gwei, the transaction cannot meet base fee within your cap and stays pending until fees drop.

In a rush, two traders submit swaps. One tips 1 gwei, another tips 5 gwei. With similar max fees and gas limits, the 5 gwei tip likely wins the next block spot, even if both cover the base fee.

How to set fees with a clear method

Use a simple process to pick safe caps and a fair tip. This keeps costs steady and reduces stuck transactions.

  1. Check a live base fee estimate from your wallet or a gas tracker.
  2. Pick a max fee multiplier based on urgency: 1.2× for low urgency, 1.5–2.5× for normal, 3–5× for peak events.
  3. Set a tip: 1–2 gwei for quiet periods, 3–10 gwei when blocks fill, more for MEV-sensitive trades.
  4. Confirm your gas limit matches the action: token transfer ~50–65k, ERC-20 approve ~45–65k, DEX swap 120–200k, NFT mint varies widely.
  5. Send and watch inclusion. If pending too long, consider a replacement with a higher tip and/or higher cap.

This method keeps the cap high enough to ride base fee bumps, while the tip tunes your place in line. It also reduces manual retries.

Replacing or canceling a pending transaction

You can replace an unconfirmed transaction by sending another with the same nonce and a higher effective price. Most wallets label this Speed Up or Cancel. The network treats the new one as the candidate for inclusion.

A common rule is to raise the tip by at least 10–15% over the previous effective tip. Some chains and clients require more during heavy congestion. If you want to cancel, send a 0-value transaction to your own address with a higher effective price and the same nonce.

Gas math in practice

Final cost equals gasUsed × effectiveGasPrice. You never pay for unused gas. If your action uses 90k gas and your effective price is 30 gwei, the fee is 90,000 × 30 gwei. Convert gwei to ETH by dividing by 1e9.

Refunds relate to the difference between your cap and the realized base fee plus tip. Any headroom not used stays in your wallet. That is why a high max fee does not harm you by itself.

Common mistakes to avoid

These pitfalls cause delays or waste. Avoid them with small checks and steady settings.

  • Setting a low max fee during fee spikes; the transaction stalls as base fee rises.
  • Over-tipping on calm mempools; it does not speed inclusion much and costs real ETH.
  • Guessing gas limits; too low can fail with out-of-gas, too high does nothing but looks scary.
  • Sending many small replacements; clients may ignore tiny bumps.
  • Mixing legacy gas price with EIP-1559 fields on wallets that support 1559; stick to 1559 if available.

A quick pre-check with a gas tracker and your wallet’s suggested values stops most of these issues. Adjust only when you see a clear reason, like a crowded mempool or a time‑sensitive trade.

L1 vs L2 fees

On rollups, you often see two parts: L2 execution gas and L1 data cost. Tips and max fee still apply on the L2 sequencer, but the data cost to post to L1 can dominate. Your wallet usually bundles this into a single estimate. When activity spikes on L1, your L2 cost can rise even if the L2 is quiet.

Quick answers to frequent questions

People ask the same core questions about these fields. Clear rules settle them fast.

  • Is a higher max fee safe? Yes. Unused cap is refunded; it only protects against base fee jumps.
  • Does a high tip always help? It helps when blocks are full and validators choose between similar caps.
  • Can I pay only the tip? No. You must cover base fee plus your tip within your max fee cap.
  • Why did my transaction get stuck at 99%? The base fee rose above your cap just before inclusion.
  • Should I always accept wallet defaults? They are fine for most use, but adjust the tip for urgent actions.

One tiny scenario: you queue a DEX swap with a 2 gwei tip during an NFT mint surge. It sits for 10 minutes. You bump the tip to 8 gwei and keep the same high cap. It clears in the next two blocks. The cap did not change the paid price; the tip did.

Practical presets you can use

These presets work as a fast baseline. Tweak with live estimates for best results.

  1. Calm network: set max fee to 1.5× the base fee estimate, tip 1–2 gwei.
  2. Busy hours: set max fee to 2–3× the base fee estimate, tip 3–6 gwei.
  3. Peak events: set max fee to 4–5× the base fee estimate, tip 8–15 gwei.

Run a low-cost test transfer before a big contract call if you are unsure. It confirms your nonce flow and current inclusion speed without stress.

Final notes

Max fee shields you. Max priority fee moves you forward in line. Pair a safe cap with a sensible tip, and you get fast, fair confirmations without burning extra ETH. Use live data, replace cleanly when needed, and avoid guessing. That is the core of gas done right on any EVM chain.