Updated 2023-01-17
    with tx_Oct28 as (
    select
    date_trunc('day', BLOCK_TIMESTAMP) as date,
    case
    WHEN block_timestamp::date BETWEEN '2022-03-10' and '2022-05-15' THEN '> L Collapse: FROM OSMO'
    WHEN block_timestamp::date BETWEEN '2022-10-26' and '2022-10-31' THEN 'List Week: FROM OSMO'
    ELSE 'Other day: FROM OSMO' end as swap,
    COUNT(DISTINCT TX_ID) as tx_cnt_from_osmo,
    SUM(FROM_AMOUNT/1e6) as "Vol from Osmo(OSMO)",
    avg(tx_cnt_from_osmo) over (ORDER BY date ROWS BETWEEN 60 PRECEDING AND CURRENT ROW) as ma_60_osmo_tx_swapped,
    avg("Vol from 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 from_currency = 'uosmo'
    group by 1,2
    )
    SELECT
    *
    FROM tx_Oct28
    where date BETWEEN '2022-03-10' and '2022-10-31'
    Run a query to Download Data