with t1 as( (select SELLER_ADDRESS as user,sum(PRICE_USD) as volume
from Ethereum.core.ez_nft_sales
where PRICE_USD is not null
group by 1
order by 2 DESc)
union all
(select BUYER_ADDRESS as user,sum(PRICE_USD) as volume
from Ethereum.core.ez_nft_sales
where PRICE_USD is not null
group by 1
order by 2 DESc)),
t2 as
(select user,sum(VOLUME) as VOLUME from t1
where
user not in(select CONTRACT_ADDRESS as user from ethereum.core.dim_contracts_extended )
or
user not in(select ADDRESS as user from ethereum.core.dim_contracts )
or
user not in(select ADDRESS as user from ethereum.core.dim_labels)
group by 1
order by 2 desc)
select count(*) as number_of_users , 'bigger than 10000000000' as range from t2
where
VOLUME>10000000000
union all
select count(*) as number_of_users , 'between 10000000000 and 1000000000' as range from t2
where
VOLUME<10000000000 and VOLUME>1000000000
union all
select count(*) as number_of_users , 'between 1000000000 and 100000000' as range from t2
where