freemartianPika Airdrop - OP Receivers
    Updated 2023-06-27
    -- forked from cypher / op airdrop stats @ https://flipsidecrypto.xyz/cypher/q/rwWOG8zr7YWE/op-airdrop-stats

    WITH op_claims as (
    select
    distinct to_address as op_claimer
    from optimism.core.ez_token_transfers
    where contract_address = lower('0x4200000000000000000000000000000000000042') --OP token
    and from_address = lower('0xfedfaf1a10335448b7fa0268f56d2b44dbd357de') --claim contract
    ),

    ARB_claims as (
    SELECT
    distinct FROM_ADDRESS as arb_claimer
    FROM
    arbitrum.core.fact_transactions
    WHERE
    ORIGIN_FUNCTION_SIGNATURE IN ('0x4e71d92d', '0x78e2b594')
    AND TO_ADDRESS = '0x67a24ce4321ab3af51c2d0a4801c3e111d88c9d9'
    AND BLOCK_NUMBER >= 70506697
    AND STATUS = 'SUCCESS')

    select
    count( distinct to_address) as claimers_count,
    'Both PIKA & OP' as label

    from optimism.core.ez_token_transfers
    where from_address = '0x67a9e34a763395266612ffc8c9305eb2fca4d4be'
    and contract_address = '0x1508fbb7928aedc86bee68c91bc4afcf493b0e78'
    and origin_function_signature = '0x3d13f874'
    and to_address in (select op_claimer from op_claims)
    group by label

    UNION

    select
    count( distinct to_address) as claimers_count,
    Run a query to Download Data