0xPrzGnosis Total Active Vs New Users in Last 40 Days
    Updated 2022-10-16
    with new_user as (
    select
    min(block_timestamp) as min_date,
    from_address
    from gnosis.core.fact_transactions
    WHERE block_timestamp >= CURRENT_DATE - 40
    group by 2
    )
    select
    min_date::date as date,
    'New Users' as users,
    count(distinct from_address) as new_users_cnt,
    '0' as tx_cnt,
    '0' as cum_tx_cnt
    from new_user
    group by 1,2
    UNION
    select
    block_timestamp::date as date,
    'Active Users' as users,
    count(distinct from_address) as Users_Count,
    count(distinct tx_hash) as tx_cnt,
    sum(tx_cnt) over (order by date) as cum_tx_cnt
    from gnosis.core.fact_transactions
    where status = 'SUCCESS'
    and block_timestamp >= CURRENT_DATE - 40
    group by 1,2


    Run a query to Download Data