Query editor
WITH project_mapping AS (SELECT * FROM query_6228451),commitments AS (SELECTc.funder,SUM(c.usdc_amount) AS total_committed,MIN(c.block_time) AS first_commit,MAX(c.block_time) AS last_commit,ARRAY_AGG(DISTINCT pm.project_name) AS projectsFROM query_6227161 cJOIN project_mapping pm ON c.launch = pm.launchGROUP BY c.funder),refunds AS (SELECTfunder,SUM(usdc_refunded) AS total_refundedFROM query_6227361WHERE launch IN (SELECT launch FROM project_mapping)GROUP BY funder)SELECTc.funder,c.total_committed,-COALESCE(r.total_refunded, 0) AS total_refunded,c.total_committed - COALESCE(r.total_refunded, 0) AS total_allocation,c.projects,c.first_commit,c.last_commitFROM commitments cLEFT JOIN refunds r ON c.funder = r.funderORDER BY c.total_committed DESC