shreexAsa2
    Updated 2022-12-13
    with prices as (
    select
    date_trunc('day',recorded_hour) as price_date,
    avg(close) as price
    from solana.core.fact_token_prices_hourly where id='solana' and provider='coingecko' and symbol='SOL'
    GROUP BY price_date
    ORDER BY price_date DESC
    LIMIT 1
    )
    select
    count(distinct tx_id) as sales_count,
    sum(sales_amount) as volume,
    sum(sales_amount)*avg(price) as volume_usd,
    avg(sales_amount) as average_nft_price,
    average_nft_price*avg(price) as "avg price usd for nfts",
    count(distinct mint) as nfts,
    count(distinct purchaser) as unique_buyers,
    count(distinct seller) as unique_sellers
    from solana.core.fact_nft_sales left join prices on block_timestamp::date = price_date
    where marketplace='hadeswap'
    and SUCCEEDED = 'TRUE'
    Run a query to Download Data