with t1 as (
select
date_trunc('hour', block_timestamp) as block_hour,
count(distinct block_number) as n_blocks,
count(distinct tx_hash) as n_transactions,
n_transactions/3600 as tx_per_sec, -- 3,600 seconds in an hour
n_transactions/n_blocks as tx_per_block -- transactions per block
from avalanche.core.fact_transactions
where block_timestamp >= '2022-06-20'
group by block_hour
)
select
-- block_hour,
avg(tx_per_block),
max(tx_per_block),
min(tx_per_block)
from t1