MLDZMNENI19
    Updated 2023-01-04
    with buy as (
    select
    buyer_address as buyer,
    sum(price_usd) as volume_usd_buy
    from ethereum.core.ez_nft_sales
    where BLOCK_TIMESTAMP between '2022-01-01' and '2023-01-01'
    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 BLOCK_TIMESTAMP between '2022-01-01' and '2023-01-01'
    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