MLDZMNclay21
    Updated 2023-03-25
    with tb2 as (select
    RECORDED_HOUR::date as day,
    avg(close) as price_token
    from solana.core.fact_token_prices_hourly where SYMBOL='SOL'
    group by 1)
    select
    distinct purchaser as buyer,
    count(distinct tx_id) as sale_no,
    sum(SALES_AMOUNT) as volume,
    sum(SALES_AMOUNT*price_token) as volume_usd,
    row_number() over (order by volume_usd desc) as rank1
    from solana.core.fact_nft_sales s left outer join solana.core.dim_labels b on s.mint=b.address
    join tb2 y on s.BLOCK_TIMESTAMP::date=y.day
    where SUCCEEDED='TRUE'
    and SALES_AMOUNT > 0
    and LABEL = 'claynosaurz'
    group by 1 having volume_usd is not null
    order by 4 desc limit 10
    Run a query to Download Data