determine_swap_route

Documentation for eth_defi.gmx.utils.determine_swap_route function.

determine_swap_route(markets, in_token, out_token, chain='arbitrum')

Determine the optimal swap route through available GMX markets.

Using the available markets, find the list of GMX markets required to swap from token in to token out.

Parameters
  • markets (dict) – Dictionary of markets output by getMarketInfo

  • in_token (str) – Contract address of input token

  • out_token (str) – Contract address of output token

  • chain (str) – Blockchain network name

Returns

Tuple of (list of GMX markets to swap through, requires_multi_swap)

Return type

tuple[list, bool]