whitelist_gmx_markets

Documentation for eth_defi.gmx.whitelist.whitelist_gmx_markets function.

whitelist_gmx_markets(guard, markets, owner, notes_prefix='GMX market')

Whitelist multiple GMX markets in a Guard contract.

This function whitelists each market individually by calling whitelistGMXMarket() on the Guard contract. The caller must be the Guard owner (typically the Safe).

Example:

from eth_defi.gmx.whitelist import whitelist_gmx_markets

tx_hashes = whitelist_gmx_markets(
    guard=guard_contract,
    markets=[
        "0x70d95587d40A2caf56bd97485aB3Eec10Bee6336",  # ETH/USD
        "0x47c031236e19d024b42f8AE6780E44A573170703",  # BTC/USD
    ],
    owner=safe_address,
)
Parameters
  • guard (web3.contract.contract.Contract) – Guard contract instance (GuardV0).

  • markets (list[eth_typing.evm.HexAddress]) – List of GMX market addresses to whitelist.

  • owner (eth_typing.evm.HexAddress) – Address of the Guard owner (must have permission to whitelist).

  • notes_prefix (str) – Prefix for the notes string in each whitelist call.

Returns

List of transaction hashes for each whitelist operation.

Return type

list[hexbytes.main.HexBytes]