Query editor
SELECTDATE_TRUNC('month', block_timestamp) AS month,'thorchain' AS chain,'Thorchain' AS sender_label,'g1' AS sender_address,SUM(from_amount_usd * affiliate_fee_basis_points / 10000) AS total_revenue_usd,COUNT(*) AS unique_swapsFROM thorchain.defi_swapsWHERE(affiliate_address = 'g1' OR contains(affiliate_addresses_array, 'g1'))AND block_timestamp >= DATE('2024-01-01')GROUP BY 1,2,3,4