MarketDepthInfo
Documentation for eth_defi.gmx.market_depth.MarketDepthInfo Python class.
- class MarketDepthInfo
Bases:
objectMarket depth snapshot for a single GMX v2 perpetual market.
Populated from the
/markets/infoREST endpoint (cached 60 s). All USD values are already divided by10^30(the GMX fixed-point precision) and expressed as plain floats.Pool amounts (
long_pool_amount,short_pool_amount) are kept in raw token units as returned by the API, because the conversion to USD requires per-token decimal information.Attributes summary
GMX market token address (identifies the GM liquidity pool)
Human-readable market name, e.g.
Address of the index token (the asset being traded)
Address of the long collateral token
Address of the short collateral token (usually USDC)
Current long open interest in USD
Current short open interest in USD
Maximum long OI the pool can accept before hitting the reserve cap (USD).
Maximum short OI the pool can accept before hitting the reserve cap (USD).
Remaining long OI capacity in USD.
Remaining short OI capacity in USD.
Long pool token amount (raw token units as returned by the API)
Short pool token amount (raw token units as returned by the API)
Long funding rate, annualised (REST
fundingRateLong / 10^30).Short funding rate, annualised (REST
fundingRateShort / 10^30).Long borrowing rate, annualised (REST
borrowingRateLong / 10^30).Short borrowing rate, annualised (REST
borrowingRateShort / 10^30).Whether this market is currently listed for trading
Methods summary
__init__(market_token_address, ...)- market_token_address: eth_typing.evm.HexAddress
GMX market token address (identifies the GM liquidity pool)
- market_symbol: str
Human-readable market name, e.g.
"ETH/USD [WETH-USDC]"
- index_token_address: eth_typing.evm.HexAddress
Address of the index token (the asset being traded)
- long_token_address: eth_typing.evm.HexAddress
Address of the long collateral token
- short_token_address: eth_typing.evm.HexAddress
Address of the short collateral token (usually USDC)
- long_open_interest_usd: float
Current long open interest in USD
- short_open_interest_usd: float
Current short open interest in USD
- max_long_open_interest_usd: float
Maximum long OI the pool can accept before hitting the reserve cap (USD). Computed as
long_open_interest_usd + available_long_oi_usd.
- max_short_open_interest_usd: float
Maximum short OI the pool can accept before hitting the reserve cap (USD). Computed as
short_open_interest_usd + available_short_oi_usd.
- available_long_oi_usd: float
Remaining long OI capacity in USD. This is the USD amount of new long positions the pool can absorb.
- available_short_oi_usd: float
Remaining short OI capacity in USD. This is the USD amount of new short positions the pool can absorb.
- long_pool_amount: float
Long pool token amount (raw token units as returned by the API)
- short_pool_amount: float
Short pool token amount (raw token units as returned by the API)
- long_funding_rate: float
Long funding rate, annualised (REST
fundingRateLong / 10^30). Positive means longs receive funding; negative means longs pay. Multiply by 100 for annual percentage.
- short_funding_rate: float
Short funding rate, annualised (REST
fundingRateShort / 10^30). Positive means shorts receive funding; negative means shorts pay. Multiply by 100 for annual percentage.
- long_borrowing_rate: float
Long borrowing rate, annualised (REST
borrowingRateLong / 10^30). Always non-negative. Multiply by 100 for annual percentage.
- short_borrowing_rate: float
Short borrowing rate, annualised (REST
borrowingRateShort / 10^30). Always non-negative. Multiply by 100 for annual percentage.
- is_listed: bool
Whether this market is currently listed for trading
- __init__(market_token_address, market_symbol, index_token_address, long_token_address, short_token_address, long_open_interest_usd, short_open_interest_usd, max_long_open_interest_usd, max_short_open_interest_usd, available_long_oi_usd, available_short_oi_usd, long_pool_amount, short_pool_amount, long_funding_rate, short_funding_rate, long_borrowing_rate, short_borrowing_rate, is_listed)
- Parameters
market_token_address (eth_typing.evm.HexAddress) –
market_symbol (str) –
index_token_address (eth_typing.evm.HexAddress) –
long_token_address (eth_typing.evm.HexAddress) –
short_token_address (eth_typing.evm.HexAddress) –
long_open_interest_usd (float) –
short_open_interest_usd (float) –
max_long_open_interest_usd (float) –
max_short_open_interest_usd (float) –
available_long_oi_usd (float) –
available_short_oi_usd (float) –
long_pool_amount (float) –
short_pool_amount (float) –
long_funding_rate (float) –
short_funding_rate (float) –
long_borrowing_rate (float) –
short_borrowing_rate (float) –
is_listed (bool) –
- Return type
None