cypherCryptoPunks Sales and Traders - number of punks
    Updated 2022-08-31
    with buys as (select
    block_timestamp as buy_time,
    buyer_address as address,
    price as buy_price,
    price_usd as buy_usd,
    tokenid as punk

    from ethereum.core.ez_nft_sales
    where nft_address = '0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb'
    and price > 0
    and price_usd > 0
    ),

    sells as (select
    block_timestamp as sell_time,
    seller_address as address,
    price as sell_price,
    price_usd as sell_usd,
    tokenid as punk

    from ethereum.core.ez_nft_sales
    where nft_address = '0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb'
    and price > 0
    and price_usd > 0
    ),

    sales as (select * from buys
    left join sells using (address, punk))

    select
    address,
    count(distinct(punk)) as n_punks,
    rank() over (order by n_punks desc) as punks_rank
    from sales
    where sell_time is null
    group by address
    Run a query to Download Data