i_danBase God: Price Over Time
Updated 2024-11-18
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
›
⌄
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