Sajjadiii2023-09-14 07:48 AM
Updated 2023-10-05
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
›
⌄
with price_tab AS (
SELECT timestamp::date AS date , 'FlowToken' AS token , avg(price_usd) AS price
FROM flow.price.fact_prices
WHERE token = 'Flow'
AND timestamp::date >= '2023-01-01'
GROUP BY 1 , 2
UNION all
SELECT recorded_hour::date AS date , 'SloppyStakes' AS token , avg(close) AS price
FROM flow.price.fact_hourly_prices
WHERE id ILIKE '%sloppy%' -- 'A.53f389d96fb4ce5e.SloppyStakes'
AND recorded_hour::date >= '2023-01-01'
GROUP BY 1 , 2
UNION all
SELECT timestamp::date AS date , 'FlowUtilityToken' AS token , avg(price_usd) AS price
FROM flow.price.fact_prices
WHERE token = 'Flow'
AND timestamp::date >= '2023-01-01'
GROUP BY 1 , 2
UNION all
SELECT timestamp::date AS date , 'DapperUtilityCoin' AS token , avg(1) AS price
FROM flow.price.fact_prices
WHERE token = 'Flow'
AND timestamp::date >= '2023-01-01'
GROUP BY 1 , 2
UNION all
SELECT timestamp::date AS date , 'FiatToken' AS token , avg(1) AS price
FROM flow.price.fact_prices
WHERE token = 'Flow'
AND timestamp::date >= '2023-01-01'
GROUP BY 1 , 2
),
listing_tab AS (
SELECT
block_timestamp
, tx_id
Run a query to Download Data