i_danpowerful-violet
    Updated 2025-01-21
    --SELECT
    -- program_name
    -- , count(*)
    --FROM crosschain.olas.ez_olas_staking
    --GROUP BY 1

    WITH first_stake AS (

    SELECT
    origin_from_address
    , MIN(block_timestamp) AS first_stake_date
    FROM
    crosschain.olas.ez_olas_staking
    GROUP BY
    1
    )--,

    --subsequent_stakes AS (

    SELECT
    s.origin_from_address
    , s.block_timestamp
    FROM
    crosschain.olas.ez_olas_staking s
    JOIN
    first_stake f ON s.origin_from_address = f.origin_from_address
    WHERE
    s.block_timestamp > f.first_stake_date
    ),

    groups AS (

    SELECT
    origin_from_address
    , EXTRACT(week FROM first_stake_date) AS group_week
    FROM
    Last run: 2 months ago
    GROUP_WEEK
    ACTIVITY_WEEK
    RETAINED_USERS
    TOTAL_USERS
    RETENTION_RATE
    CHURN_RATE
    1
    561333.3366.67
    2
    581333.3366.67
    3
    591333.3366.67
    4
    5101333.3366.67
    5
    5112366.6733.33
    6
    5131333.3366.67
    7
    5151333.3366.67
    8
    5162366.6733.33
    9
    5171333.3366.67
    10
    5182366.6733.33
    11
    5201333.3366.67
    12
    5231333.3366.67
    13
    5241333.3366.67
    14
    5261333.3366.67
    15
    5271333.3366.67
    16
    5281333.3366.67
    17
    5291333.3366.67
    18
    5301333.3366.67
    19
    5321333.3366.67
    20
    5331333.3366.67
    ...
    177
    3KB
    54s