alexmcculloughPolygon Flow
    Updated 2024-11-14
    -- Query to track Coinbase flows on the Optimism blockchain
    -- Ensures each wallet address is only tracked once
    -- Includes labels from Ethereum, Base, Optimism, and Arbitrum
    -- Includes transfers involving 'hot_wallet' and 'deposit_wallet' addresses
    -- Excludes internal transfers and transfers involving other label_subtypes

    WITH all_labels AS (
    -- Combine labels from multiple chains and assign a priority to each blockchain
    SELECT address, project_name, label_subtype
    FROM (
    SELECT
    'ethereum' AS blockchain,
    address,
    label AS project_name,
    label_subtype,
    1 AS blockchain_priority
    FROM ethereum.core.dim_labels

    UNION ALL

    SELECT
    'base' AS blockchain,
    address,
    project_name,
    label_subtype,
    2 AS blockchain_priority
    FROM base.core.dim_labels

    UNION ALL

    SELECT
    'optimism' AS blockchain,
    address,
    project_name,
    label_subtype,
    3 AS blockchain_priority
    QueryRunArchived: QueryRun has been archived