sinahosseinzadehUntitled Query
    Updated 2022-08-31
    with buyer as
    (select distinct buyer_address as buyadd,
    sum(price_usd) as purchase
    from ethereum.core.ez_nft_sales
    where project_name like 'cryptopunks'
    and block_timestamp like '2022%'
    and price_usd > 0
    group by 1),

    seller as(
    select distinct seller_address as selladd,
    sum(price_usd) as sales
    from ethereum.core.ez_nft_sales
    where project_name like 'cryptopunks'
    and block_timestamp like '2022%'
    and price_usd > 0
    group by 1
    ),

    users as
    (select buyadd,
    selladd,
    sum(sales - purchase) as profit,
    sum(sales) as saless
    from seller
    join buyer
    where buyadd = selladd
    group by 1,2
    order by 3 desc
    limit 10),

    tpurch as
    (select sum(price_usd) as costs,
    block_timestamp as days
    from ethereum.core.ez_nft_sales
    where buyer_address in (select buyadd from users)
    Run a query to Download Data