Query editor
withbuy as (selectdate_trunc('minute',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('minute',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),first_buy as (select min(trx_date) as first_datefrom buy)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_datecross join first_buywherebuy.trx_date >= first_buy.first_dateand buy.trx_date < first_buy.first_date + interval '{{Minute}}' minuteorder by 1 asc