adriaparcerisasflow users interval retention
    Updated 2025-03-17
    WITH user_activity AS (
    -- First get all user activity from both chains with daily granularity
    SELECT
    CAST(value AS VARCHAR) AS user_address,
    DATE_TRUNC('day', b.block_timestamp) AS activity_day
    FROM
    flow.core.ez_transaction_actors AS b,
    LATERAL FLATTEN(INPUT => b.actors) AS a
    WHERE
    block_timestamp >= DATEADD(month, -4, CURRENT_DATE)
    UNION ALL
    SELECT
    from_address AS user_address,
    DATE_TRUNC('day', block_timestamp) AS activity_day
    FROM
    flow.core_evm.fact_transactions
    WHERE
    block_timestamp >= DATEADD(month, -4, CURRENT_DATE)
    ),

    user_first_day AS (
    -- Get each user's first day of activity
    SELECT
    user_address,
    MIN(activity_day) AS first_activity_day
    FROM user_activity
    GROUP BY 1
    ),

    base_cohort_size AS (
    SELECT
    first_activity_day,
    COUNT(DISTINCT user_address) as cohort_size
    FROM user_first_day
    Last run: 17 days ago
    RETENTION_DAY
    AVG_RETENTION_RATE
    1
    0100
    2
    14.66392857
    3
    21.83
    4
    31.87807692
    5
    41.29
    6
    51.12916667
    7
    61.01173913
    8
    70.92727273
    9
    80.94238095
    10
    90.9135
    11
    100.60894737
    12
    111.23055556
    13
    121.11941176
    14
    130.834375
    15
    140.85466667
    16
    150.71642857
    17
    160.67769231
    18
    170.7025
    19
    181.00363636
    20
    190.793
    29
    390B
    10s