winnie-fsmolecular-tomato
    Updated 2024-09-19
    WITH near_prices AS (
    SELECT
    hour,
    open,
    high,
    low,
    close
    FROM price.fact_prices_ohlc_hourly
    WHERE asset_id = 'near' -- This is the asset_id for NEAR in the price schema
    AND provider = 'coinmarketcap' -- Using CoinMarketCap as the price provider
    AND hour >= CURRENT_DATE - INTERVAL '7 days' -- Last 7 days of data
    )
    SELECT
    hour,
    open,
    high,
    low,
    close,
    (close - open) / open AS price_change_percentage
    FROM near_prices
    ORDER BY hour DESC
    LIMIT 24;
    QueryRunArchived: QueryRun has been archived