RamaharCosmos new vs existing users
    Updated 2022-12-18
    With newWallet as (select
    MIN(DATE(block_timestamp)) as first_date,
    tx_from
    from cosmos.core.fact_transactions
    group by 2),

    newUsers as (select
    first_date,
    count(distinct tx_from) as new_users
    from newWallet
    group by 1 )

    select
    DATE(block_timestamp) as dayz,
    count (distinct t.tx_from) as Users,
    new_users,
    users - coalesce(new_users, 0) as existing_users
    from cosmos.core.fact_transactions t
    left join newUsers ON first_date = t.block_timestamp::date
    group by 1 , 3
    having dayz >= '2022-01-01'


    Run a query to Download Data