I am working with the Quoter from Uniswap V3, here is the part of the function that challenges me:


// Reformat Amount In
  if (!isNaN(amtIn)) {amtIn = amtIn.toString()}
  let amountIn = ethers.utils.parseUnits(amtIn, inputDecimalsA).toString()

  // Get Uniswap V3 Quote
  const quoterAddress = "0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6";
  const quoterContract = new ethers.Contract(quoterAddress, QuoterABI, provider)
  let quotedAmountOut = 0
  try {
    quotedAmountOut = await quoterContract.callStatic.quoteExactInputSingle(
  } catch (err) {
    console.log("Something went wrong....", err)
    return 0

    // Format Output
    let outputAmount = ethers.utils.formatUnits(quotedAmountOut, inputDecimalsB).toString()
    return outputAmount

When I run this with the latest version of uniswap sdk and ethers, I get these errors:

TypeError: Cannot read properties of undefined (reading 'quoteExactInputSingle')


contract runner does not support sending transactions (operation="sendTransaction", code=UNSUPPORTED_OPERATION, version=6.7.1)

It seems like the latest dependencies having a problem with the .callStatic but even without it it didn't work.

The interesting thing is, when I am using older dependency versions like below, it works. Older Versions:

"dependencies": {
    "@uniswap/sdk-core": "^3.0.1",
    "@uniswap/v3-sdk": "^3.6.3",
    "dotenv": "^16.3.1",
    "ethers": "^5.7.2",
    "uniswap": "^0.0.1",
    "web3": "^1.6.1",
    "yarn": "^1.22.19"

I tried to read the Quoter.sol Smart Contract and try to understand what causes the problem, but without success. Link: (https://github.com/Uniswap/v3-periphery/blob/v1.0.0/contracts/lens/Quoter.sol)

I would really appreciate if someone out there could help me solving this issue and tell me what to change in the code to make it work with the latest dependencies since I fear that other functions I would like to use like trades are not going to work with the old versions. Thanks in advance

2 Answers 2


Pls go ahead and follow this example:


if you followed, try using: quoterContract.connect(signer).callStatic.quoteExactInputSingle(...)

try to get siger from etherjs


const signer = new ethers.Wallet(your_private_key_string, provider);

pass the signer instead of provider.

Pls, vote up if it solved your problem, otherwise leave a comment :)

  • Well if I do this with const provider = new ethers.JsonRpcProvider("xxx"); as provider and try to get a signer like this signer = await provider.getSigner() it throws me the following error: throw new Error("no such account");. Thank you for trying to help me:) Commented Sep 21, 2023 at 15:03
  • @Christopherus I've updated the answer. that is because you didn't pass your account(private-key) to the provider object. so how the provider can understand which account you're talking to.
    – 0xbeny
    Commented Sep 22, 2023 at 6:28

I don't know why you would connect your wallet to the contract...

If you are using ethers.js v6 you need to change

quotedAmountOut = await quoterContract.callStatic.quoteExactInputSingle(...)


quotedAmountOut = await quoterContract.quoteExactInputSingle.callStatic(...)

This will resolve

TypeError: Cannot read properties of undefined (reading 'quoteExactInputSingle')


Uniswap v3 QuoterV2 not returning amountOut

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.