MrDataJSolana - NFT Dash - Top 1000
    with tb1 as ( select purchaser,
    count(DISTINCT tx_id) as buy_tx,
    count(DISTINCT mint) as "num_nfts (Buy)",
    sum(sales_amount) as "Amount (Buy)",
    avg(sales_amount) as avg_buy_amount,
    max(sales_amount) as Max_buy_amount,
    min(sales_amount) as min_amount,
    median(sales_amount) as median_amount
    from solana.core.fact_nft_sales
    where succeeded = 'true'
    group by 1)
    ,
    tb2 as ( select seller,
    count(DISTINCT tx_id) as sell_tx,
    count(DISTINCT mint) as "num_nfts (Sell)",
    sum(sales_amount) as "Amount(Sell)",
    avg(sales_amount) as avg_sell_amount,
    max(sales_amount) as max_sell_amount,
    min(sales_amount) as min_amount,
    median(sales_amount) as median_amount
    from solana.core.fact_nft_sales
    where succeeded = 'true'
    group by 1)

    select seller as user_address,
    buy_tx,
    sell_tx,
    "num_nfts (Buy)",
    "num_nfts (Sell)",
    "Amount (Buy)",
    "Amount(Sell)",
    avg_buy_amount,
    avg_sell_amount,
    Max_buy_amount,
    max_sell_amount
    from tb1 a join tb2 b on a.purchaser = b.seller