Query editor
with volume as (selectdate_trunc('day', block_time) as timeframe,'Buy' as trade_direction, sum(amount_usd) as volumefrom dex.tradeswhere blockchain = 'base'and token_bought_address = 0x36B0Bc9B7cd78C589076c8Fb7CD3f68b25b9770agroup by 1,2union allselectdate_trunc('day', block_time) as timeframe,'Sell' as trade_direction, sum(amount_usd) as volumefrom dex.tradeswhere blockchain = 'base'and token_sold_address = 0x36B0Bc9B7cd78C589076c8Fb7CD3f68b25b9770agroup by 1,2)selecttimeframe, trade_direction, volume, sum(volume) over (order by timeframe ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) as total_volumefrom volumeorder by timeframe desc