Query editor
WITH usdt_transfers AS (SELECT"from" AS sender,value / 1e6 AS usdt_amountFROM erc20_ethereum.evt_TransferWHERE contract_address = 0xdac17f958d2ee523a2206206994597c13d831ec7AND "to" = 0xaB02bf85a7a851b6A379eA3D5bD3B9b4f5Dd8461AND value > 0AND evt_block_time >= TIMESTAMP '2025-10-27 13:00:00'AND evt_block_time <= TIMESTAMP '2025-10-30 13:00:00'),sender_totals AS (SELECTsender,SUM(usdt_amount) AS total_contributionFROM usdt_transfersGROUP BY sender),categorized AS (SELECTCASEWHEN total_contribution < 2650 THEN '1. Below Min (<$2,650)'WHEN total_contribution >= 2650 AND total_contribution < 10000 THEN '2. Min-$10K'WHEN total_contribution >= 10000 AND total_contribution < 50000 THEN '3. $10K-$50K'WHEN total_contribution >= 50000 AND total_contribution < 186282 THEN '4. $50K-Max'ELSE '5. Max+ (≥$186,282)'END AS category,sender,total_contributionFROM sender_totals)SELECTcategory,COUNT(*) AS participant_count,ROUND(SUM(total_contribution), 2) AS total_usdt,ROUND(AVG(total_contribution), 2) AS avg_contribution,CONCAT(FORMAT('%.2f', 100.0 * SUM(total_contribution) / SUM(SUM(total_contribution)) OVER ()), '%') AS pct_of_totalFROM categorizedGROUP BY categoryORDER BY category;