tomingWhat Do Top Traders Hold? copy
    -- forked from Ario / What Do Top Traders Hold? @ https://flipsidecrypto.xyz/Ario/q/edpTPYLWFD_g/what-do-top-traders-hold

    WITH buy as (
    select
    BLOCK_TIMESTAMP,
    BUYER_ADDRESS,
    NFT_ADDRESS,
    TOKENID,
    case when PRICE_USD = 0 then (TX_FEE_USD + TOTAL_FEES_USD)
    else PRICE_USD end as Buy_Price
    from ethereum.core.ez_nft_sales
    where BLOCK_TIMESTAMP::date >= current_date - 30
    and PRICE_USD is not null
    and EVENT_TYPE = 'sale'
    ),
    sell as (
    select
    BLOCK_TIMESTAMP,
    seller_ADDRESS,
    NFT_ADDRESS,
    TOKENID,
    PRICE_USD as Sell_Price
    from ethereum.core.ez_nft_sales
    where BLOCK_TIMESTAMP::date >= current_date - 30
    and PRICE_USD is not null
    and EVENT_TYPE = 'sale'
    ),
    Net as (
    select
    seller_ADDRESS as Trader,
    sum(Sell_Price - Buy_Price) as Profit
    from sell a join buy b on a.seller_ADDRESS = b.BUYER_ADDRESS and a.NFT_ADDRESS = b.NFT_ADDRESS and a.TOKENID = b.TOKENID
    and a.BLOCK_TIMESTAMP > b.BLOCK_TIMESTAMP
    group by 1
    order by 2 desc
    limit 10
    Run a query to Download Data