Afonso_DiazNew / Active users + Retention Rate
    Updated 7 days ago
    with

    main as (
    select
    tx_hash,
    block_timestamp,
    from_address as user,
    tx_fee,
    iff(origin_function_signature = '0xe884624b', 'GM to a Fren', 'GM') as tx_type
    from
    ink.core.fact_transactions
    where
    tx_succeeded
    and to_address = '0x9f500d075118272b3564ac6ef2c70a9067fd2d3f'
    and origin_function_signature in ('0xe884624b', '0xc0129d43')
    ),

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

    weekly_metrics as (
    select
    week,
    count(distinct user) as active_users,
    count(distinct case when date_trunc('week', first_seen) = week then user end) as new_users,
    count(distinct case when date_trunc('week', first_seen) < week then user end) as returning_users
    from weekly_users
    group by week
    ),

    retention as (
    Last run: 7 days ago
    WEEK
    ACTIVE_USERS
    NEW_USERS
    RETURNING_USERS
    RETAINED_USERS
    RETENTION_RATE
    1
    2025-01-20 00:00:00.000100430100430000
    2
    2025-01-27 00:00:00.00012072829294914349143475.74
    3
    2025-02-03 00:00:00.0001033287764955649401790.99
    4
    2025-02-10 00:00:00.00011347715149983289613884.72
    5
    2025-02-17 00:00:00.000112675359210908310679094.78
    6
    2025-02-24 00:00:00.000110144454110560310354794.01
    7
    2025-03-03 00:00:00.000118755887010988510417287.72
    8
    2025-03-10 00:00:00.0001790776271011636711223062.67
    9
    2025-03-17 00:00:00.000177520573917178116984895.68
    10
    2025-03-24 00:00:00.000176298167417462417048696.7
    11
    2025-03-31 00:00:00.000173981161417236716896297.12
    12
    2025-04-07 00:00:00.000172417162917078816568096.09
    13
    2025-04-14 00:00:00.000167096135016574616356397.89
    14
    2025-04-21 00:00:00.00015488124915463215379399.3
    14
    823B
    4s