drone-mostafa%% copy
Updated 2023-05-19
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
›
⌄
WITH BASE AS (SELECT
RECORDED_HOUR::date AS TIME,TOKEN,median(CLOSE) AS PRICE
FROM flow.core.fact_hourly_prices
WHERE RECORDED_HOUR >= '2023-01-01'
AND token not in ('USDT','USDC','FUSD')
GROUP BY 1,2),
first_p as (SELECT TOKEN, median(PRICE) AS F_PRICE FROM BASE WHERE TIME = '2023-01-01' GROUP BY 1 )
SELECT date_trunc ('day',TIME) as TIME,base.TOKEN, AVG(PRICE) AS PRICEs, avg (F_PRICE) as F_PRICEs,
(PRICEs - F_PRICEs) / F_PRICEs * 100 as "% Change", PRICEs / F_PRICEs as "Growth n Times "
FROM BASE LEFT JOIN first_p using (TOKEN)
WHERE TIME = current_date
GROUP by 1,2
Run a query to Download Data