Query editor
WITH claims AS (SELECTto_owner AS claimer,SUM(amount_usd) AS total_received_usdFROM tokens_solana.transfersWHERE block_slot > 434246290AND token_mint_address = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'AND from_owner in (selectwalletfrom unnest (split('{{distribution_wallets}}', ',')) as t (wallet))GROUP BY 1),buckets AS (SELECTclaimer,total_received_usd,CASEWHEN total_received_usd < 1 THEN '1. $0 - $1'WHEN total_received_usd < 10 THEN '2. $1 - $10'WHEN total_received_usd < 100 THEN '3. $10 - $100'WHEN total_received_usd < 1000 THEN '4. $100 - $1,000'ELSE '5. $1,000+'END AS reward_bucketFROM claims)SELECTreward_bucket,COUNT(*) AS num_claimers,SUM(total_received_usd) AS total_usdc_distributed,AVG(total_received_usd) AS avg_claim_usdFROM bucketsGROUP BY 1ORDER BY 1