with
maintable as ( select
buyer_address,
count(distinct tx_hash) as Sales_Count,
count(distinct tokenid) as Tokens_Count,
sum (price_usd) as Total_USD_Volume
from
optimism.core.ez_nft_sales
where
nft_address = '0xc480325c86392b773cbad885759c205f26d91bbb'
and
price_usd > 0 group by 1)
select
case
when
Total_USD_Volume < 10 then 'Less Than $10'
when
Total_USD_Volume >= 10 and Total_USD_Volume < 100 then '$10 - $100'
when
Total_USD_Volume >= 100 and Total_USD_Volume < 1000 then '$100 - $1000'
else
'More Than $1000' end as type,
count(distinct buyer_address)
from
maintable
group by 1 order by 2 desc