Query editor
select date_ ,total_volume ,sum(total_volume) over (order by date_) * 1.0 as Cumulative_Volume,sum(total_volume) over (order by date_) * 1.0 / 1e9 as Cumulative_Volume_B,AVG(total_volume) OVER (ORDER BY date_ ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS avg_7_daysfrom(select date_trunc('day',date_) as date_ ,sum(size)/1e30 as total_volume from((select evt_block_time as date_ ,abs(cast(increasedSize as double)) as size from hmx_arbitrum.TradeService_evt_LogIncreasePosition)union all(select evt_block_time as date_,abs(cast(decreasedSize as double)) as size from hmx_arbitrum.TradeService_evt_LogDecreasePosition)union all(select evt_block_time as date_,abs(cast(size as double)) as size from hmx_arbitrum.LiquidationService_evt_LogLiquidationPosition)union all(select evt_block_time as date_ ,abs(cast(increasedSize as double)) as size from hmx_blast.TradeService_evt_LogIncreasePosition)union all(select evt_block_time as date_,abs(cast(decreasedSize as double)) as size from hmx_blast.TradeService_evt_LogDecreasePosition)union all(select evt_block_time as date_,abs(cast(size as double)) as size from hmx_blast.LiquidationService_evt_LogLiquidationPosition))group by date_trunc('day',date_))