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 swap_tx,
count(distinct trader) as seller,
sum(TO_AMOUNT/pow(10,6))
from terra.core.ez_swaps
where date <= '2023-01-03'
and from_CURRENCY = 'uluna'
and TX_SUCCEEDED = 'TRUE'
group by 1,2