mattkstewTop ETH Trader 2
    Updated 2023-04-05
    with tab1 as (
    select
    block_timestamp,
    seller_address,
    project_name,
    tokenid,
    price_usd as Sell_price
    from ethereum.core.ez_nft_sales
    where block_timestamp > current_date - 90
    )
    , tab2 as (
    select
    block_timestamp,
    buyer_address,
    project_name,
    tokenid,
    price_usd as Buy_price


    from ethereum.core.ez_nft_sales
    where block_timestamp > current_date - 90
    )

    , tab3 as (
    select
    tab1.block_timestamp as date1,
    buyer_address as User,
    --project_name,
    sell_price - buy_price as Net_profit


    from tab1 left outer join tab2 on
    seller_address = buyer_address and
    tab1.tokenid = tab2.tokenid and tab1.project_name = tab2.project_name
    where buy_price is not null and sell_price is not null
    --and net_profit > -1000000
    Run a query to Download Data