Query editor
-- Current owners of every DXT Terminal NFT (contract on Base)-- Latest transfer's `to` per tokenId = current holderWITH latest AS (SELECT"tokenId",max_by("to", evt_block_time) AS current_owner,MIN(evt_block_time) AS first_seen,MAX(evt_block_time) AS last_transfer_at,COUNT(*) AS transfer_countFROM dxterminal_base.dxterminal_evt_transferGROUP BY 1)SELECTto_hex(current_owner) AS owner_address_hex,COUNT(*) AS nfts_held,MIN(first_seen) AS oldest_nft_minted,MAX(last_transfer_at) AS latest_nft_received,array_agg(CAST("tokenId" AS varchar)) AS token_idsFROM latestWHERE current_owner != 0x0000000000000000000000000000000000000000 -- exclude burnsGROUP BY 1ORDER BY nfts_held DESC