deploy_trading_pair

Documentation for eth_defi.uniswap_v2.deployment.deploy_trading_pair function.

deploy_trading_pair(web3, deployer, deployment, token_a, token_b, liquidity_a, liquidity_b)[source]

Deploy a new trading pair on Uniswap v2.

Assumes deployer has enough token balance to add the initial liquidity. The deployer will also receive LP tokens for newly added liquidity.

See UniswapV2Factory.createPair() for details.

Parameters
  • web3 (web3.main.Web3) – Web3 instance

  • deployer (str) – Deployer account

  • deployment (eth_defi.uniswap_v2.deployment.UniswapV2Deployment) – Uniswap v2 deployment

  • token_a (web3.contract.contract.Contract) – Base token of the trading pair

  • token_b (web3.contract.contract.Contract) – Quote token of the trading pair

  • liquidity_a (int) – Initial liquidity added for token_a. Set zero if no liquidity will be added.

  • liquidity_b (int) – Initial liquidity added for token_b. Set zero if no liquidity will be added.

Returns

Pair contract address

Return type

eth_typing.evm.HexAddress