Query editor
WITH aden_deposit_withdraw (block_time, action, address, chain, broker_id, tx_hash, token, amount, fee, price, usd_value) as (SELECT block_time, 'deposit', depositTo, chain, broker_id, tx_hash, token, deposit_amount, fee, price, usd_value FROM query_3368805 where broker_id = 'aden'UNIONSELECT block_time, 'withdraw', sender, chain, broker_id, tx_hash, token, -receive_amount, fee, price, usd_value FROM query_3404504 where broker_id = 'aden')SELECTaddress,token,sum(if(action = 'deposit', amount, 0)) as deposit_amount,sum(if(action = 'withdraw', -amount, 0)) as withdraw_amount,sum(fee) as withdraw_fees_paid,sum(amount - fee) as net_deposit_amountFROM aden_deposit_withdrawGROUP BY address, tokenORDER BY net_deposit_amount DESC