adriaparcerisasSolana collections
    Updated 2023-01-02
    WITH
    sales AS (
    SELECT
    block_timestamp,
    block_id,
    n.mint,
    b.label,
    succeeded,
    n.sales_amount,n.seller,n.purchaser,
    marketplace,
    n.tx_id
    FROM solana.core.fact_nft_sales n
    LEFT OUTER JOIN solana.core.dim_labels b
    ON n.mint = b.address
    WHERE label IS NOT NULL),
    final_data as (
    SELECT
    trunc(block_timestamp,'day') AS date,
    label as collection,
    count(distinct tx_id) AS transactions,
    sum(transactions) over (partition by collection order by date) as cum_transactions,
    sum(sales_amount) as volume_of_sales,
    sum(volume_of_sales) over (partition by collection order by date) as cum_volume_sales,
    avg(sales_amount) as avg_nft_price,
    avg(avg_nft_price) over (partition by collection order by date) as cum_avg_price,
    count(purchaser) as users,
    sum(users) over (partition by collection order by date) as cum_users
    from sales
    group by 1,2
    order by 1 asc
    ),
    final_data_2 as (
    SELECT
    date,
    collection,
    cum_transactions as total_transactions,
    Run a query to Download Data