Query editor
withtoken_owner as (SELECTtoken_id,ARRAY_AGG(toORDER BYblock_number DESC) [1] AS wallet_addressFROMnft.transfersWHEREblockchain = 'polygon'AND contract_address = 0xD5cA946AC1c1F24Eb26dae9e1A53ba6a02bd97FeAND to <> 0x0000000000000000000000000000000000000000AND to <> 0x000000000000000000000000000000000000deadGROUP BYtoken_id),smartcat_tx as (selecttr."from" as wallet_address,tr.hash as tx_hash,casewhen exists (select1fromsmartcat_polygon.SmartCatProxyV2_call_feedCat fcwherefc.call_tx_hash = tr.hash) then trueend as is_feedcat_txfrompolygon.transactions trwheretr.to = 0x7573933eB12Fa15D5557b74fDafF845B3BaF0ba2and exists (select1fromtoken_ownerwheretoken_owner.wallet_address = tr."from"))SELECTtoken_owner.wallet_address AS wallet_address,COUNT(*) AS owns,COUNT(smartcat_tx.tx_hash) AS smartcat_tx_count,COUNT(smartcat_tx.is_feedcat_tx) > 0 AS contains_feedcat_txFROMtoken_ownerleft join smartcat_tx on smartcat_tx.wallet_address = token_owner.wallet_addressgroup bytoken_owner.wallet_address;