Priority fee on Ethereum: how the tip is capped
What is a priority fee on Ethereum? It is a per-gas tip paid to the block proposer, on top of the burned base fee, to compete for faster inclusion.
iCrypto Editorial5 min read
A priority fee on Ethereum is a per-gas tip paid to the block proposer on top of the burned base fee, to help your transaction get included sooner. EIP-1559, introduced in the London upgrade in August 2021, split transaction fees into those two parts. The protocol sets the base fee; you choose the tip and the maximum fee you are willing to pay.
You may see these settings when signing a swap. A Matcha swap routes a token trade through available liquidity sources, but the transaction still competes for Ethereum block space. The matcha vs 1inch comparison adds background on how an aggregator differs from another trading interface when choosing where to trade.
How does the priority fee work on Ethereum?
The priority fee is the part of the per-gas fee that can reward the proposer for including your transaction. The base fee is set by the network according to how full the previous block was, and it is burned. Since users cannot set that base fee, the tip is the part they can adjust to compete for inclusion.
Two wallet fields set the limits. maxPriorityFeePerGas is the most you offer as a tip per unit of gas. maxFeePerGas is the most you agree to pay per unit of gas in total, including both base fee and tip. The actual, or effective, tip is the lower of your proposed tip and the room left under your max fee:
Effective tip = min(maxPriorityFeePerGas, maxFeePerGas − base fee).
Your charged rate per gas is the base fee plus that effective tip. Multiply it by the gas used to get the transaction fee. You are charged for the rate actually used, not your full maxFeePerGas; any unused amount under the cap is not charged.
Take a Matcha swap with a 20 gwei base fee, a 2 gwei maxPriorityFeePerGas, and a 21 gwei maxFeePerGas. There is room for only 1 gwei above the base fee, so the effective tip is 1 gwei. The charged rate is 21 gwei per gas, not 22. If you want to preserve a 2 gwei tip as the base fee rises, you need to raise maxFeePerGas too.
That cap is easy to miss when a transaction is pending. As the base fee approaches your max fee, the effective tip shrinks, even if maxPriorityFeePerGas is set high. At the cap, the effective tip is zero; if the base fee exceeds your max fee, the transaction cannot be included at that fee level. Raising only the tip will not fix either case. Raise the max fee to leave room for the base fee and the tip you intend to offer.
When should you change the tip for a swap?
Change the tip when blocks are busy and a faster inclusion is worth paying for. A higher tip can make your transaction more competitive for block space, but it costs more per gas if charged. When blocks are not full, a small tip can get the same inclusion as a large one. Watch for congestion before increasing your offer, and keep the max fee high enough to cover the base fee plus your intended tip.
A tip that is too low can leave a swap pending while market prices move. If the trade then falls outside its slippage tolerance—the price movement you agreed to accept—the swap can revert when included. You may avoid waiting by offering a more competitive tip, but that trades a higher possible fee for a better chance of timely inclusion. For a swap, the useful balance is enough tip to avoid an unnecessary wait, without paying extra when blocks have room.
The base fee can change by up to 12.5% per block, depending on how full the previous block was. That makes the max fee a buffer against changing network conditions, while the priority fee is your bid for inclusion. Before confirming a swap, check both fields: set the tip for current congestion and the max fee high enough that the tip will not be squeezed away if the base fee rises.
Related
What is the difference between base fee and priority fee?
The base fee is set by Ethereum and burned; the priority fee is the user-set tip paid to the proposer. Together, the base fee and effective tip determine the rate per gas, subject to your maxFeePerGas cap.
Is a priority fee refunded if the transaction fails?
No. A reverted transaction still uses gas, and the fee for gas used is charged, including the effective tip. Gas that the transaction did not use is not charged. A failed swap can therefore cost a fee even though the token trade did not complete.
- The effective tip is capped by maxFeePerGas minus the base fee.
- Unused max fee is not charged.
- Raise the max fee as well as the tip if the base fee is squeezing your tip.
- Increase the tip when congestion makes faster inclusion worth the cost.