add_liquidity

Documentation for eth_defi.uniswap_v3.deployment.add_liquidity function.

add_liquidity(web3, deployer, *, deployment, pool, amount0, amount1, lower_tick, upper_tick)[source]

Add liquidity to a pool.

See Uniswap V3 documentation for details.

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

  • deployer (eth_typing.evm.HexAddress) – Deployer account

  • deployment (eth_defi.uniswap_v3.deployment.UniswapV3Deployment) – Uniswap v3 deployment

  • pool (web3.contract.contract.Contract) – Pool contract proxy

  • amount0 (int) – Amount of token0 to be added

  • amount1 (int) – Amount of token1 to be added

  • lower_tick (int) – Lower tick of the position

  • upper_tick (int) – Upper tick of the position

Returns

  • tx_receipt: Transaction receipt of the mint transaction

  • lower_tick: Corrected lower tick of the position with correct tick spacing

  • upper_tick: Corrected upper tick of the position with correct tick spacing

Return type

tuple[dict, int, int]