Query editor
with data as (SELECT tx_from as trader, token_pair, -amount_usd as usdfrom dex.tradeswhere token_pair LIKE '%WETH%' and token_sold_symbol = 'WETH'UNION ALLSELECT tx_from as trader, token_pair, amount_usd as usdfrom dex.tradeswhere token_pair LIKE '%WETH%' and token_bought_symbol = 'WETH')select trader, token_pair, SUM(usd) as usd_profitfrom datagroup by 1,2