Uniswap / v3-sdk

🛠 An SDK for building applications on top of Uniswap V3
MIT License
553 stars 431 forks source link

Uniswap V3 error while fetching quote #173

Open s-pcode opened 1 year ago

s-pcode commented 1 year ago

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.

lukese commented 1 year ago

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

Kundannetset commented 6 months ago

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

s-pcode commented 6 months ago

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.

Kundannetset commented 6 months ago

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