Query editor
withbuy as (selectdate_trunc('day',block_time) as trx_date, count(tx_id) as bought, sum(amount_usd) as buy_volumefromdex_solana.tradeswheretoken_bought_mint_address = '{{Contract Address}}'group by 1),sell as (selectdate_trunc('day',block_time) as trx_date, count(tx_id) as sold, sum(amount_usd) as sell_volumefromdex_solana.tradeswheretoken_sold_mint_address = '{{Contract Address}}'group by 1)select*, (buy.bought - sell.sold) as "net trade", (buy.buy_volume - sell.sell_volume) as "net volume"frombuyleft join sellon buy.trx_date = sell.trx_datewherebuy.trx_date > now() - interval '{{Day}}' dayorder by 1 asc