with addr as (
select address, project_name
from polygon.core.dim_labels
where label_type ilike '%nft%'
),
top as (
select rOW_NUMBER() OVER (PARTITION BY origin_address ORDER BY block_timestamp asc) as rank, origin_address, tx_id
from flipside_prod_db.polygon.udm_events, addr
where address = contract_address and event_name = 'transfer'
--order by block_timestamp asc
)(
select count(*)
from top join polygon.core.fact_transactions on tx_id = tx_hash
where rank = 1 and nonce = 0
)