0-MIDactive growth
    Updated 2023-01-04
    with tab1 as (
    select BLOCK_TIMESTAMP::date as date,count(distinct trader) as unique_swappers_from_akt
    from osmosis.core.fact_swaps
    where FROM_CURRENCY='ibc/1480B8FD20AD5FCAE81EA87584D269547DD4D436843C1D20F15E00EB64743EF4'
    --and date>=current_date-7
    and TX_STATUS='SUCCEEDED'
    group by 1),
    tab2 as (
    select BLOCK_TIMESTAMP::date as date,count(distinct trader) as unique_swappers_to_akt
    from osmosis.core.fact_swaps
    where TO_CURRENCY='ibc/1480B8FD20AD5FCAE81EA87584D269547DD4D436843C1D20F15E00EB64743EF4'
    --and date>=current_date-7
    and TX_STATUS='SUCCEEDED'
    group by 1)
    select tab2.date,unique_swappers_from_akt+unique_swappers_to_akt as active_swappers
    ,sum(active_swappers)over (order by tab2.date asc)as cumulative_active_swappers
    from tab1
    full outer join tab2
    on tab1.date=tab2.date


    Run a query to Download Data