MostlyData_CDF gas usage with block filter
Updated 2024-12-04Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
-- forked from PDF gas usage with block filter @ https://flipsidecrypto.xyz/studio/queries/7f28040f-8239-43f2-ae86-2bdf782f5af4
with block_info as(
select
block_number
,tx_count
,gas_used
,block_header_json['baseFeePerGas'] as baseFeePerGas
from ethereum.core.fact_blocks
where
block_timestamp >= current_date() - interval '{{n_days}} days'
and gas_used < 16000000
and gas_used > 15000000
)
,filtered_txs as(
select
tx.gas_used,
tx.position,
case
when tx.position between 0 and 10 then 'Tier1'
when tx.position between 11 and 50 then 'Tier2'
else 'Tier3'
end as position_group
from ethereum.core.fact_transactions tx
inner join block_info b on tx.block_number = b.block_number
)
,group_data as(
select
position_group,
cast(
QueryRunArchived: QueryRun has been archived