Query editor
with linea_txs as (select *from dex.tradeswhere blockchain = 'linea'and project = 'nile'and (token_bought_address = 0xb3B3CA7cb0BCCb6A9316764826324A312665DC53 or token_sold_address = 0xb3B3CA7cb0BCCb6A9316764826324A312665DC53)), buy as (selecttaker as trader_address, sum(token_bought_amount) as total_bought_amount, sum(amount_usd) as total_bought_volume_usd, count(tx_hash) as total_bought_txsfrom linea_txswhere token_bought_address = 0xb3B3CA7cb0BCCb6A9316764826324A312665DC53and token_sold_address in(0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f --eth)group by 1), sell as (selecttaker as trader_address, sum(token_sold_amount) as total_sold_amount, sum(amount_usd) as total_sold_volume_usd, count(tx_hash) as total_sold_txsfrom linea_txswhere token_sold_address = 0xb3B3CA7cb0BCCb6A9316764826324A312665DC53and token_bought_address in(0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f --eth)group by 1), handle as (selecttrader_address, b.total_bought_amount, b.total_bought_volume_usd, b.total_bought_txs, s.total_sold_amount, s.total_sold_volume_usd, s.total_sold_txsfrom buy bleft join sell s using (trader_address))select *from handle