with moonbird_nft as (
    select event_inputs:tokenId as tokenId,event_inputs:"to" as nft_holder,
    row_number() over (partition by event_inputs:tokenId order by block_timestamp,event_index desc) as rank
    from ethereum.core.fact_event_logs
    where
    contract_address = lower('0x23581767a106ae21c074b2276D25e5C3e136a68b') and event_name='Transfer'
    and event_removed='false' and tx_status='SUCCESS'
    qualify rank=1

    ),moonbird_wallet as(
    select nft_holder as wallet, sum(tokenId) as moonbirds_bal
    from moonbird_nft
    group by 1
    ),other_contract as (
    select distinct project_name, nft_address from ethereum.core.ez_nft_transfers where project_name !='' or project_name is not null
    )
    ,other_nft as (
    select contract_address,event_inputs:tokenId as tokenId,event_inputs:"to" as nft_holder,
    row_number() over (partition by contract_address,event_inputs:tokenId order by block_timestamp,event_index desc) as rank
    from ethereum.core.fact_event_logs
    where event_inputs:tokenId is not null and contract_address in ('0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d','0x8a90cab2b38dba80c64b7734e58ee1db38b8992e')
    and event_name='Transfer'
    and event_removed='false' and tx_status='SUCCESS'
    qualify rank=1

    ),other_nft_wallet as(
    select project_name,nft_holder as wallet, sum(other_nft.tokenId) as moonbirds_bal
    from other_nft,other_contract
    where wallet in (select wallet from moonbird_wallet) and other_nft.contract_address = other_contract.nft_address
    group by 1,2)

    select project_name,count(wallet) as crossover_wallet from other_nft_wallet
    group by 1
    order by 2 desc
    limit 2
    Run a query to Download Data