Query editor
WITH holder_token_count AS (SELECT"to" AS holder_address,COUNT(*) AS total_tokensFROM tokens.transfersWHEREcontract_address = FROM_HEX('e55fEE191604cdBeb874F87A28Ca89aED401C303')GROUP BY"to"), token_grouping AS (SELECTholder_address,CASEwhen total_tokens = 1 THEN '1 token'when total_tokens > 1 and total_tokens <= 10 then '2-10 tokens'when total_tokens > 10 and total_tokens <= 100 then '11-100 tokens'when total_tokens > 100 and total_tokens <= 1000 then '101-1000 tokens'when total_tokens > 1000 and total_tokens <= 2000 then '1001-2000 tokens'when total_tokens > 2000 and total_tokens <= 3000 then '2001-3000 tokens'when total_tokens > 3000 and total_tokens <= 5000 then '3001-5000 tokens'when total_tokens > 5000 and total_tokens <= 1000000000 then '>5000 tokens'END AS token_groupFROM holder_token_count), grouped_wallets AS (SELECTtg.token_group,COUNT(DISTINCT htc.holder_address) AS number_of_walletsFROM token_grouping AS tgJOIN holder_token_count AS htcON tg.holder_address = htc.holder_addressGROUP BYtg.token_group)SELECTtoken_group,number_of_walletsFROM grouped_walletsORDER BYCASEWHEN token_group = '1 token'THEN 1WHEN token_group = '2-10 tokens'THEN 2WHEN token_group = '11-100 tokens'THEN 3WHEN token_group = '101-1000 tokens'THEN 4WHEN token_group = '1001-2000 tokens'THEN 5WHEN token_group = '2001-3000 tokens'THEN 6WHEN token_group = '3001-5000 tokens'THEN 7WHEN token_group = '>5000 tokens'THEN 8END