GMXEquity

Documentation for eth_defi.gmx.valuation.GMXEquity Python class.

class GMXEquity

Bases: object

Equity breakdown for a GMX trading account.

See fetch_gmx_total_equity().

Attributes summary

reserves

Sum of all reserves in USD -- stable_reserves + non_stable_reserves.

positions

Sum of open GMX position values in USD, net of borrowing fees, funding fees, position fees and price impact.

stable_reserves

Portion of reserves summed at face value because the token looks like a USD-pegged stablecoin.

non_stable_reserves

Portion of reserves converted to USD via the GMX oracle mark price -- non-stablecoin reserve tokens, plus native ETH when include_native_eth was set.

Methods summary

__init__(reserves, positions[, ...])

get_total()

Total equity = reserves + positions.

reserves: decimal.Decimal

Sum of all reserves in USD – stable_reserves + non_stable_reserves.

positions: decimal.Decimal

Sum of open GMX position values in USD, net of borrowing fees, funding fees, position fees and price impact.

stable_reserves: decimal.Decimal

Portion of reserves summed at face value because the token looks like a USD-pegged stablecoin. Defaults to Decimal(0) for backward-compatible direct construction (fetch_gmx_total_equity() always sets this explicitly and correctly).

non_stable_reserves: decimal.Decimal

Portion of reserves converted to USD via the GMX oracle mark price – non-stablecoin reserve tokens, plus native ETH when include_native_eth was set. Defaults to Decimal(0) for backward-compatible direct construction.

get_total()

Total equity = reserves + positions.

Return type

decimal.Decimal

__init__(reserves, positions, stable_reserves=Decimal('0'), non_stable_reserves=Decimal('0'))
Parameters
Return type

None