MarketDepthInfo

Documentation for eth_defi.gmx.market_depth.MarketDepthInfo Python class.

class MarketDepthInfo

Bases: object

Market depth snapshot for a single GMX v2 perpetual market.

Populated from the /markets/info REST endpoint (cached 60 s). All USD values are already divided by 10^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

market_token_address

GMX market token address (identifies the GM liquidity pool)

market_symbol

Human-readable market name, e.g.

index_token_address

Address of the index token (the asset being traded)

long_token_address

Address of the long collateral token

short_token_address

Address of the short collateral token (usually USDC)

long_open_interest_usd

Current long open interest in USD

short_open_interest_usd

Current short open interest in USD

max_long_open_interest_usd

Maximum long OI the pool can accept before hitting the reserve cap (USD).

max_short_open_interest_usd

Maximum short OI the pool can accept before hitting the reserve cap (USD).

available_long_oi_usd

Remaining long OI capacity in USD.

available_short_oi_usd

Remaining short OI capacity in USD.

long_pool_amount

Long pool token amount (raw token units as returned by the API)

short_pool_amount

Short pool token amount (raw token units as returned by the API)

long_funding_rate

Long funding rate, annualised (REST fundingRateLong / 10^30).

short_funding_rate

Short funding rate, annualised (REST fundingRateShort / 10^30).

long_borrowing_rate

Long borrowing rate, annualised (REST borrowingRateLong / 10^30).

short_borrowing_rate

Short borrowing rate, annualised (REST borrowingRateShort / 10^30).

is_listed

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
Return type

None