GMXDeployment
Documentation for eth_defi.gmx.whitelist.GMXDeployment Python class.
- class GMXDeployment
Bases:
objectGMX deployment configuration for Guard whitelisting.
This dataclass encapsulates all GMX-related configuration needed when deploying a Lagoon vault with GMX perpetuals trading support. Pass an instance to
deploy_automated_lagoon_vault()to automatically whitelist GMX contracts and markets during deployment.Example:
# Recommended: use factory method with dynamic address fetch gmx_deployment = GMXDeployment.create_arbitrum( markets=[ "0x70d95587d40A2caf56bd97485aB3Eec10Bee6336", # ETH/USD "0x47c031236e19d024b42f8AE6780E44A573170703", # BTC/USD ], )Attributes summary
exchange_routersynthetics_routerorder_vaultmarketstokensMethods summary
__init__(exchange_router, synthetics_router, ...)create_arbitrum([markets, tokens])Create a GMXDeployment for Arbitrum mainnet with dynamically fetched addresses.
- __init__(exchange_router, synthetics_router, order_vault, markets=<factory>, tokens=None)
- Parameters
exchange_router (eth_typing.evm.HexAddress) –
synthetics_router (eth_typing.evm.HexAddress) –
order_vault (eth_typing.evm.HexAddress) –
markets (list[eth_typing.evm.HexAddress]) –
tokens (Optional[list[eth_typing.evm.HexAddress]]) –
- Return type
None
- classmethod create_arbitrum(markets=None, tokens=None)
Create a GMXDeployment for Arbitrum mainnet with dynamically fetched addresses.
Fetches the latest GMX contract addresses from the GMX contracts registry on GitHub, ensuring addresses are always up-to-date even after GMX upgrades.
- Parameters
markets (Optional[list[eth_typing.evm.HexAddress]]) – List of market addresses to whitelist. If None, no markets are whitelisted.
tokens (Optional[list[eth_typing.evm.HexAddress]]) – List of token addresses to whitelist as collateral.
- Returns
GMXDeployment configured for Arbitrum mainnet.
- Raises
ValueError – If addresses cannot be fetched from the GMX API.
- Return type