HOUR | PRICE | ROW_NUM | |
---|---|---|---|
1 | 2025-01-10 05:00:00.000 | 0.003365309755 | 1 |
2 | 2025-01-10 04:00:00.000 | 0.003270728707 | 2 |
3 | 2025-01-10 03:00:00.000 | 0.003681565769 | 3 |
4 | 2025-01-10 02:00:00.000 | 0.003994592102 | 4 |
5 | 2025-01-10 01:00:00.000 | 0.004040498654 | 5 |
6 | 2025-01-10 00:00:00.000 | 0.004163011182 | 6 |
7 | 2025-01-09 23:00:00.000 | 0.004500135441 | 7 |
8 | 2025-01-09 22:00:00.000 | 0.004279186335 | 8 |
9 | 2025-01-09 21:00:00.000 | 0.003575287183 | 9 |
10 | 2025-01-09 20:00:00.000 | 0.002983692385 | 10 |
11 | 2025-01-09 19:00:00.000 | 0.003185137406 | 11 |
12 | 2025-01-09 18:00:00.000 | 0.003833315059 | 12 |
13 | 2025-01-09 17:00:00.000 | 0.004028815934 | 13 |
14 | 2025-01-09 16:00:00.000 | 0.004929094997 | 14 |
15 | 2025-01-09 15:00:00.000 | 0.005481613841 | 15 |
16 | 2025-01-09 14:00:00.000 | 0.004767777841 | 16 |
17 | 2025-01-09 13:00:00.000 | 0.004074603075 | 17 |
18 | 2025-01-09 12:00:00.000 | 0.004694612492 | 18 |
19 | 2025-01-09 11:00:00.000 | 0.005484033058 | 19 |
20 | 2025-01-09 10:00:00.000 | 0.006120886353 | 20 |
freemartianPrice calculataion
Updated 2025-01-10
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
-- =========== START PRICE CALCULATION ================
temp_transaction AS (
SELECT
block_timestamp,
tx_hash,
decoded_log:sender::string AS user,
(decoded_log:spentAmount/pow(10,18))::string AS amount_out,
'3BC' AS from_token,
'WETH' AS to_token,
(decoded_log:returnAmount/pow(10,18))::string AS to_amount,
to_amount / amount_out AS PRICE_3BC_IN_ETH
FROM base.core.ez_decoded_event_logs
WHERE decoded_log:srcToken = '0x3e64cd8fd4d2fae3d7f4710817885b0941838d0b'
AND block_timestamp::date >= '2025-01-09'
and event_name = 'Swapped'
AND decoded_log:dstToken::string = '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'
AND amount_out is not null and to_amount is not null
),
temp_eth_price AS (
SELECT hour, symbol, price AS eth_price FROM base.price.ez_prices_hourly
where token_address = '0x4200000000000000000000000000000000000006'
AND hour::date >= '2025-01-09'
),
temp_results AS(
SELECT
t.block_timestamp AS block_timestamp,
t.AMOUNT_OUT AS AMOUNT_3BC,
t.TO_AMOUNT AS AMOUNT_ETH,
t.PRICE_3BC_IN_ETH,
e.ETH_PRICE,
t.PRICE_3BC_IN_ETH * e.eth_price AS PRICE_3BC_IN_USD
FROM
temp_transaction t
CROSS JOIN
temp_eth_price e
Last run: 3 months agoAuto-refreshes every 1 hour
26
1KB
5s