kellenETH Gas -> BONK
Updated 2023-12-11
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 t0 AS (
SELECT livequery.live.udf_api(
'https://api.flipsidecrypto.com/api/v2/queries/7e3127c7-288f-4f29-a675-3944257a5e4d/data/latest'
):data AS data
), prices AS (
SELECT d.value:DATE AS date
, d.value:ETH_PRICE AS eth_price
, d.value:BONK_PRICE AS bonk_price
, d.value:CUR_BONK_PRICE AS cur_bonk_price
-- , d.*
FROM t0
, LATERAL FLATTEN(
input => data
) d
)
-- ep AS (
-- SELECT hour::date AS date
-- , AVG(price) AS eth_price
-- FROM ethereum.price.EZ_HOURLY_TOKEN_PRICES
-- WHERE hour >= '2023-01-01'
-- AND token_address = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
-- AND is_imputed = FALSE
-- GROUP BY 1
-- ), bp AS (
-- SELECT recorded_hour::date AS date
-- , AVG(close) AS bonk_price
-- FROM solana.price.ez_token_prices_hourly
-- WHERE recorded_hour >= '2023-01-01'
-- AND token_address = 'DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263'
-- AND is_imputed = FALSE
-- GROUP BY 1
-- ), cur_bp AS (
-- SELECT bonk_price AS cur_bonk_price
-- FROM bp
-- ORDER BY date DESC
-- LIMIT 1