select
date_trunc('day',block_timestamp) as dt,
CASE
when amount between '0' and '10' then 'Tiny: 0-10 Algos'
when amount between '10' and '100'then 'Small: 10-100 Algos'
when amount between '100' and '1000' then 'Medium: 100-1000 Algos'
when amount between '1000' and '10000' then 'Big: 1000-1000 Algos'
when amount > '10000' then 'Huge: over 10000 Algos'
end as sent_group,
count(distinct tx_id) as transaction_number,
count (distinct sender) as uniquewallets
from algorand.payment_transaction
where block_timestamp >= '2022-01-01'
and sent_group is not null
group by 1,2