setup_gmx_whitelisting

Documentation for eth_defi.gmx.whitelist.setup_gmx_whitelisting function.

setup_gmx_whitelisting(guard, gmx_deployment, owner, safe_address)

Set up complete GMX whitelisting on a Guard contract.

This function performs all necessary whitelisting for GMX trading:

  1. Whitelist GMX router contracts (ExchangeRouter, SyntheticsRouter, OrderVault)

  2. Whitelist the Safe as a receiver

  3. Whitelist all specified markets

  4. Optionally whitelist collateral tokens

Example:

from eth_defi.gmx.whitelist import GMXDeployment, setup_gmx_whitelisting

gmx = GMXDeployment.create_arbitrum(
    markets=["0x70d95587d40A2caf56bd97485aB3Eec10Bee6336"],
)

tx_hashes = setup_gmx_whitelisting(
    guard=guard_contract,
    gmx_deployment=gmx,
    owner=safe_address,
    safe_address=safe_address,
)
Parameters
Returns

Dictionary with transaction hashes grouped by operation type.

Return type

dict[str, list[hexbytes.main.HexBytes]]