with base as (select block_timestamp,
block_number,
tx_hash
from avalanche.core.fact_transactions
where block_timestamp >= '2022-06-20'),
base2 as (select date_trunc('day', block_timestamp) as day,
block_number,
count(distinct(tx_hash)) as count_tx
from base
group by 1,2)
select day,
avg(count_tx) as "Average TX per Block",
max(count_tx) as "Max TX per Block",
min(count_tx) as "Min TX per Block"
from base2
group by 1