Haisenberguser onboarding funnel
    Updated 2025-03-29
    -- Query to Analyze Aptos User Onboarding Funnel
    -- Step 1: Identify first transactions

    WITH first_transactions AS (
    SELECT
    sender,
    MIN(block_timestamp) AS first_transaction_date
    FROM
    aptos.core.fact_transactions
    WHERE
    block_timestamp >= DATE_TRUNC('month', CURRENT_DATE) - INTERVAL '10 months'
    GROUP BY
    sender
    ),

    -- Step 2: Identify regular users (at least 5 transactions in a month)
    regular_users AS (
    SELECT
    sender,
    DATE_TRUNC('month', block_timestamp) AS activity_month,
    COUNT(*) AS transaction_count
    FROM
    aptos.core.fact_transactions
    WHERE
    block_timestamp >= DATE_TRUNC('month', CURRENT_DATE) - INTERVAL '10 months'
    GROUP BY
    sender, DATE_TRUNC('month', block_timestamp)
    HAVING
    COUNT(*) >= 5
    ),
    -- Step 3: Combine stages to create user journey
    user_journey AS (
    SELECT
    DATE_TRUNC('month', ft.first_transaction_date) AS cohort_month,
    COUNT(DISTINCT ft.sender) AS new_users,
    COUNT(DISTINCT CASE WHEN ru.sender IS NOT NULL THEN ft.sender END) AS became_regular_users,
    Last run: 2 months ago
    COHORT_MONTH
    NEW_USERS
    ACTIVE_WITHIN_WEEK
    BECAME_REGULAR_USERS
    PCT_ACTIVE_WITHIN_WEEK
    PCT_BECAME_REGULAR_USERS
    1
    2024-05-01 00:00:00.000160732265555725700640.78566715.989702
    2
    2024-06-01 00:00:00.000348807683145711882523.8371243.406606
    3
    2024-07-01 00:00:00.0002026853102065512235450.3566376.036649
    4
    2024-08-01 00:00:00.00021596158447056539739.1136853.028179
    5
    2024-09-01 00:00:00.0002790747128255315216245.9573375.452375
    6
    2024-10-01 00:00:00.00064318142962356128143146.05786219.923322
    7
    2024-11-01 00:00:00.0004759940294623988420861.89655818.576032
    8
    2024-12-01 00:00:00.00063252393342893103554652.85006616.37165
    9
    2025-01-01 00:00:00.000105343914965402116660647.13515911.074261
    10
    2025-02-01 00:00:00.00010387122377355446515236.3291584.478161
    11
    2025-03-01 00:00:00.0007693178278234062000136.1663288.059101
    11
    776B
    235s