Updated 2025-04-30
    with base as (
    select
    TX_FROM as TX_SIGNER,
    min(date_trunc('month', BLOCK_TIMESTAMP)) over (partition by TX_SIGNER) as signup_date,
    date_trunc('month', BLOCK_TIMESTAMP) as activity_date,
    datediff('month', signup_date, activity_date) as difference
    from axelar.core.fact_transactions
    ),
    unp as (
    select
    TO_VARCHAR(signup_date, 'yyyy-MM') as cohort_date,
    difference as months,
    count (distinct TX_SIGNER) as users
    from
    base
    where
    datediff('month', signup_date, current_date()) <= 12
    group by
    1,2
    order by
    1
    ),
    fine as (
    select
    u.*,
    p.USERS as user0
    from
    unp u
    left join unp p on u.COHORT_DATE = p.COHORT_DATE
    where
    p.MONTHS = 0
    )
    select
    COHORT_DATE,
    MONTHS,
    round(100 * users / user0 , 2 ) as retention_rate
    Last run: about 1 month ago
    COHORT_DATE
    MONTHS
    RETENTION_RATE
    1
    2025-03132.85
    2
    2025-02125.94
    3
    2025-02221.81
    4
    2025-01126.22
    5
    2025-01221.47
    6
    2025-01318.63
    7
    2024-12119.92
    8
    2024-12213
    9
    2024-12311.53
    10
    2024-12411.1
    11
    2024-11125.39
    12
    2024-11219.76
    13
    2024-11315.12
    14
    2024-11413.62
    15
    2024-11512.95
    16
    2024-10125.54
    17
    2024-10220.5
    18
    2024-10317.22
    19
    2024-10414.25
    20
    2024-10513.99
    78
    2KB
    39s