So basically I am trying to mint a position in a pool created by me.

To create and initialise the pool:

  const factory = await ethers.getContractAt("UniswapV3Factory", factoryAddress)
  let poolAddress = await factory.getPool("0x40a42Baf86Fc821f972Ad2aC878729063CeEF403", "0x4bf010f1b9beDA5450a8dD702ED602A104ff65EE", 500);

  const pool = await ethers.getContractAt("UniswapV3Pool", poolAddress);
    await pool.initialize(BigNumber.from(2).pow(96));
  } catch(exception){
    console.log("Pool already initialized");

Then to try to had liquidity I tried this:

  let signer = await ethers.getSigner("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266");

  await pool.connect(signer).mint(signer.address,-20,20,10000000,[]);

I realise it is missing the transfer of the tokens (which is suposed to come in a callback of the mint function) but I don't know how to implement it! Any ideas?

Or is this simply the wrong approach and there is a better on?


1 Answer 1


You may need to create a position in the pool.

Checkout: https://docs.uniswap.org/sdk/guides/liquidity/minting

  • Thats what I am trying to do! From my understanding the sdk actually doesnt allow u interact with the blockchain, its just to simulate I believe
    – FatherSena
    Commented Sep 19, 2022 at 13:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.