with buyers_minters as (
select
BUYER_ADDRESS,
TOKENID
from
ethereum.core.ez_nft_sales
where
NFT_ADDRESS = '0x60bb1e2aa1c9acafb4d34f71585d7e959f387769'
union all
select
NFT_TO_ADDRESS as BUYER_ADDRESS,
TOKENID
from
ethereum.core.EZ_NFT_MINTS
where
NFT_ADDRESS = '0x60bb1e2aa1c9acafb4d34f71585d7e959f387769'
), buyers as (
select
BUYER_ADDRESS,
count(distinct TOKENID) as tokens_count
from
buyers_minters
group by
BUYER_ADDRESS
), sellers as (
select
seller_ADDRESS,
count(distinct TOKENID) as tokens_count
from
ethereum.core.ez_nft_sales
where
NFT_ADDRESS = '0x60bb1e2aa1c9acafb4d34f71585d7e959f387769'
group by
seller_ADDRESS
), owners as (
select