MLDZMNclay3
    Updated 2023-03-24
    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
    block_timestamp::date as date,
    MARKETPLACE,
    case
    when LABEL = 'claynosaurz claymaker' then 'Claymakers'
    when LABEL = 'claynosaurz: clay' then 'Clay'
    when LABEL = 'claynosaurz' then 'claynosaurz'
    else null end as NFTs,
    count(distinct TX_ID) as sale_no,
    count(distinct PURCHASER) as buyer_no,
    count (distinct s.MINT) as no_NFTs,
    sum(SALES_AMOUNT) as volume,
    sum(SALES_AMOUNT*price_token) as volume_usd,
    avg(SALES_AMOUNT) as average_volume_SOL,
    avg(SALES_AMOUNT*price_token) as average_volume,
    min(SALES_AMOUNT*price_token) as floor_price,
    max(SALES_AMOUNT*price_token) as highest_price,
    median(SALES_AMOUNT*price_token) as median_price
    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 block_timestamp>=current_date-60
    group by 1,2,3 having NFTs is not null
    Run a query to Download Data