MLDZMNoab10
    Updated 2023-01-14
    with buy as (
    select
    buyer_address as buyer,
    sum(price_usd) as volume_usd_buy
    from ethereum.core.ez_nft_sales
    where NFT_ADDRESS='0x716f29b8972d551294d9e02b3eb0fc1107fbf4aa'
    and price_usd>0
    group by 1 having volume_usd_buy is not null
    ),
    sel as (select
    seller_address as seller,
    sum(price_usd) as volume_usd_sell
    from ethereum.core.ez_nft_sales
    where NFT_ADDRESS='0x716f29b8972d551294d9e02b3eb0fc1107fbf4aa'
    and price_usd>0
    group by 1 having volume_usd_sell is not null
    )
    select
    buyer as nft_trader,
    sum (volume_usd_sell - volume_usd_buy) as profit_usd,
    row_number() over (order by profit_usd desc) as rank1
    from buy join sel on buy.buyer = sel.seller
    group by 1
    order by 2 DESC
    limit 10
    Run a query to Download Data