0xHaM-dTotal daily unique users by transaction type
    Updated 2022-06-04
    with trans as (
    select block_timestamp::date as date,
    tx_id as tx,
    tx_from
    from osmosis.core.fact_transactions
    where block_timestamp::date >= '2022-01-01'
    )
    , msg as (
    select block_timestamp::date as date,
    msg_type,
    tx_id
    from osmosis.core.fact_msgs
    where block_timestamp::date >= '2022-01-01'
    and tx_status = 'SUCCEEDED'
    )
    , together as (
    select a.date,
    msg_type,
    tx_from
    from trans a left outer join msg b on a.tx = b.tx_id
    where a.date = b.date
    )
    , unique_users as (
    select min(date) as date,
    msg_type,
    tx_from
    from together
    group by 2,3
    )
    , filtere as (
    select trunc(date,'day') as day ,
    msg_type ,
    count(DISTINCT(tx_from)) as total_unique,
    sum(total_unique) over (partition by msg_type order by day asc) as cum_unique_users
    from unique_users
    group by 1,2
    Run a query to Download Data