rach2024-05-16 12:22 PM
    Updated 2024-05-16
    SELECT
    TX_TYPE,
    AVG(gas_fee) AS average_gas_fee,
    SUM(gas_fee) AS total_gas_fee
    FROM (
    SELECT
    GAS_PRICE * GAS_USED AS gas_fee,
    TX_TYPE
    FROM
    ethereum.core.fact_transactions

    UNION ALL

    SELECT
    GAS_PRICE * GAS_USED AS gas_fee,
    TX_TYPE
    FROM
    polygon.core.fact_transactions
    ) AS combined_transactions
    GROUP BY TX_TYPE;