i_danBase God: Price Over Time
    Updated 2024-11-18
    WITH sales_data AS (
    SELECT
    date_trunc('minute', block_timestamp) AS time
    , price_usd
    , CASE WHEN event_type = 'sale' THEN price_usd END AS Last_FP
    FROM
    base.nft.ez_nft_sales
    WHERE
    nft_address = lower('0x2D53D0545CD1275B69040e3C50587E2CC4443A52')
    ORDER BY block_timestamp DESC
    )
    SELECT
    time
    , price_usd
    , LAST_VALUE(Last_FP IGNORE NULLS) OVER (
    PARTITION BY 1
    ORDER BY time ASC
    ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
    ) AS Last_FP_Filled
    FROM sales_data
    ORDER BY time DESC

    QueryRunArchived: QueryRun has been archived