KaskoazulUntitled Query
    Updated 2023-01-22
    SELECT
    --COALESCE(t.block_timestamp::date, b.block_timestamp::date) AS fecha
    p.timestamp::date AS fecha
    , COUNT(1) AS data_points
    , AVG(price_usd) AS avg_price
    , AVG(avg_price) OVER (ORDER BY fecha ROWS BETWEEN 200 PRECEDING AND CURRENT ROW) AS rolling_price_200MA
    , AVG(avg_price) OVER (ORDER BY fecha ROWS BETWEEN 90 PRECEDING AND CURRENT ROW) AS rolling_price_90MA
    , AVG(avg_price) OVER (ORDER BY fecha ROWS BETWEEN 30 PRECEDING AND CURRENT ROW) AS rolling_price_30MA
    FROM
    near.core.fact_prices p
    WHERE
    symbol = 'wNEAR'
    GROUP BY
    fecha
    ORDER BY
    fecha DESC
    Run a query to Download Data