freemartianHourly Marketcap
Updated 2025-02-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
-- =========== 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
Auto-refreshes every 1 hour
QueryRunArchived: QueryRun has been archived