mariyaDaily AVG statistics for each marketplace(60days)
    Updated 2022-12-09
    with base_data as
    ( select
    count(1) as nft_sales_transactions , count(distinct seller) as unique_seller_count ,
    count(distinct purchaser) as unique_buyer_count , sum(sales_amount) as amount ,
    max(sales_amount) as max_amount , median(sales_amount) as median_amount ,
    count(distinct mint) as nft_mint , count(distinct block_id) as blocks , marketplace
    from solana.core.fact_nft_sales
    where succeeded = 1 and sales_amount > 0 and block_timestamp::date >= current_date - interval '60 days'
    group by marketplace
    )
    , datediff_data as
    (
    select
    datediff('day', min(block_timestamp::date) , max(block_timestamp::date)) as diff
    , marketplace
    from solana.core.fact_nft_sales
    where succeeded = 1 and sales_amount > 0 and block_timestamp::date >= current_date - interval '60 days'
    group by marketplace
    )
    select
    nft_sales_transactions/diff as avg_transactions_perday, amount/diff as avg_amount_perday ,
    unique_seller_count/diff as avg_seller_perday, unique_buyer_count/diff as avg_buyer_perday,
    blocks/diff as avg_blocks_perday, nft_mint/diff as avg_mint_perday ,
    max_amount, median_amount, base_data.marketplace
    from base_data inner join datediff_data
    on base_data.marketplace = datediff_data.marketplace
    Run a query to Download Data