Query editor
withbuys as (selecttaker as trader,sum(token_bought_amount) as gno_bought,sum(amount_usd) as usd_boughtfromdex.tradeswhere --blockchain in ('ethereum')--,'gnosis')token_bought_address = 0x6810e776880C02933D47DB1b9fc05908e5386b96and blockchain = 'ethereum'and block_date > cast('2023-10-01' as date)and tx_to <> 0x9008d19f58aabd9ed0d60971565aa8510560ab41group by1),sells as (selecttaker as trader,sum(- token_sold_amount) as gno_bought,sum(- amount_usd) as usd_boughtfromdex.tradeswhere --blockchain in ('ethereum')--,'gnosis')token_sold_address = 0x6810e776880C02933D47DB1b9fc05908e5386b96and blockchain = 'ethereum'and block_date > cast('2023-10-01' as date)and tx_to <> 0x9008d19f58aabd9ed0d60971565aa8510560ab41group by1),others_bought_mainnet_balance as (selecttrader,sum(gno_bought) as gno_bought,sum(usd_bought) as usd_boughtfrom(select*frombuysunion allselect*fromsells)group by1),buys_gc as (selecttaker as trader,sum(token_bought_amount) as gno_bought,sum(amount_usd) as usd_boughtfromdex.tradeswhere --blockchain in ('ethereum')--,'gnosis')token_bought_address = 0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb