v3-sdk icon indicating copy to clipboard operation
v3-sdk copied to clipboard

Uniswap V3 error while fetching quote

Open s-pcode opened this issue 1 year ago • 4 comments

This error does not occur every-time but happens frequently sometime.

Error: call revert exception [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (method="token0()", data="0x", errorArgs=null, errorName=null, errorSignature=null, reason=null, code=CALL_EXCEPTION, version=abi/5.7.0)

I have gone through the github example mentioned here and mostly I guess the issue comes when fetching the poolInfo as mentioned below:

const [token0, token1, fee, tickSpacing, liquidity, slot0] = await Promise.all([ poolContract.token0(), poolContract.token1(), poolContract.fee(), poolContract.tickSpacing(), poolContract.liquidity(), poolContract.slot0(), ]);

But I'm not sure why the error comes with selected pool pairs only. The same pool pair is available to to swap on app.uniswap.org without any issues. Please help me figure this out. The pool pair used to test was weth and matic on polygon chain.

s-pcode avatar May 09 '23 06:05 s-pcode

It could be because you are using ethers 6.0, which doesn't appear to be supported as I have found

lukese avatar Jun 09 '23 11:06 lukese

Not working, any update @lukese @s-pcode @felipebrahm @justindomingue @cmcewen

Kundannetset avatar Apr 15 '24 07:04 Kundannetset

hey @kundannetsetDemo, use ethers 5.7 and I moved onto using the universal router sdk for swapping on Uniswap which is more efficient. You can find a guide here.

s-pcode avatar Apr 16 '24 05:04 s-pcode

Still I using "ethers": "^5.7.2", but not working @s-pcode

Kundannetset avatar Apr 16 '24 06:04 Kundannetset