Afonso_DiazNew / Old Users
    Updated 2025-04-11
    with

    main as (
    select
    tx_hash,
    block_timestamp,
    from_address as user
    from
    mezo.testnet.fact_transactions
    where
    tx_succeeded
    ),

    dayly_users as (
    select
    date_trunc('day', block_timestamp) as day,
    user,
    min(block_timestamp) over (partition by user) as first_seen
    from main
    ),

    dayly_metrics as (
    select
    day,
    count(distinct user) as active_users,
    count(distinct case when date_trunc('day', first_seen) = day then user end) as new_users,
    count(distinct case when date_trunc('day', first_seen) < day then user end) as returning_users
    from dayly_users
    group by day
    ),

    retention as (
    select
    w1.day as current_day,
    w2.day as previous_day,
    count(distinct w1.user) as retained_users
    Last run: 18 days ago
    DAY
    ACTIVE_USERS
    NEW_USERS
    RETURNING_USERS
    RETAINED_USERS
    RETENTION_RATE
    1
    2025-03-29 00:00:00.0009393000
    2
    2025-03-30 00:00:00.000166161553.01
    3
    2025-03-31 00:00:00.000176171542.27
    4
    2025-04-01 00:00:00.000194187763.09
    5
    2025-04-02 00:00:00.0003022851782.65
    6
    2025-04-03 00:00:00.00032730720185.5
    7
    2025-04-04 00:00:00.00055251240335.98
    8
    2025-04-05 00:00:00.00053950336264.82
    9
    2025-04-06 00:00:00.00045141437163.55
    10
    2025-04-07 00:00:00.00057950079315.35
    11
    2025-04-08 00:00:00.00010675924751029.56
    12
    2025-04-09 00:00:00.000106056649413212.45
    13
    2025-04-10 00:00:00.00091358932411412.49
    14
    2025-04-11 00:00:00.0004201972236214.76
    14
    656B
    3s