farid-c9j0VMDaily number of Transactions executed by Real Users vs Arbitrageurs
    Updated 2022-12-14
    --/credit Rayyyk
    with arbi 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),

    table_1 as (select date_trunc('week', block_timestamp) as week,
    count(distinct(tx_id)) as real_tx,
    sum(real_tx) over (order by week) as cumu_real_tx,
    count(distinct(trader)) as real_user
    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 arbi)
    group by 1),

    table_2 as (select date_trunc('week', block_timestamp) as week,
    count(distinct(tx_id)) as arbi_tx,
    sum(arbi_tx) over (order by week) as cumu_arbi_tx,
    count(distinct(trader)) as 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 arbi)
    group by 1)

    select a.week,
    real_tx,
    arbi_tx,
    Run a query to Download Data