MLDZMNclay19
    Updated 2023-03-24
    -- forked from 8429b976-edc2-4b58-99d3-ba0880205456

    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
    date_trunc('week',block_timestamp) as date,
    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 mint_no,
    count(distinct PURCHASER) as minter_no,
    count (distinct s.MINT) as no_NFTs,
    sum(MINT_PRICE) as volume,
    sum(MINT_PRICE*price_token) as volume_usd,
    avg(MINT_PRICE) as average_volume_SOL,
    avg(MINT_PRICE*price_token) as average_volume,
    min(MINT_PRICE*price_token) as floor_price,
    max(MINT_PRICE*price_token) as highest_price,
    median(MINT_PRICE*price_token) as median_price
    from solana.core.fact_nft_mints 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'
    group by 1,2 having NFTs is not null


    Run a query to Download Data