yasminAVG_GAS_PRICE_GWEI copy
    Updated 2025-04-22
    WITH total_gas_used AS (
    SELECT
    PARSE_JSON(
    livequery.live.udf_api(
    'GET',
    'https://api.routescan.io/v2/network/mainnet/evm/43419/aggregations/gas-used/tot',
    {'accept': 'application/json'},
    NULL
    ):data
    ):value::number AS total_gas
    ),
    total_burned_fees AS (
    SELECT
    PARSE_JSON(
    livequery.live.udf_api(
    'GET',
    'https://api.routescan.io/v2/network/mainnet/evm/43419/aggregations/burned-fees/tot',
    {'accept': 'application/json'},
    NULL
    ):data
    ):value::number AS total_burned
    ),
    avg_gas_price AS (
    SELECT
    PARSE_JSON(
    livequery.live.udf_api(
    'GET',
    'https://api.routescan.io/v2/network/mainnet/evm/43419/aggregations/avg-gas-price/tot',
    {'accept': 'application/json'},
    NULL
    ):data
    ):value::number AS avg_price
    )
    SELECT
    g.total_gas AS total_gas_used,
    b.total_burned / 1e18 AS total_burned_fees_native,
    QueryRunArchived: QueryRun has been archived