Sbhn_NPTop 5 Active Users by Number of Transactions
    Updated 2022-10-19
    with Daily_Active_User as (select count(*), tx_from from (select count(distinct block_timestamp::date), date_trunc('week', block_timestamp) , tx_from
    from osmosis.core.fact_transactions
    group by 2,3
    having count(distinct block_timestamp::date) > 4)
    group by 2
    )
    , Daily_Active_User_transactions as (select count(*) as tcount , block_timestamp::date as tdate from osmosis.core.fact_transactions
    where tx_from in (select tx_from from Daily_Active_User)
    group by tdate)
    , Daily_Active_User_transactions_top5 as (select count(*) as tcount , tx_from from osmosis.core.fact_transactions
    where tx_from in (select tx_from from Daily_Active_User)
    group by tx_from
    order by tcount desc
    limit 5)

    select * from Daily_Active_User_transactions_top5
    Run a query to Download Data