Query editor
WITH latest_balance AS (SELECTaddress,token_balanceFROM solana_utils.latest_balancesWHERE token_mint_address = '2zMMhcVQEXDtdE6vsFS7S7D5oUodfJHE8vd1gnBouauv'AND token_balance != 0),daily_balance AS (SELECT day,token_balance_owner AS address,token_balanceFROM solana_utils.daily_balancesWHERE token_mint_address = '2zMMhcVQEXDtdE6vsFS7S7D5oUodfJHE8vd1gnBouauv'AND token_balance != 0)SELECTday,COUNT (DISTINCT address) as daily_pengu_holders,count(DISTINCT address) filter (where token_balance > 0 and token_balance <=10000) as below_10k,count(DISTINCT address) filter (where token_balance > 10000 and token_balance <=50000) as between_10k_and_50k,count(DISTINCT address) filter (where token_balance > 50000 and token_balance <=100000) as between_50k_and_100k,count(DISTINCT address) filter (where token_balance > 100000 and token_balance <=500000) as between_100k_and_500k,count(DISTINCT address) filter (where token_balance > 500000 and token_balance <=1000000) as between_500k_and_1m,count(DISTINCT address) filter (where token_balance > 1000000 and token_balance <=5000000) as between_1m_and_5m,count(DISTINCT address) filter (where token_balance > 5000000) as above_5m_tokenFROM daily_balanceGROUP BY 1ORDER BY day DESC-- SELECT-- count (DISTINCT address) as total_pengu_holders,-- count(DISTINCT address) filter (where token_balance > 0 and token_balance <=10000) as below_10k,-- count(DISTINCT address) filter (where token_balance > 10000 and token_balance <=50000) as between_10k_and_50k,-- count(DISTINCT address) filter (where token_balance > 50000 and token_balance <=100000) as between_50k_and_100k,-- count(DISTINCT address) filter (where token_balance > 100000 and token_balance <=500000) as between_100k_and_500k,-- count(DISTINCT address) filter (where token_balance > 500000 and token_balance <=1000000) as between_500k_and_1m,-- count(DISTINCT address) filter (where token_balance > 1000000 and token_balance <=5000000) as between_1m_and_5m,-- count(DISTINCT address) filter (where token_balance > 5000000) as above_5m_token-- FROM-- latest_balance-- WHERE-- address NOT IN (-- ''-- )-- SELECT-- DATE_TRUNC('hour', minute) AS time,-- symbol,-- AVG(price) AS price-- FROM prices.usd-- WHERE-- toBase58 (contract_address) = '2zMMhcVQEXDtdE6vsFS7S7D5oUodfJHE8vd1gnBouauv'-- AND blockchain = 'solana'-- GROUP BY 1,2-- ORDER BY time DESC