SELECT
date_trunc('week',block_timestamp) as date,
CASE
when date >= '2022-01-01' and date < '2022-12-18' then 'other days'
when date >= '2022-12-18' and date <= '2023-01-03' then 'holidays'
end as time_frame,
COUNT(distinct tx_id) as tx_count,
count(distinct TX_SENDER) as uniqe_wallets,
sum(fee) as total_fee,
avg(fee) as avg_fee
from terra.core.fact_transactions
where TX_SUCCEEDED = 'TRUE'
and date <= '2023-01-03'
group by 1,2