shreex7days
    Updated 2022-10-11
    with nft_address as (
    select
    address,
    address_name
    from solana.core.dim_labels where address_name in ('Collectorz Club: The Collectorz','collectorz club gen1','The Suites','Laidback Lions','Sports Rewind')
    )
    select
    date_trunc('day',block_timestamp) as date,
    address_name,
    sum(sales_amount) as volume,
    count(distinct purchaser) as unique_buyers,
    count(distinct seller) as unique_sellers,
    avg(sales_amount) as avg_price,
    avg(avg_price) OVER(ORDER BY Date
    ROWS BETWEEN 7 PRECEDING AND CURRENT ROW )
    as "7days_moving_average",
    avg(avg_price) OVER(ORDER BY Date
    ROWS BETWEEN 30 PRECEDING AND CURRENT ROW )
    as "30days_moving_average",
    count(distinct tx_id) as sales_numbers
    from solana.core.fact_nft_sales sales ,nft_address where mint=address
    group by date ,address_name
    ORDER BY date DESC
    LIMIT 180


    Run a query to Download Data