Query editor
with toshi_daily_transfers as(select address, sum(value) as holding_amount from (select "from" as address,-sum(value/1e18) as valuefrom erc20_base.evt_transferwhere contract_address=0x0C03Ce270B4826Ec62e7DD007f0B716068639F7Bgroup by 1unionselect "to" as address, sum(value/1e18) as valuefrom erc20_base.evt_transferwhere contract_address=0x0C03Ce270B4826Ec62e7DD007f0B716068639F7Bgroup by 1)group by 1),holders as (select address, holding_amountfrom toshi_daily_transferswhere holding_amount >= 100)selectCASE--WHEN holding_amount >= 1 and holding_amount < 50000 THEN '1-50k'WHEN holding_amount >= 100 and holding_amount < 1000 THEN '100-1K TIG'WHEN holding_amount >= 1000 and holding_amount < 10000 THEN '1K-10K TIG'WHEN holding_amount >= 10000 and holding_amount < 100000 THEN '10K-100K TIG'WHEN holding_amount >= 100000 THEN '100K+ TIG'END AS holding_amount,CASE--WHEN holding_amount >= 1 and holding_amount < 50000 THEN '1'WHEN holding_amount >= 100 and holding_amount < 1000 THEN '1'WHEN holding_amount >= 1000 and holding_amount < 10000 THEN '2'WHEN holding_amount >= 10000 and holding_amount < 100000 THEN '3'WHEN holding_amount >= 100000 THEN '4'END AS ranking_order,CASE--WHEN holding_amount >= 1 and holding_amount < 50000 THEN 'Shrimp' --dusted walletsWHEN holding_amount >= 100 and holding_amount < 1000 THEN 'Fish'WHEN holding_amount >= 1000 and holding_amount < 10000 THEN 'Dolphin'WHEN holding_amount >= 10000 and holding_amount < 100000 THEN 'Shark'WHEN holding_amount >= 100000 THEN 'Whale'END AS wallet_status,count(address) as wallet_amountsfrom holdersgroup by 1,2,3order by 2 desc