with tab1 as (
select
ORIGIN_FROM_ADDRESS,
initcap(Platform) as Platform,
count(distinct tx_hash) as "# of Swaps"
from base.defi.ez_dex_swaps
group by 1,2
)
select
Platform,
case when "# of Swaps" < 2 then 'A: 1 Swap'
when "# of Swaps" >=2 and "# of Swaps" < 5 then 'B: 2-5 Swaps'
when "# of Swaps" >=5 and "# of Swaps" < 10 then 'C: 5-10 Swaps'
when "# of Swaps" >=10 and "# of Swaps" < 20 then 'D: 10-20 Swaps'
when "# of Swaps" >=20 and "# of Swaps" < 50 then 'E: 20-50 Swaps'
when "# of Swaps" >=50 and "# of Swaps" < 100 then 'F: 50-100 Swaps'
else 'G: >= 100'
end as status,
count(distinct ORIGIN_FROM_ADDRESS) as "# of Users"
from tab1
group by 1,2