Updated 2025-02-18
    with base as (
    select
    call:transaction:from as TX_SIGNER,
    min(date_trunc('month', created_at)) over (partition by TX_SIGNER) as signup_date,
    date_trunc('month', created_at) as activity_date,
    datediff('month', signup_date, activity_date) as difference
    from axelar.axelscan.fact_gmp
    where call ilike '%0xb5fb4be02232b1bba4dc8f81dc24c26980de9e3c%' -- ITS Contract
    and (data:executed:receipt:logs[1]:address=lower('0x4e78011Ce80ee02d2c3e649Fb657E45898257815')
    or data:executed:receipt:logs[1]:address=lower('0xDCEFd8C8fCc492630B943ABcaB3429F12Ea9Fea2'))),
    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,
    Last run: about 2 months ago
    COHORT_DATE
    MONTHS
    RETENTION_RATE
    1
    2025-01110.34
    2
    2024-1214.69
    3
    2024-1221.56
    4
    2024-1115.66
    5
    2024-1121.89
    6
    2024-1017.14
    7
    2024-1027.14
    8
    2024-1037.14
    9
    2024-1042.38
    10
    2024-09126.32
    11
    2024-09221.05
    12
    2024-09310.53
    13
    2024-09413.16
    14
    2024-0955.26
    15
    2024-0817.55
    16
    2024-0827.55
    17
    2024-0837.55
    18
    2024-0843.77
    19
    2024-0851.89
    20
    2024-0861.89
    53
    1013B
    60s