MadiTop 100 purchasers
    Updated 2022-12-23
    with addressesss as (select DISTINCT address from solana.core.dim_labels
    where ADDRESS_NAME ='lily'),

    df as (select
    BLOCK_TIMESTAMP,
    TX_ID, MARKETPLACE,
    PURCHASER, SELLER,
    SALES_AMOUNT,
    MINT
    from solana.core.fact_nft_sales
    where SUCCEEDED = 'TRUE' and mint in (select address from addressesss) )

    select
    DISTINCT PURCHASER as buyer,
    count(DISTINCT mint) as nft_count,
    sum(SALES_AMOUNT) as amount
    from df
    group by 1 order by 3 desc limit 100
    Run a query to Download Data