check_sked*****New Address by First Interaction (Network and Duration Paramatized) - Solana copy copy
    Updated 2024-02-26
    -- forked from *****New Address by First Interaction (Network and Duration Paramatized) - arbitrum copy @ https://flipsidecrypto.xyz/edit/queries/ba209be6-f54b-47b9-951a-7fede4300adb

    WITH all_first_appearance AS (
    SELECT
    from_address,
    MIN(block_timestamp) AS first_timestamp
    FROM
    arbitrum.core.fact_transactions
    GROUP BY
    from_address
    ),
    period_first_appearance AS (
    SELECT
    aft.from_address,
    aft.first_timestamp,
    ft.to_address,
    date_trunc('{{granularity}}', ft.block_timestamp) AS wk
    FROM
    all_first_appearance aft
    JOIN
    arbitrum.core.fact_transactions ft ON aft.from_address = ft.from_address AND aft.first_timestamp = ft.block_timestamp
    WHERE
    ft.block_timestamp > current_date() - interval '{{periods}} {{granularity}}'
    ),
    filtered_labels AS (
    SELECT
    pfa.from_address,
    pfa.to_address,
    pfa.wk,
    dl.project_name -- Now directly selecting dl.label without grouping into 'Other'
    FROM
    period_first_appearance pfa
    JOIN
    arbitrum.core.dim_labels dl ON pfa.to_address = dl.address
    LEFT JOIN
    arbitrum.core.dim_labels dl2 ON pfa.from_address = dl2.address
    QueryRunArchived: QueryRun has been archived