jackguyPine nft v2 holders
    Updated 2023-07-10
    SELECT
    holder,
    count(DISTINCT tokenid) as tokens

    FROM (
    SELECT
    NFT_TO_ADDRESS as holder,
    tokenid,
    sum(
    CASE when NFT_FROM_ADDRESS LIKE '0x0000000000000000000000000000000000000000' then ERC1155_VALUE
    when NFT_TO_ADDRESS LIKE '0x0000000000000000000000000000000000000000' then -1 * ERC1155_VALUE
    end
    ) as token_amt
    from polygon.core.ez_nft_transfers
    WHERE NFT_ADDRESS LIKE lower('0x6A711028d8E01519Bc6524BEbC885f3DE36ccbB6')
    GROUP BY 1,2
    HAVING not holder = '0x0000000000000000000000000000000000000000'
    AND not tokenid = 55
    )
    WHERE token_amt >= 1
    GROUP BY 1

    Run a query to Download Data