gmx.vault_catalog

Documentation for eth_defi.gmx.vault_catalog Python module.

Onchain catalogue for GMX V2 GM and GLV share tokens.

GMX market tokens and GLV tokens are ERC-20 shares, but not ERC-4626 vaults. They must therefore be enumerated from GMX’s Reader contracts rather than the generic Deposit-event discovery path. This module is deliberately limited to current catalogue facts; historical first-usable-block evidence and historical valuation are separate stages.

The contract interfaces follow GMX’s canonical Reader.sol and GlvReader.sol implementations.

Module Attributes

GMX_CHAIN_NAMES_BY_ID

Supported GMX V2 vault-catalogue deployments by EVM chain ID.

Functions

fetch_gmx_v2_vault_products(web3, *[, ...])

Enumerate GMX V2 GM and GLV share tokens from the current chain state.

Classes

GMXVaultProduct

Current onchain identity and composition of one GMX V2 share token.

GMX_CHAIN_NAMES_BY_ID: dict[int, str] = {42161: 'arbitrum', 43114: 'avalanche'}

Supported GMX V2 vault-catalogue deployments by EVM chain ID.

class GMXVaultProduct

Bases: object

Current onchain identity and composition of one GMX V2 share token.

The catalogue synchroniser converts this protocol-native description into a common vault metadata row without losing GM/GLV composition details.

chain_id: int

EVM chain where the product is deployed.

token_address: eth_typing.evm.HexAddress

GM market-token or GLV share-token address.

product_type: str

"gm" for a market token or "glv" for a multi-market share.

symbol: str

ERC-20 share-token symbol.

name: str

ERC-20 share-token name.

decimals: int

ERC-20 share-token decimals.

component_addresses: tuple[eth_typing.evm.HexAddress, ...]

GM market, index, long and short addresses, or GLV share, long, short and supported GM market addresses.

accepted_deposit_tokens: tuple[eth_typing.evm.HexAddress, ...]

GMX long and short token addresses accepted for this product.

is_enabled: bool

Current GMX DataStore status. Disabled products remain present so later metadata synchronisation does not orphan historical rows.

__init__(chain_id, token_address, product_type, symbol, name, decimals, component_addresses, accepted_deposit_tokens, is_enabled)
Parameters
Return type

None

fetch_gmx_v2_vault_products(web3, *, page_size=100, block_identifier='latest', token_cache=None)

Enumerate GMX V2 GM and GLV share tokens from the current chain state.

This uses the onchain Reader and GlvReader as the identity source. REST data is intentionally not consulted: API listing status is useful later as enrichment, but cannot be allowed to add or remove a vault identity.

Parameters
  • web3 (web3.main.Web3) – Archive-capable Web3 connection to Arbitrum One or Avalanche.

  • page_size (int) – Positive Reader page size. The reader is paged instead of relying on today’s market count or GLV count.

  • block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, int]) – Block at which all product facts are read.

  • token_cache (Optional[dict]) – Optional shared token-details cache.

Returns

GM products followed by GLV products, each retaining disabled entries.

Raises

ValueError – If the connected chain is not a supported GMX V2 deployment.

Return type

collections.abc.Iterator[eth_defi.gmx.vault_catalog.GMXVaultProduct]