amirrzNet eth profit and loss on average per user
    Updated 2022-10-24
    with
    buytable as (
    select
    buyer_address as Buyers,
    count(distinct tx_hash),
    count(distinct tokenid) as Tokens_Count,
    sum (price_usd) as USD_Value,
    sum (price) as ETH_Value
    from
    ethereum.core.ez_nft_sales
    where
    project_name = 'cryptopunks' and event_type = 'sale' and buyer_address != '0x0000000000000000000000000000000000000000'
    and
    price_usd > 0 and price > 0 group by 1),
    selltable as ( select
    seller_address as Seller,
    count(distinct tx_hash),
    count(distinct tokenid) as Tokens_Count,
    sum (price_usd) as USD_Value,
    sum (price) as ETH_Value
    from
    ethereum.core.ez_nft_sales
    where
    project_name = 'cryptopunks' and event_type = 'sale' and seller_address != '0x0000000000000000000000000000000000000000'
    and
    price_usd > 0 and price > 0 group by 1),

    table1 as ( select
    buyers as Trader,
    sum (t2.usd_value - t1.usd_value) as USD_Profit,
    sum (t2.ETH_Value - t1.ETH_Value) as ETH_Profit
    from
    buytable t1 join selltable t2 on buyers = seller group by 1)
    select
    avg (USD_Profit),
    avg (ETH_Profit)
    Run a query to Download Data