Updated 2025-02-13
    WITH daily_swappers AS (
    SELECT
    DATE_TRUNC('day', block_timestamp) AS swap_date,
    origin_from_address
    FROM ronin.core.ez_decoded_event_logs
    WHERE event_name = 'Swap'
    AND block_timestamp >= CURRENT_DATE - INTERVAL '7 days'
    ),

    cohort_base AS (
    SELECT
    swap_date AS cohort_date,
    origin_from_address
    FROM daily_swappers
    ),

    retention_tracking AS (
    SELECT
    b.cohort_date,
    d.swap_date,
    COUNT(DISTINCT d.origin_from_address) AS retained_users
    FROM cohort_base b
    JOIN daily_swappers d
    ON b.origin_from_address = d.origin_from_address
    AND d.swap_date > b.cohort_date
    GROUP BY b.cohort_date, d.swap_date
    ),

    cohort_counts AS (
    SELECT
    cohort_date,
    COUNT(DISTINCT origin_from_address) AS initial_users
    FROM cohort_base
    GROUP BY cohort_date
    )

    Last run: 3 months ago
    COHORT_DATE
    SWAP_DATE
    INITIAL_USERS
    RETAINED_USERS
    RETENTION_RATE
    1
    2025-02-06 00:00:00.0002025-02-07 00:00:00.0007211223731.02
    2
    2025-02-06 00:00:00.0002025-02-08 00:00:00.0007211202628.1
    3
    2025-02-06 00:00:00.0002025-02-09 00:00:00.0007211192226.65
    4
    2025-02-06 00:00:00.0002025-02-10 00:00:00.0007211216430.01
    5
    2025-02-06 00:00:00.0002025-02-11 00:00:00.0007211222630.87
    6
    2025-02-06 00:00:00.0002025-02-12 00:00:00.0007211258735.88
    7
    2025-02-06 00:00:00.0002025-02-13 00:00:00.0007211175424.32
    8
    2025-02-07 00:00:00.0002025-02-08 00:00:00.0006505198730.55
    9
    2025-02-07 00:00:00.0002025-02-09 00:00:00.0006505187928.89
    10
    2025-02-07 00:00:00.0002025-02-10 00:00:00.0006505212132.61
    11
    2025-02-07 00:00:00.0002025-02-11 00:00:00.0006505218933.65
    12
    2025-02-07 00:00:00.0002025-02-12 00:00:00.0006505236436.34
    13
    2025-02-07 00:00:00.0002025-02-13 00:00:00.0006505165625.46
    14
    2025-02-08 00:00:00.0002025-02-09 00:00:00.0005802188032.4
    15
    2025-02-08 00:00:00.0002025-02-10 00:00:00.0005802194933.59
    16
    2025-02-08 00:00:00.0002025-02-11 00:00:00.0005802195533.7
    17
    2025-02-08 00:00:00.0002025-02-12 00:00:00.0005802210836.33
    18
    2025-02-08 00:00:00.0002025-02-13 00:00:00.0005802152126.22
    19
    2025-02-09 00:00:00.0002025-02-10 00:00:00.0005502197535.9
    20
    2025-02-09 00:00:00.0002025-02-11 00:00:00.0005502193135.1
    28
    2KB
    3s