jackguy2023-08-03 05:57 PM
    Updated 2023-11-01
    SELECT
    nft_address,
    project_name,
    count(DISTINCT address) as holders,
    sum(holding) as nfts_minted

    FROM (
    SELECT
    address,
    project_name,
    nft_address,
    count(CASE when tx_type LIKE 'in' then 1 end) - count(CASE when tx_type LIKE 'out' then 1 end) as holding

    FROM (
    SELECT
    project_name,
    nft_address,
    'out' as tx_type,
    nft_from_address as address
    FROM base.core.ez_nft_transfers

    UNION

    SELECT
    project_name,
    nft_address,
    'in' as tx_type,
    nft_to_address as address
    FROM base.core.ez_nft_transfers
    )
    GROUP BY 1,2,3
    )
    WHERE not holding = 0
    and not address LIKE '0x0000000000000000000000000000000000000000'
    Run a query to Download Data