Query editor
WITHdaily_volume (volume_date, volume, cumulative_volume) as (SELECTfrom_iso8601_timestamp(volume_date) as volume_date,SUM(taker_volume) as vol,SUM(SUM(taker_volume)) OVER (ORDER BYvolume_date ASC) as cumulative_volumeFROMdune.orderly_network.orderly_trading_summary_v2group byvolume_date),daily_volume_with_rolling (volume_date, volume, cumulative_volume, rolling_volume, rolling_total_volume) as (SELECTvolume_date,volume,cumulative_volume,AVG(volume) OVER (ORDER BY volume_date ASC ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) as rolling_volume,SUM(volume) OVER (ORDER BY volume_date ASC ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) as rolling_total_volumeFROM daily_volume)SELECT*FROMdaily_volume_with_rollingWHEREvolume_date >= current_date - interval '90' day and volume_date < current_dateORDER BY volume_date DESC