mariyaDaily volume of NFT buyers(USD)
    Updated 2022-12-07
    WITH tab0 as (
    SELECT date_trunc('day', hour) as day1, avg(price) as sol_price
    FROM ethereum.core.fact_hourly_token_prices
    WHERE token_address LIKE lower('0xD31a59c85aE9D8edEFeC411D448f90841571b89c')
    GROUP BY 1
    ), tab1 as (
    SELECT
    date_trunc('day', block_timestamp) as day, sum(mint_price * sol_price) as nft_mint_volume,
    COUNT(DISTINCT tx_id) as Mint_events, avg(mint_price * sol_price) as avg_nft_mint_price,
    count(DISTINCT purchaser) as total_nft_minters
    FROM solana.core.fact_nft_mints
    LEFT outer join tab0
    ON date_trunc('day', block_timestamp) = day1
    where block_timestamp > '2022-10-01'
    AND MINT_CURRENCY LIKE 'So11111111111111111111111111111111111111111'
    GROUP BY 1
    )

    SELECT *, avg(total_nft_minters) OVER(
    --PARTITION BY
    ORDER BY day
    ROWS BETWEEN 7 PRECEDING AND CURRENT ROW) as Minters_7da_moving_avg, avg(Mint_events) OVER(
    --PARTITION BY
    ORDER BY day
    ROWS BETWEEN 7 PRECEDING AND CURRENT ROW) as Mint_events_7da_moving_avg
    FROM tab1
    Run a query to Download Data