SG data2024-06-04 11:38 AM
    Updated 2024-06-20
    WITH
    tx_fees AS (
    SELECT
    'ethereum' AS dataset,
    DATE_TRUNC('day', BLOCK_TIMESTAMP) AS day,
    tx_fee
    FROM ethereum.core.fact_transactions
    WHERE BLOCK_TIMESTAMP >= DATE_TRUNC('day', CURRENT_DATE) - INTERVAL '3 YEAR'
    UNION ALL
    SELECT
    'polygon' AS dataset,
    DATE_TRUNC('day', BLOCK_TIMESTAMP) AS day,
    tx_fee
    FROM polygon.core.fact_transactions
    WHERE BLOCK_TIMESTAMP >= DATE_TRUNC('day', CURRENT_DATE) - INTERVAL '3 YEAR'
    UNION ALL
    SELECT
    'bsc' AS dataset,
    DATE_TRUNC('day', BLOCK_TIMESTAMP) AS day,
    tx_fee
    FROM bsc.core.fact_transactions
    WHERE BLOCK_TIMESTAMP >= DATE_TRUNC('day', CURRENT_DATE) - INTERVAL '3 YEAR'
    UNION ALL
    SELECT
    'arbitrum' AS dataset,
    DATE_TRUNC('day', BLOCK_TIMESTAMP) AS day,
    tx_fee
    FROM arbitrum.core.fact_transactions
    WHERE BLOCK_TIMESTAMP >= DATE_TRUNC('day', CURRENT_DATE) - INTERVAL '3 YEAR'
    UNION ALL
    SELECT
    'optimism' AS dataset,
    DATE_TRUNC('day', BLOCK_TIMESTAMP) AS day,
    tx_fee
    FROM optimism.core.fact_transactions
    WHERE BLOCK_TIMESTAMP >= DATE_TRUNC('day', CURRENT_DATE) - INTERVAL '3 YEAR'
    QueryRunArchived: QueryRun has been archived