SandeshwolvesDAO airdrop holders
    Updated 2025-01-17
    WITH wolves_dao_members AS (
    SELECT
    DATE_TRUNC('week', block_timestamp) AS member_join_date,
    nft_to_address AS holder_address,
    tokenId
    FROM polygon.nft.ez_nft_transfers
    WHERE 1=1
    AND block_timestamp >= '2023-06-19 00:00:00.000'
    AND holder_address!='0x0000000000000000000000000000000000000000'
    AND nft_address = LOWER('0x0433882c60ada1077a9f652ca2d1d36422c62c6c')
    QUALIFY ROW_NUMBER() OVER (PARTITION BY tokenId ORDER BY block_number DESC) = 1
    ),
    base_tokens as
    (
    with token_transactions as (
    with token_in as
    (
    select block_timestamp,EVENT_INDEX,from_address as wolf, -1* amount as amount, symbol,contract_address
    from base.core.ez_token_transfers
    where block_timestamp>='2024-01-01'
    and wolf in ( select holder_address from wolves_dao_members)
    and contract_address in ('0x919e43a2cce006710090e64bde9e01b38fd7f32f','0x84a9aae8fcc085dbe11524f570716d89b772f430','0xef0fd52e65ddcdc201e2055a94d2abff6ff10a7a')
    ),
    token_out as
    (
    select block_timestamp,EVENT_INDEX,to_address as wolf, amount, symbol,contract_address
    from base.core.ez_token_transfers
    where block_timestamp>='2024-01-01'
    and wolf in ( select holder_address from wolves_dao_members)
    and contract_address in ('0x919e43a2cce006710090e64bde9e01b38fd7f32f','0x84a9aae8fcc085dbe11524f570716d89b772f430','0xef0fd52e65ddcdc201e2055a94d2abff6ff10a7a')
    ),
    combined as
    (
    select * from token_in
    union all
    select * from token_out
    QueryRunArchived: QueryRun has been archived