mondovgas price vs transactions
    Updated 2024-08-24
    WITH uniswap_swaps AS (
    SELECT
    COUNT(DISTINCT tx_hash) AS uniswap_tx_count,
    DATE_TRUNC('month', block_timestamp) AS month,
    blockchain
    FROM crosschain.defi.ez_dex_swaps
    WHERE lower(platform) LIKE 'uniswap%'
    AND blockchain = 'ethereum'
    AND block_timestamp >= '2020-01-01'
    GROUP BY month, blockchain
    ),

    total_tx_counts AS (
    SELECT
    DATE_TRUNC('month', block_timestamp_hour) AS month,
    SUM(transaction_count_success) AS tx_count,
    blockchain
    FROM crosschain.stats.ez_core_metrics_hourly
    WHERE block_timestamp_hour >= '2020-01-01'
    GROUP BY month, blockchain
    ),

    eth_avg_gas_price AS (
    SELECT
    DATE_TRUNC('month', block_timestamp) AS month,
    AVG(gas_price) AS avg_gas_price_gwei,
    MIN(gas_price) AS min_gas_price_gwei,
    MAX(gas_price) AS max_gas_price_gwei,
    MEDIAN(gas_price) as med_gas_price_gwei
    FROM ethereum.core.fact_transactions
    WHERE block_timestamp >= '2020-01-01'
    GROUP BY month
    )

    SELECT
    u.month,
    QueryRunArchived: QueryRun has been archived