Pine AnalyticsEth Valuation 3 copy copy
    Updated 2025-02-17
    -- forked from Eth Valuation 3 copy @ https://flipsidecrypto.xyz/studio/queries/afe940f8-3f98-4a3e-8cd4-8984f52fa951

    with tab1 as (
    SELECT
    date(hour) as day,
    median(price) as eth_price
    FROM
    ethereum.price.ez_prices_hourly
    WHERE
    token_address LIKE lower('0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2')
    GROUP by
    1
    ), tab2 as (
    SELECT
    date_trunc('week', block_timestamp) as day,
    sum(tx_fee) as blob_fees_eth,
    sum(tx_fee * eth_price) as blob_fees_usd,
    FROM
    ethereum.core.fact_transactions
    LEFT outer join tab1 on day = date(block_timestamp)
    WHERE
    block_timestamp > '2022-03-13' --WHERE from_address like '0x5050f69a9786f081509234f1a7f4684b5e5b76c9'
    and tx_type like 3
    and from_address like '0xc1b634853cb333d3ad8663715b08f41a3aec47cc'
    GROUP BY
    1
    ), tab3 as (
    SELECT
    date_trunc('week', block_timestamp) as day1,
    sum(tx_fee) as L2_fees_eth,
    sum(tx_fee * eth_price) as L2_fees_usd,
    FROM
    arbitrum.core.fact_transactions
    LEFT outer join tab1 on day = date(block_timestamp)
    WHERE
    block_timestamp > '2022-03-13'
    Last run: 2 months ago
    ETH_PRECENT_VALUE_APTURE
    1
    6.825930635
    1
    15B
    164s