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=0xAC1Bd2486aAf3B5C0fc3Fd868558b082a531B2B4group by 1unionselect "to" as address, sum(value/1e18) as valuefrom erc20_base.evt_transferwhere contract_address=0xAC1Bd2486aAf3B5C0fc3Fd868558b082a531B2B4group by 1)group by 1),holders as (select address, holding_amountfrom toshi_daily_transferswhere holding_amount >= 50000)selectCASE--WHEN holding_amount >= 1 and holding_amount < 50000 THEN '1-50k'WHEN holding_amount >= 50000 and holding_amount < 1000000 THEN '50k-1M'WHEN holding_amount >= 1000000 and holding_amount < 10000000 THEN '1M-10M'WHEN holding_amount >= 10000000 and holding_amount < 100000000 THEN '10M-100M'WHEN holding_amount >= 100000000 THEN '100M+'END AS holding_amount,CASE--WHEN holding_amount >= 1 and holding_amount < 50000 THEN '1'WHEN holding_amount >= 50000 and holding_amount < 1000000 THEN '1'WHEN holding_amount >= 1000000 and holding_amount < 10000000 THEN '2'WHEN holding_amount >= 10000000 and holding_amount < 100000000 THEN '3'WHEN holding_amount >= 100000000 THEN '4'END AS ranking_order,CASE--WHEN holding_amount >= 1 and holding_amount < 50000 THEN 'Shrimp' --dusted walletsWHEN holding_amount >= 50000 and holding_amount < 1000000 THEN 'Fish'WHEN holding_amount >= 1000000 and holding_amount < 10000000 THEN 'Dolphin'WHEN holding_amount >= 10000000 and holding_amount < 100000000 THEN 'Shark'WHEN holding_amount >= 100000000 THEN 'Whale'END AS wallet_status,count(address) as wallet_amountsfrom holdersgroup by 1,2,3order by 2 desc