MLDZMNgsrd8
    Updated 2022-11-07
    with tb1 as (select
    mint,
    count(tx_id) as no_trade,
    count(distinct PURCHASER) as no_buyer,
    count(distinct seller) as no_seller
    from solana.core.fact_nft_sales
    where SUCCEEDED='TRUE'

    group by 1 having no_trade>2 and (no_buyer=2 or no_seller=2)
    )

    select
    marketplace,
    'wash trading' as sale_type,
    count(TX_ID) as sale_no,
    sum(SALES_AMOUNT) as volume
    from solana.core.fact_nft_sales
    where SUCCEEDED='TRUE'
    and mint in (select mint from tb1)
    group by 1
    union all
    select
    marketplace,
    'Regular sale' as sale_type,
    count(TX_ID) as sale_no,
    sum(SALES_AMOUNT) as volume
    from solana.core.fact_nft_sales
    where SUCCEEDED='TRUE'
    and mint not in (select mint from tb1)
    group by 1
    Run a query to Download Data