Afonso_DiazNew / Active users + Retention Rate
    Updated 8 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')
    ),

    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 (
    Last run: 8 days ago
    DAY
    ACTIVE_USERS
    NEW_USERS
    RETURNING_USERS
    RETAINED_USERS
    RETENTION_RATE
    1
    2025-01-21 00:00:00.000125125000
    2
    2025-01-22 00:00:00.0001055102827272.56
    3
    2025-01-23 00:00:00.00013758131416175463.97
    4
    2025-01-24 00:00:00.0001436992305139492334.26
    5
    2025-01-25 00:00:00.000514203999811422592811.53
    6
    2025-01-26 00:00:00.0005295036908160421069620.2
    7
    2025-01-27 00:00:00.0009317016733764373947342.37
    8
    2025-01-28 00:00:00.000772441981752636519584.4
    9
    2025-01-29 00:00:00.000693721986673865581180.45
    10
    2025-01-30 00:00:00.000777243310744145399869.47
    11
    2025-01-31 00:00:00.000804191946784736884985.61
    12
    2025-02-01 00:00:00.000592441631576135047585.2
    13
    2025-02-02 00:00:00.000794881707777814812860.55
    14
    2025-02-03 00:00:00.00067912994669185664283.4
    15
    2025-02-04 00:00:00.000412201034401861780543.2
    16
    2025-02-05 00:00:00.000704051130692753142944.64
    17
    2025-02-06 00:00:00.000482261001472252600653.93
    18
    2025-02-07 00:00:00.00071690778709122774438.7
    19
    2025-02-08 00:00:00.000754631524739395319370.49
    20
    2025-02-09 00:00:00.000758451303745425676274.84
    45
    2KB
    3s