mz0111osmo 2
    Updated 2022-10-20
    --credit : 0xHaM☰d
    with active_user as (
    select
    date_trunc('week', block_timestamp)::date as date,
    tx_from as active_users,
    count(distinct block_timestamp::date) as dt_cnt
    from osmosis.core.fact_transactions
    group by 1, 2
    having dt_cnt >= 5
    )
    select
    dayname(b.block_timestamp::date) as dt_name,
    msg_type,
    COUNT(DISTINCT active_users) as active_user_cnt,
    COUNT(DISTINCT b.tx_id) as tx_cnt
    from active_user a join osmosis.core.fact_transactions b on a.active_users = b.tx_from
    JOIN osmosis.core.fact_msgs c on c.tx_id = b.tx_id
    and msg_type in ('tx','proposal_vote', 'delegate', 'ibc_transfer','lock_tokens'
    ,'token_swapped', 'add_tokens_to_lock', 'pool_joined', 'burn', 'superfluid_increase_delegation')
    GROUP BY 1,2
    Run a query to Download Data