Updated 2025-02-18
    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: 2 months ago
    COHORT_DATE
    MONTHS
    RETENTION_RATE
    1
    2025-01122.46
    2
    2024-12119.92
    3
    2024-12210.63
    4
    2024-11125.39
    5
    2024-11219.76
    6
    2024-11312.64
    7
    2024-10125.54
    8
    2024-10220.5
    9
    2024-10317.22
    10
    2024-10412.22
    11
    2024-09123.35
    12
    2024-09223.18
    13
    2024-09320.23
    14
    2024-09420.83
    15
    2024-09510.5
    16
    2024-08120.1
    17
    2024-08219.47
    18
    2024-08317.86
    19
    2024-08416.47
    20
    2024-08521.77
    78
    2KB
    51s