SniperTotal Weekly Real User Count Vs Arbitrageurs Count
    Updated 2022-12-14
    with tbl1 as (select date_trunc('week', block_timestamp) as week,
    trader,
    count(distinct(tx_id)) as swap_count
    from osmosis.core.fact_swaps
    where tx_status = 'SUCCEEDED'
    and (from_currency = 'ibc/3FF92D26B407FD61AE95D975712A7C319CDE28DE4D80BDC9978D935932B991D7'
    or to_currency = '3FF92D26B407FD61AE95D975712A7C319CDE28DE4D80BDC9978D935932B991D7')
    group by 1,2
    having swap_count >= 100),

    tbl2 as (select date_trunc('week', block_timestamp) as week,
    'Real' as type,
    count(distinct(tx_id)) as real_tx,
    sum(real_tx) over (order by week) as cum_real_tx,
    count(distinct(trader)) as real_user,
    sum(real_user) over (order by week) as cum_real
    from osmosis.core.fact_swaps
    where tx_status = 'SUCCEEDED'
    and (from_currency = 'ibc/3FF92D26B407FD61AE95D975712A7C319CDE28DE4D80BDC9978D935932B991D7'
    or to_currency = '3FF92D26B407FD61AE95D975712A7C319CDE28DE4D80BDC9978D935932B991D7')
    and trader not in (select trader from tbl1)
    group by 1,2),

    tbl3 as (select date_trunc('week', block_timestamp) as week,
    'Arbitrageurs' as type,
    count(distinct(tx_id)) as arbitrageurs_tx,
    sum(arbitrageurs_tx) over (order by week) as cum_arbitrageurs_tx,
    count(distinct(trader)) as arbitrageurs,
    sum(arbitrageurs) over (order by week) as cum_arbitrageurs
    from osmosis.core.fact_swaps
    where tx_status = 'SUCCEEDED'
    and (from_currency = 'ibc/3FF92D26B407FD61AE95D975712A7C319CDE28DE4D80BDC9978D935932B991D7'
    or to_currency = '3FF92D26B407FD61AE95D975712A7C319CDE28DE4D80BDC9978D935932B991D7')
    and trader in (select trader from tbl1)
    group by 1,2)

    Run a query to Download Data