🔵Base L2 Index (Coming soon)
Last updated
Last updated
This index tracks thegas_spent_per_block
for Base L2 blocks. It sums up the total gas spent per transaction across a block, as defined as:
Gas price
This is the Gas price that the user paid for the Base L2 transaction. This includes both Priority Fee and Base Fee (Note: this is a term inherited from ETH, not the Base L2)
Gas usage by txn
The actual gas unit that the transaction consumes
L1 fee
The total amount of fee the transaction pays to post on Ethereum L1. This is not equal to L1 gas price x L1 gas used
There are two type of 0 l1_fee tx, System
and Legacy
. There are no more Legacy
-type tx after March 2024. All 0 l1 fee transactions are System
type. We can treat the l1Fee
as 0.
Legacy type is 126 in the type
field
Currently, all L2 data that comes from L1, such as deposits, are processed only after being confirmed in an L1 block. Therefore, there haven't been any reorganizations caused by L1 reorgs or hard forks yet. Since there is currently a single sequencer, uncle blocks or forked blocks do not exist either.
Failsafe for re-org
To be absolutely safe, we can also query the latest finalized
block, for example:
What is excluded from the index calculation?
Gas fees (Base)
The fee transaction has to pay at the time of the block
Gas fees (Max)
The maximum of total gas the user is willing to pay for the transaction
Gas fees (Max priority)
The maximum of gas the user is willing to pay to the validator for the transaction
Gas limit
The maximum amount of computational work a user is willing to pay for in a single transaction
L1 gas used by txn
The amount of gas units that the transaction consumes when posted on ETH L1
L1 gas price
The gas price on Ethereum L1 that this transaction pays
L1 fee scalar
This is a preventative premium in case L1 gas fee spikes
Transaction fee
The total amount of gas fee the user pays for the transaction. Transaction fee = L2 base fee + L2 priority fee + L1 fee = (Gas usage x Gas price) + L1 fee
Query from Base nodes from Quicknode.
Block
Fetch full transaction object from a block by block number
Iterate all transactions
and get the hash
of each transaction
Sample response