MLDZMNEPA3
    Updated 2023-02-13
    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('year',BLOCK_TIMESTAMP) as date,
    count(distinct tx_id) as sale_no,
    count(distinct PURCHASER) as buyer_no,
    count(distinct x.MINT) as no_NFTs,
    count(distinct CONTRACT_NAME ) as no_collections,
    count(distinct PROGRAM_ID) as no_marketplaces,
    sum(MINT_PRICE) as volume,
    sum(MINT_PRICE*price_token) as volume_usd,
    avg(MINT_PRICE*price_token)as average_volume,
    Median(MINT_PRICE*price_token) as median_volume,
    min(MINT_PRICE*price_token) as floor_price,
    max(MINT_PRICE*price_token) as highest_price
    from solana.core.fact_nft_mints x join tb2 y on x.BLOCK_TIMESTAMP::date=y.day
    left join solana.core.dim_nft_metadata z on x.mint=z.mint
    where SUCCEEDED='TRUE'
    and MINT_PRICE > 0
    and MINT_CURRENCY='So11111111111111111111111111111111111111111'
    group by 1
    Run a query to Download Data