PapasotTop 10 NFT buyers last 7 days (by $ volume)
    Updated 2023-01-03
    select
    PURCHASER as "Top Buyers",
    count(*) as "Number of Purchases",
    sum(usd_Amount) as "Paid Volume",
    count(distinct NFT_ASSET_ID) as "Number of NFTs"
    from (with sale as (select
    date(BLOCK_TIMESTAMP) as dte,
    HOUR(block_timestamp) as time_hour,
    TX_GROUP_ID,
    PURCHASER,
    NFT_ASSET_ID,
    NFT_MARKETPLACE,
    TOTAL_SALES_AMOUNT
    from flipside_prod_db.algorand.nft_sales
    where BLOCK_TIMESTAMP >= CURRENT_DATE - 7),
    price as (select date(BLOCK_HOUR) as dte1, hour(BLOCK_HOUR) as hour1, PRICE_USD as algo_price
    from flipside_prod_db.algorand.prices_swap
    where ASSET_ID = '0')
    select
    dte,
    TX_GROUP_ID,
    PURCHASER,
    NFT_ASSET_ID,
    NFT_MARKETPLACE,
    TOTAL_SALES_AMOUNT
    algo_price,
    (total_SALES_AMOUNT*algo_price) as usd_amount
    from sale
    inner join price on dte1=dte and time_hour=hour1)

    where PURCHASER is not null
    group by 1
    order by 3 desc
    limit 10
    Run a query to Download Data