NakedCollector2024-05-15 03:25 PM
    Updated 2024-05-15
    WITH eth_gross AS (
    SELECT
    DATE_TRUNC('day', block_timestamp) AS day_,
    SUM(tx_fee) AS eth_gross,
    SUM(VALUE_PRECISE) AS total_VALUE_PRECISE
    FROM
    arbitrum.core.fact_transactions
    WHERE
    block_timestamp >= '2023-06-01'
    GROUP BY
    day_
    ),
    eth_paid AS (
    SELECT
    DATE_TRUNC('day', block_timestamp) AS day_,
    SUM(tx_fee) AS eth_paid
    FROM
    ethereum.core.fact_transactions
    WHERE
    block_timestamp >= '2023-06-01'
    AND from_address IN (
    lower('0xC1b634853Cb333D3aD8663715b08f41A3Aec47cc')
    )
    GROUP BY
    day_
    ),
    arbitrum_data AS (
    SELECT
    a.day_,
    a.eth_gross,
    a.eth_paid,
    a.eth_gross - a.eth_paid AS eth_revenue,
    a.total_VALUE_PRECISE
    FROM
    eth_gross a
    FULL JOIN
    QueryRunArchived: QueryRun has been archived