freemartianHourly Marketcap
    Updated 2025-02-11
    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: 21 days agoAuto-refreshes every 1 hour
    TIME
    MARKETCAP
    1
    2025-01-23 17:00:00.000910702.205955638
    2
    2025-01-23 15:00:00.000952534.460904088
    3
    2025-01-23 08:00:00.000981183.209635582
    4
    2025-01-23 06:00:00.000991096.518054965
    5
    2025-01-22 23:00:00.0001211766.04819392
    6
    2025-01-22 21:00:00.0001219954.24234196
    7
    2025-01-22 18:00:00.0001263819.08032485
    8
    2025-01-22 17:00:00.0001224155.59618436
    9
    2025-01-22 16:00:00.0001184978.72183636
    10
    2025-01-22 15:00:00.0001186081.92361591
    11
    2025-01-22 09:00:00.0001226479.14759801
    12
    2025-01-22 08:00:00.0001210493.33336208
    13
    2025-01-22 06:00:00.0001152657.04684247
    14
    2025-01-22 00:00:00.0001075765.95553413
    15
    2025-01-21 22:00:00.0001087810.27982984
    16
    2025-01-21 15:00:00.000901066.97073339
    17
    2025-01-21 11:00:00.000913614.901732635
    18
    2025-01-21 09:00:00.000889510.086531208
    19
    2025-01-21 07:00:00.000904143.303162142
    20
    2025-01-21 06:00:00.000916981.82269416
    ...
    321
    14KB
    733s