StangFAST06 - swap - to
Updated 2023-08-27
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 05 - swap-from @ https://flipsidecrypto.xyz/edit/queries/76cd63e4-28f8-40c5-93bc-76b85b51eb79
-- forked from 04 - token used @ https://flipsidecrypto.xyz/edit/queries/589a5863-1e27-44b9-a9e3-408ef92d3c11
-- forked from 03 - swap volume @ https://flipsidecrypto.xyz/edit/queries/05e90847-bf9a-49c6-abab-087d67dd061f
-- forked from 01 - overview @ https://flipsidecrypto.xyz/edit/queries/fa6c1428-0f60-404d-a4ba-9103c388e7ce
with
token_price1 AS
(
SELECT
date_trunc( 'day' , a.hour ) AS day
, avg( a.price ) AS price
, a.symbol AS token
, a.token_address AS token_id
FROM
base.core.fact_hourly_token_prices a
GROUP BY 1 , 3 , 4
ORDER BY 1 DESC
)
,
token_price2 AS
(
SELECT
date_trunc( 'day' , a.hour ) AS day
, avg( a.price ) AS price
, a.symbol AS token
, a.token_address AS token_id
FROM
base.core.fact_hourly_token_prices a
GROUP BY 1 , 3 , 4
ORDER BY 1 DESC
)
,
Run a query to Download Data