SELECT date(block_timestamp) as day, count(DISTINCT tx_id) as total_txs,
case when day>='2022-01-01' then 'after' else 'before' end as type,
avg(total_txs) over (partition by type order by day) as avg_txs
FROM ALGORAND.APPLICATION_CALL_TRANSACTION
where day >= '2021-07-01'
GROUP by 1
-- LIMIT 10