Query editor
WITH legacy_transfers AS (SELECTtoken_id,"from","to",block_timeFROM nft.transfersWHERE blockchain = 'ethereum'AND contract_address = 0xb792864e4659d0b8076f9c6912c228f914ec66d4),current_token_owner AS (SELECTtoken_id,owner,received_timeFROM (SELECTtoken_id,"to" AS owner,block_time AS received_time,ROW_NUMBER() OVER (PARTITION BY token_idORDER BY block_time DESC) AS rnFROM legacy_transfers) tWHERE rn = 1AND owner NOT IN (0x0000000000000000000000000000000000000000,0x000000000000000000000000000000000000dead)),holder_legacy_count AS (SELECTowner AS wallet,COUNT(*) AS legacy_count,MAX(received_time) AS last_legacy_received_timeFROM current_token_ownerGROUP BY 1),wallet_activity AS (SELECTh.wallet,MAX(tx.block_time) AS last_outgoing_activityFROM holder_legacy_count hLEFT JOIN ethereum.transactions txON tx."from" = h.walletAND tx.block_time > h.last_legacy_received_timeGROUP BY 1),classified_holders AS (SELECTh.wallet,h.legacy_count,h.last_legacy_received_time,w.last_outgoing_activity,