SpiltadavidTop 10 wallets that Have Made Most Profit
    Updated 2022-08-29
    --Cryptopunk Sales and Traders

    with
    Seller as ( select sum(price_usd) as
    Sell_Volume, seller_address as Sellers
    from ethereum.core.ez_nft_sales
    left outer join ethereum.core.dim_labels
    on nft_address = address
    where price_usd is not null and label like 'cryptopunks' group by Sellers ),


    Buyer as ( select sum(price_usd) as Buy_Volume, buyer_address as Buyers
    from ethereum.core.ez_nft_sales
    left outer join ethereum.core.dim_labels
    on nft_address = address
    where price_usd is not null and label like 'cryptopunks' group by Buyers )


    select
    Buyers, sum(Sell_Volume - Buy_Volume) as USD_Profit
    from
    Seller left outer join Buyer on Sellers = Buyers
    where Sell_Volume is not null and Buy_Volume is not null
    group by Buyers order by USD_Profit DESC limit 10
    Run a query to Download Data