---
# System prepended metadata

title: 5 Slot EIP 1559 Rewards Calculation

---

# 5 Slot EIP 1559 Rewards Calculation

For PON Penalties we want to calculate the earnings in last 5 slots so as to apply penaltY. last 5 slot EIP 1559 gives good representation of the gas price in the network based on network activity.

## Wordings


**maxPriorityFeePerGas**: Each transaction on Ethereum requires a certain amount of gas units to execute Opcode commands on the EVM which change the state of the network. Although each operation requires a fixed amount of gas, the rate at which a user pays for those gas units changes based on a block’s baseFeePerGas and the user specified maxPriorityFeePerGas (miner tip).

**baseFeePerGas**: The minimum rate a user can pay to include their transaction in the next block and is determined by the previous block’s total gas usage. If the previous block uses less than 50% of it’s gas capacity (30 million units) the base fee decreases. If the previous block’s gas usage is equal to 50% the base fee stays the same. Otherwise, if the gas usage is above 50% the base fee will increase in the next block.
## EIP 1559 Rewards
In EIP 1559 Rewards the baseFeePerGas is burned and the Block Reward hence is-

$Block Reward = Ethereum\ Block\ Reward - (baseFeePerGas * Gas\ Of\ The\ Block)$

The Miner gets all the Max Priority Fee. Each transaction has different Max Priority Fee and Gas used. For each transaction Miner gets Max Priority fee X Gas. Since going through each transaction is not possible we take a Median value of Fee and Gas Consumption of the block and take the rewards.
$Rewards = Gas Consumption * \frac{90^{th}\ Percentile\ MaxPriorityFee\ +\ 10^{th}\ Percentile\ MaxPriorityFee}{2}$

Once we have each block rewards, we take mean of 5 slots to take the penalty

![](https://i.imgur.com/vgmvSaj.png)

The reason we do this is to get the best representation of the maximum gas

![](https://i.imgur.com/aXsbNTO.png)
