Updated 6 days ago
    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: 6 days ago
    COHORT_DATE
    MONTHS
    RETENTION_RATE
    1
    2025-03110
    2
    2025-02111.76
    3
    2025-0225.88
    4
    2025-01110.34
    5
    2025-0126.9
    6
    2025-01313.79
    7
    2024-1214.69
    8
    2024-1221.56
    9
    2024-1233.13
    10
    2024-1246.25
    11
    2024-1115.66
    12
    2024-1121.89
    13
    2024-1143.77
    14
    2024-1153.77
    15
    2024-1017.14
    16
    2024-1027.14
    17
    2024-1037.14
    18
    2024-1042.38
    19
    2024-1054.76
    20
    2024-1067.14
    54
    1KB
    140s