get_fallback_provider_from_gmx_config

Documentation for eth_defi.gmx.config.get_fallback_provider_from_gmx_config function.

get_fallback_provider_from_gmx_config(config)

Get the FallbackProvider from a GMXConfig if available.

This utility function extracts the FallbackProvider from a GMXConfig that was created with multi-provider support, allowing access to provider statistics and manual failover controls.

Example:

from eth_defi.gmx.config import (
    create_gmx_config_with_fallback,
    get_fallback_provider_from_gmx_config,
)

config = create_gmx_config_with_fallback("...")
fallback = get_fallback_provider_from_gmx_config(config)

if fallback:
    print(f"API calls: {fallback.get_total_api_call_counts()}")
Parameters

config (eth_defi.gmx.config.GMXConfig) – GMXConfig instance to extract FallbackProvider from.

Returns

FallbackProvider instance if the config uses multi-provider Web3, None otherwise.