Note: transactions seed a maxPriorityFee
& maxFee
> 0. Miners may not sort the txn pool directly by maxPriorityFee
because in cases when maxFee
- maxPriorityFee
< baseFee
, the maxPriorityFee
will be reduced for the transaction to remain valid. If maxFee
< baseFee
, the transaction is invalid.
Variable | Definition |
---|---|
baseFeePerGas |
Generated by the protocol, recorded in each block header. Represents the minimum gasUsed multiplier required for a tx to be included in a block. This is the part of the tx fee that is burnt: baseFeePerGas * gasUsed . |
maxPriorityFeePerGas |
Users set this. Added to transactions, represent the part of the tx fee that goes to the miner. see β below |
maxFeePerGas |
Users set this. Represents the maximum amount that a user is willing to pay for their tx (inclusive of baseFeePerGas and maxPriorityFeePerGas ). The difference between maxFeePerGas and baseFeePerGas + maxPriorityFeePerGas is "refunded" to the user. |
baseFeePerGas
can increase/decrease by up to 12.5% depending on how full the block is relative to the previous one: e.g. 100% full -> +12.5%, 50% full -> same, 0% full -> -12.5%.gasLimit
of blocks will double (e.g. 15m to 30m), so "50% full" blocks post-1559 are equivalent to 100% full blocks pre-1559.baseFeePerGas
will be set to 1 gwei. Due to integer math, it cannot go below 7 wei (0.000000007 gwei).maxPriorityFeePerGas
in-depthmaxPriorityFeePerGas
serves three purposes:
Here's how to think about suggesting user defaults for maxPriorityFeePerGas
.
- π Compensates miners for the uncle/ommer risk + fixed costs of including transaction in a block;
The rationale behind this is that if the priority fee was 0, miners would simply mine empty blocks. Therefore, in order for it to be in their economic interest to add transactions to blocks, they must be compensated beyond the marginal uncling risk that adding transactions to their block creates (and for the fixed costs of actually running the transactions, but those are negligible compared to uncle risk).
Uncle risk has two main components: the difference in block reward between being a canonical vs. uncle block and the lost MEV in the block.
This analysis calculates the right maxPriorityFeePerGas
to set (assuming 15m gas) based on how much MEV there is on average in a block (note: p=0
, the last graph, uses the most accurate numbers). Flashbots has a dashboard showing the average MEV per block.
Looking at the dashboard today, we see this:
This implies a ballpark 0.2ETH/block in MEV over the last few days.
Looking at BarnabΓ©'s diagram we see:
At 0.2ETH/block, the right maxPriorityFee
to compensate for the uncle risk is 1 gwei. Given this will compensate the median MEV block, we should probably raise it slightly so that it is profitable to include transactions even when MEV is higher than average.
Looking at the MEV distribution on Flashbots, the vast majority of blocks have <1 ETH in MEV, which would represent a 2.5 gwei fee. 2 gwei is probably a very good default "you will get in the next handful of blocks" value. 1 gwei is likely a good "slow" value.
- π° Allows users with high opportunity costs to pay a premium to miners;
For this, it should suffice to have an "Advanced" option where users can manually set their maxPriorityFee
to whatever they want.
- π In times where demand exceeds the available block space, allows first price auctions (i.e. the pre-1559 fee model) to happen on the tip.
In this case, estimating the maxPriorityFee
becomes the same as estimating the current gasPrice
. A "smart" implementation could look at how full the last N blocks are to determine whether we are in a high congestion regime.
gas price
will be interpreted as both the maxFeePerGas
and maxPriorityFeePerGas
, meaning that the baseFeePerGas
is burnt, and any extra goes to the miner. Here are some examples, assuming baseFeePerGas
is 100 gwei:1559-style tx: User sends a tx with a
maxFeePerGas
of 250 gwei andmaxPriorityFeePerGas
of 5 gwei. The user will pay 100+5=105 gwei, 100 of which will be burnt and 5 going to the miner.
Legacy (Pre-1559) tx: If the user had a legacy tx with
gasPrice
of 250 gwei, thenmaxPriorityFeePerGas
would also have been set to 250 gwei and the user would have paid 250 gwei/gas for their transaction, 100 of which would have been burnt and 250-100=150 going to the miner.
priority fee
goes to the miner, and the difference between the maxFeePerGas
and baseFeePerGas + maxPriorityFeePerGas
is refunded to the user.Transaction Type
set to 0x2
When EIP-1559 goes live in the London upgrade (scheduled for August 4), the baseFeePerGas
will be set to 1 gwei. This means that, at first, transactions will be competing via a first-price auction on the tip, as the baseFeePerGas
reaches the rate where there is ~15m gas /100% demand at that price.
If you assume the market price is 250 gwei on the fork date, this means that baseFeePerGas
needs to go through ~50 blocks to get there, or slightly less than 15 minutes.
Because of this, it is probably simplest to not make 1559-style transactions the default for at least 15-30 minutes post fork, in order for the baseFeePerGas
to stabilize.
gasUsed
is closer to gasTarget
(currently 15m) than gasLimit
(30m post fork): this means that we've found a price for the baseFeePerGas
that's close to the market price;baseFeePerGas
of parent +/- 5% from last block's baseFeePerGas
: this means the baseFeePerGas
has stopped increasing and is somewhat stable;gasPrice
right before fork, calculate how many blocks need to be full for the baseFeePerGas
to reach that amount (+12.5% each full block), add a little bufferCan perhaps use a combination of the 3, i.e.: 12.5m <gasUsed
< 17.5m AND parentBaseFee
+/- 5% from baseFeePerGas
AND blocksSinceFork
> 100
We will be adding UI resources as they are worked on by wallet teams: