hessTop Profitable NFT Traders
    Updated 2023-02-03
    with purchaser as ( select date(block_timestamp) as date, purchaser , mint ,ADDRESS_NAME, sum(sales_amount) as buy, count(DISTINCT(tx_id)) as total_buy
    from solana.core.fact_nft_sales a join solana.core.dim_labels b on a.mint = b.address
    where date between '{{From}}' and '{{To}}'
    group by 1,2,3,4)
    ,
    seller as ( select date(block_timestamp) as date, seller , mint ,ADDRESS_NAME, sum(sales_amount) as sell, count(DISTINCT(tx_id)) as total_sell
    from solana.core.fact_nft_sales a join solana.core.dim_labels b on a.mint = b.address
    where date between '{{From}}' and '{{To}}'
    group by 1,2,3,4)

    select purchaser , sum(total_buy) as buy_tx , sum(total_sell) as sell_tx ,
    sum(buy) as buy_amount , sum(sell) as sell_amount, sell_amount-buy_amount as profit,
    cast(sell_amount-buy_amount as double)/cast(buy_amount as double)*100 as percentage,
    rank() over (order by profit desc) as rank
    from purchaser a join seller b on a.purchaser = b.seller
    where purchaser not in (select address
    from crosschain.core.address_labels)
    and purchaser not in (select address
    from solana.core.dim_labels)
    and b.date >= a.date
    and a.mint = b.mint
    group by 1
    having buy_tx = sell_tx
    qualify rank <= 50
    Run a query to Download Data