with tab1 as (
select
tx_sender,
min(block_timestamp) as min_date
from terra.core.fact_transactions
group by 1
)
select
date_trunc('day', min_date) as date1,
case when date1 >= '2023-01-01' then '2023'
else '2022'
END as Year_to_date,
count(*) as value
from tab1
where date1 > current_date - 60
group by 1
order by 1