Query editor
/*Query outputs the total uninque holders of the target NFT collection.*/WITH/*1. Fetching all transfers per NFT.For each NFT transfer, adding its order within all transfers of this specific NFT.E.g. "1" means that this transfer was the latest for this NFT etc.*/ranked_transfers AS (SELECTtokenId AS token_id,"to" AS current_owner,ROW_NUMBER() OVER (PARTITION BY tokenId ORDER BY evt_block_time DESC) AS rnFROM erc721_{{blockchain}}.evt_transferWHERE contract_address = {{nft_contract_address}}),/*2. Fetching current owners of the NFTs of the target collectionOwner of a specific NFT is defined as the recipient address of the latest transfer of this NFT.*/current_owners AS (SELECTcurrent_owner,token_idFROM ranked_transfersWHERE rn=1)/*Finally, coining all holders.*/SELECTCOUNT(DISTINCT(current_owner)) AS total_ownersFROM current_ownersWHERE current_owner NOT IN ({{owners_to_ignore}})