Query editor
withaddress_bought_tokens_summary as (selecttoken_bought_address,token_bought_symbol,sum(token_bought_amount) as token_bought_amount,sum(token_sold_amount) as token_sold_amountfromdex.tradeswhereblock_date > date(TIMESTAMP '{{date_time}}' - interval '1' day)and blockchain = 'ethereum'and tx_from = {{address}}and token_bought_address not in (0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 -- WETH)group bytoken_bought_address,token_bought_symbol),address_sold_tokens_summary as (selecttoken_sold_address,token_sold_symbol,sum(token_sold_amount) as token_sold_amount,sum(token_bought_amount) as token_bought_amountfromdex.tradeswhereblock_date > date(TIMESTAMP '{{date_time}}' - interval '1' day)and blockchain = 'ethereum'and tx_from = {{address}}and token_sold_address not in (0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 -- WETH)group bytoken_sold_address,token_sold_symbol),address_trade_token_list as (selecttx_from as address,token_sold_address as token_addressfromdex.tradeswhereblock_date > date(timestamp '{{date_time}}' - interval '1' day)and blockchain = 'ethereum'and tx_from = {{address}}unionselecttx_from as address,token_bought_address as token_addressfromdex.tradeswhereblock_date > date(timestamp '{{date_time}}' - interval '1' day)and blockchain = 'ethereum'and tx_from = {{address}})selectt1.address,