with tab1 as (
select
trader,
sum(amount_usd) as Volume
from arbitrum.vertex.ez_perp_trades
where is_taker = 'TRUE'
group by 1
)
select
case when Volume <= 100 then 'A: < $100'
when Volume > 100 and Volume <= 500 then 'B: $101-$500'
when Volume > 500 and Volume <= 1000 then 'C: $500-$1K'
when Volume > 1000 and Volume <= 10000 then 'D: $1K-$10K'
when Volume > 10000 and Volume <= 100000 then 'E: $10K-$100K'
when Volume > 100000 and Volume <= 1000000 then 'F: $100K-$1M'
else 'G: > $1M'
end as status,
count(DISTINCT trader) as N_traders
from tab1
group by 1