abbassohrabiFlow Price copy
Updated 2023-05-14
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
-- forked from 0xHaM-d / Flow Price @ https://flipsidecrypto.xyz/0xHaM-d/q/2023-04-09-10-22-am-UohUsj
with eth_priceTb as (
SELECT
HOUR::date as p_date,
avg(price) as eth_price
FROM ethereum.core.fact_hourly_token_prices
WHERE symbol = 'WETH'
GROUP by 1
)
, btc_priceTb as (
SELECT
HOUR::date as p_date,
avg(price) as btc_price
FROM ethereum.core.fact_hourly_token_prices
WHERE symbol = 'WBTC'
GROUP by 1
)
, flow_priceTb as (
SELECT
RECORDED_HOUR::date as p_date,
avg(CLOSE) as flow_price
FROM flow.core.fact_hourly_prices
WHERE token = 'Flow'
GROUP by 1
)
SELECT
e.p_date,
eth_price,
btc_price,
flow_price
FROM eth_priceTb e join btc_priceTb b on e.p_date = b.p_date
join flow_priceTb a on e.p_date = a.p_date
WHERE e.p_date BETWEEN '2022-01-01' AND current_date()
Run a query to Download Data