gmx.vault_sync
Documentation for eth_defi.gmx.vault_sync Python module.
Synchronise the onchain GMX V2 catalogue into the common vault database.
Module Attributes
Deposit-closure reason exported for disabled GMX products. |
|
Features that identify GMX products in persisted metadata. |
|
Number of equal candidate names required before adding an address suffix. |
|
GMX Reader uses this value for the absent index token of a swap-only pool. |
|
Special GMX index labels whose market identity differs from the token-registry symbol. |
|
GMX index markets tracking a real-world commodity, equity or financial index. |
Functions
|
Upsert GM and GLV products without disturbing unrelated vault rows. |
|
Add the AMM-pool marker to every persisted GMX vault in selected chains. |
Classes
Summarise one GMX metadata reconciliation. |
- GMX_DISABLED_DEPOSIT_REASON: str = 'GMX product disabled'
Deposit-closure reason exported for disabled GMX products.
- GMX_PRODUCT_FEATURES: frozenset[eth_defi.erc_4626.core.ERC4626Feature] = frozenset({<ERC4626Feature.gmx_gm: 'gmx_gm'>, <ERC4626Feature.gmx_glv: 'gmx_glv'>})
Features that identify GMX products in persisted metadata.
- GMX_NAME_COLLISION_SIZE: int = 2
Number of equal candidate names required before adding an address suffix.
- GMX_ZERO_ADDRESS: eth_typing.evm.HexAddress = '0x0000000000000000000000000000000000000000'
GMX Reader uses this value for the absent index token of a swap-only pool.
- GMX_INDEX_MARKET_LABEL_OVERRIDES: dict[str, str] = {'0x0cf1fb4d1ff67a3d8ca92c9d6643f8f9be8e03e5': 'wstETH/USD'}
Special GMX index labels whose market identity differs from the token-registry symbol.
- GMX_TRADFI_INDEX_MARKETS: frozenset[str] = frozenset({'BRENTOIL/USD', 'GOLD/USD', 'NATGAS/USD', 'QQQ/USD', 'SILVER/USD', 'SPCX/USD', 'SPY/USD', 'WTIOIL/USD'})
GMX index markets tracking a real-world commodity, equity or financial index.
- class GMXVaultCatalogueSyncResult
Bases:
objectSummarise one GMX metadata reconciliation.
Separates the complete current catalogue size from newly inserted and refreshed rows for scanner diagnostics.
- mark_gmx_vault_rows_amm_pool_like(vault_db, *, chain_ids)
Add the AMM-pool marker to every persisted GMX vault in selected chains.
The onchain catalogue can no longer return delisted GMX products, while their historical rows remain in the common database. This metadata-only repair therefore examines all retained rows rather than only the current catalogue and preserves the top-level and detection feature copies in lockstep.
- Parameters
vault_db (eth_defi.vault.vaultdb.VaultDatabase) – Common vault metadata database to repair in place.
chain_ids (set[int]) – GMX deployment chain IDs included in this migration run.
- Returns
Number of stored GMX rows changed.
- Return type
- fetch_and_sync_gmx_vault_catalogue(*, web3, vault_db, token_cache, block_number=None, max_workers=8)
Upsert GM and GLV products without disturbing unrelated vault rows.
New products record the block at which this catalogue first observes them.
- Parameters
web3 (web3.main.Web3) – Arbitrum One or Avalanche connection.
vault_db (eth_defi.vault.vaultdb.VaultDatabase) – Existing common metadata database to update in memory.
token_cache (eth_defi.token.TokenDiskCache) – Shared ERC-20 metadata cache.
block_number (Optional[int]) – Optional fixed catalogue block; defaults to the latest head.
max_workers (int) – Maximum metadata-read worker threads.
- Returns
Product, insertion and update counts.
- Return type