with tx_Oct28 as (
select
date_trunc('day', BLOCK_TIMESTAMP) as date,
SUM(TO_AMOUNT/1e6) as "Vol to Osmo(OSMO)",
avg("Vol to Osmo(OSMO)") over (ORDER BY date ROWS BETWEEN 60 PRECEDING AND CURRENT ROW) as ma_60_osmo_amount_swapped
from osmosis.core.fact_swaps
where to_currency = 'uosmo'
group by 1
)
SELECT
*
FROM tx_Oct28
where date BETWEEN '2022-10-24' and '2022-10-31'