0xHaM-dTable 4: Top 10 NFT Sellers base on tx count
    Updated 2023-03-27
    with tb1 as (
    SELECT
    contract_address,
    MINT,
    b.key || ' => ' || b.value as attribute
    FROM solana.dim_nft_metadata, lateral flatten(input => token_metadata) b
    WHERE contract_name LIKE 'Aurory'
    and attribute not ilike '%Attribute Count%'
    group by 1,2,3
    )
    , top10_seller as (
    SELECT
    DISTINCT SELLER as sellers,
    count(DISTINCT tx_id) as sales_count,
    SUM(sales_amount) as slaes_volume
    FROM solana.fact_nft_sales --a join tb1 b on a.MINT = b.MINT
    where MINT in ( SELECT DISTINCT contract_address FROM tb1)
    and SUCCEEDED = 'TRUE'
    GROUP BY 1
    order by 2 DESC
    limit 10
    )
    , mint as (
    select a.mint, b.attribute
    from solana.core.fact_nft_sales a join tb1 b on a.mint = b.mint
    where seller in (SELECT sellers from top10_seller)
    )
    SELECT
    sellers, attribute, count(sales_count) as sale_count from top10_seller full join mint
    group by 1,2

    Run a query to Download Data