Haisenbergblast-acquired-user2
    Updated 2024-06-28

    -- forked from blast-acquired-user1 @ https://flipsidecrypto.xyz/edit/queries/bba2c5c0-52e5-4a48-b622-0023aba9ea54

    with acq AS
    (SELECT
    from_address
    FROM blast.core.fact_transactions
    where nonce=1),

    acq_user_base AS (
    SELECT
    date_trunc('{{time_range}}', block_timestamp) as date,
    ac.from_address as sender,
    label_type as sector
    FROM blast.core.fact_transactions s
    LEFT JOIN blast.core.dim_labels a on s.to_address = a.address
    INNER JOIN acq ac ON ac.from_address=s.from_address
    AND label_type NOT IN ('chadmin','token')
    GROUP BY 1, 2, 3
    HAVING sector IS NOT NULL
    )

    SELECT
    date as "Date",
    sector,
    count(sender) as "Acquired users"
    FROM acq_user_base
    WHERE
    date >= '{{Start_Date}}'
    AND date <= '{{End_Date}}'
    AND date <= current_date - 1
    GROUP BY 1, 2
    ORDER BY 2 DESC


    QueryRunArchived: QueryRun has been archived