Updated 2024-05-29
    WITH
    arb_claims AS (
    SELECT
    BLOCK_TIMESTAMP AS claimTime
    , TX_HASH AS claimHash
    , TO_ADDRESS AS eligibleAddress
    , AMOUNT
    FROM arbitrum.core.ez_token_transfers --arbt
    --INNER JOIN external.layerzero.fact_transactions_snapshot lz ON arbt.TO_ADDRESS = lz.sender_wallet
    WHERE CONTRACT_ADDRESS = '0x912ce59144191c1204e64559fe8253a0e49e6548'
    AND FROM_ADDRESS = '0x67a24ce4321ab3af51c2d0a4801c3e111d88c9d9'
    AND TO_ADDRESS IN (SELECT DISTINCT(SENDER_WALLET) FROM external.layerzero.fact_transactions_snapshot)
    ORDER BY BLOCK_TIMESTAMP
    )

    , collecting_tokens AS (
    SELECT arbt.* FROM arbitrum.core.ez_token_transfers arbt
    INNER JOIN arb_claims t ON arbt.from_address = t.eligibleAddress AND arbt.amount = t.AMOUNT
    WHERE arbt.contract_address = '0x912ce59144191c1204e64559fe8253a0e49e6548'
    AND arbt.origin_function_signature = '0xa9059cbb'
    ORDER BY arbt.BLOCK_TIMESTAMP
    )

    , initial_list AS (
    SELECT addresssesInitialList , group_
    FROM (
    VALUES
    ('0xb3d39b29ef07a4d90306b0f701f78bbb6fe4455e', '5')
    ,('0xf674c1d1867e41f9e00208ac00751a6f19960c7f', '5')
    ,('0x6c1777b05d2724a379171800b78828d17cfa20c4', '5')
    ,('0xa8b562641fb747ad7e101dfc022ee059f510ef3c', '5')
    ,('0xfb3b24a10594b0e656d5998f662e1d1cf48b1991', '5')
    ,('0x84c2d33391f77dd1b10d843bce9cb767543b73bc', '5')
    ,('0x71c5f3b6b44bcf7495a220b798498e1dbda7344b', '5')
    ,('0x73b81c951857346301958b52db002cbbe6b71c58', '5')
    ,('0xebd68c828e9de092295d892ee50dc11c75ff9a61', '5')
    QueryRunArchived: QueryRun has been archived