MahrooUntitled Query
    Updated 2022-11-15
    with maintable as (
    select block_timestamp::date as date,
    case when date < '2022-11-08' then 'Before FTX & Alameda Collapse'
    when date >= '2022-11-08' then 'During and After FTX & Alameda Collapse' end as timespan,
    count (distinct tx_id) as Swaps_Count,
    count (distinct trader) as Swappers_Count
    from osmosis.core.fact_swaps
    where tx_status = 'SUCCEEDED'
    and block_timestamp >= CURRENT_DATE - 90
    group by 1,2)

    select timespan,
    avg (swaps_count) as Average_Swaps_Count,
    avg (swappers_count) as Average_Swappers_Count
    from maintable
    where date != CURRENT_DATE
    group by 1
    Run a query to Download Data