Updated 2022-10-23
    with
    a as (
    select
    nft_to_address as wallets,
    '1' as flag
    FROM ethereum.core.ez_nft_transfers
    where (nft_address =lower('0x9c8ff314c9bc7f6e59a9d9225fb22946427edc03')
    )

    union all

    SELECT
    nft_from_address as wallets,
    '-1' as flag
    FROM ethereum.core.ez_nft_transfers
    where (nft_address =lower('0x9c8ff314c9bc7f6e59a9d9225fb22946427edc03')
    )
    ),

    b as (
    select
    wallets ,
    sum(flag) as nfts
    from a
    group by 1
    having 2 > 0
    order by 2 desc)


    select avg(nfts)
    from b where nfts !='0' and nfts>0
    Run a query to Download Data