pair_for

Documentation for eth_defi.uniswap_v2.utils.pair_for function.

pair_for(factory, token_a, token_b, magical_hash)[source]

Deduct the Uniswap pair contract address

Parameters
  • factory (HexAddress) – Factory contract address

  • token_a (HexAddress) – Base token

  • token_b (HexAddress) – Quote token

  • magical_hash (HexStr) – Init code hash of the Uniswap instance. Set None to use the default Sushiswap hash.

Returns

Pair contract address

Return type

HexAddress