with avg_hour as (
select
date_trunc('hour', block_timestamp) as hour, count(distinct TX_HASH) as avg_tx_count
from flipside_prod_db.mdao_harmony.txs
where block_timestamp::date >= '2021-01-01'
group by 1
), avg_hours_in_day as (
select hour::date as date, avg(avg_tx_count) as avg_txs_per_hour_in_day
from avg_hour
group by 1
)
select avg(avg_txs_per_hour_in_day) as average_transactions_per_hour
from avg_hours_in_day