Query editor
WITH backgrounds AS (SELECTCAST(split(token_idbackground, ',')[1] AS BIGINT) AS token_id,split(token_idbackground, ',')[2] AS backgroundFROM dune.klintoshi.dataset_bosu_legacy_backgrounds_Klintoshi),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,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),