select
CASE
when block_timestamp::date >= '2022-09-05' and block_timestamp::date <'2022-09-15' then 'Before Merge'
when block_timestamp::date >= '2022-09-15' then 'After Merge' else null end as timeline,
block_timestamp::date as date,
count (distinct tx_hash) as Transactions,
count (distinct from_address) as users,
sum (gas_used) as gas_used,
sum (tx_fee) as total_fee,
avg (tx_fee) as Average_Fee
from ethereum.core.fact_transactions
where status = 'SUCCESS'
and timeline is not NULL
group by 1,2