Query editor
SELECTday,SUM(CASE WHEN description = 'SOL Withdrawn from Program' THEN token_amount ELSE 0 END) AS "Total SOL Withdrawn (Pre-Fees)",SUM(CASE WHEN description IN ('SOL Received by Fee Vault', 'SOL Received by Distributor Vault') THEN token_amount ELSE 0 END) AS "Total SOL Fees Received",SUM(CASE WHEN description = 'SOL Withdrawn from Program' THEN token_amount ELSE 0 END) - SUM(CASE WHEN description IN ('SOL Received by Fee Vault', 'SOL Received by Distributor Vault') THEN token_amount ELSE 0 END) AS "Total SOL Received by User (Post-Fees)",COALESCE(SUM(CASE WHEN description IN ('SOL Received by Fee Vault', 'SOL Received by Distributor Vault') THEN token_amount ELSE 0 END) / NULLIF(SUM(CASE WHEN description = 'SOL Withdrawn from Program' THEN token_amount ELSE 0 END), 0), 0) AS "Fees % SOL Closing Position"FROM query_4239388GROUP BY day