I'm currently working on a project that involves creating two custom tokens on the Mumbai testnet and performing a swap operation for these tokens on Uniswap. However, I'm encountering an issue when trying to execute the trade.
I've already managed to create the tokens and the liquidity pool, but the trading operation fails. Here's my code:
D:\trading bot\0xArbi-bot\node_modules\@uniswap\sdk-core\dist\sdk-core.cjs.development.js:82
throw new Error('Could not parse fraction');
^
Error: Could not parse fraction
at Function.tryParseFraction (D:\trading bot\0xArbi-bot\node_modules\@uniswap\sdk-core\dist\sdk-core.cjs.development.js:82:11)
at Percent.lessThan (D:\trading bot\0xArbi-bot\node_modules\@uniswap\sdk-core\dist\sdk-core.cjs.development.js:113:32)
at Trade.minimumAmountOut (D:\trading bot\0xArbi-bot\node_modules\@uniswap\v3-sdk\dist\v3-sdk.cjs.development.js:3027:25)
at D:\trading bot\0xArbi-bot\node_modules\@uniswap\v3-sdk\dist\v3-sdk.cjs.development.js:3977:28
at Array.reduce (<anonymous>)
at Function.swapCallParameters (D:\trading bot\0xArbi-bot\node_modules\@uniswap\v3-sdk\dist\v3-sdk.cjs.development.js:3976:33)
at executeTrade (D:\trading bot\0xArbi-bot\uniswapCustom.js:143:40)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
This error seems to occur when calling SwapRouter.swapCallParameters with the trade and options parameters:
I've tried adjusting the output amount (numAmt) in different formats when creating the UncheckedTrade, but the error persists. I can't seem to identify the cause of this issue. My guess is that it has something to do with the calculation of the output amount or slippage, but I'm unsure.
I'm currently working on a project that involves creating two custom tokens on the Mumbai testnet and performing a swap operation for these tokens on Uniswap. However, I'm encountering an issue when trying to execute the trade.
I've already managed to create the tokens and the liquidity pool, but the trading operation fails. Here's my code:
Error I GOT:
This error seems to occur when calling SwapRouter.swapCallParameters with the trade and options parameters:
const methodParameters = SwapRouter.swapCallParameters([trade], options);
I've tried adjusting the output amount (numAmt) in different formats when creating the UncheckedTrade, but the error persists. I can't seem to identify the cause of this issue. My guess is that it has something to do with the calculation of the output amount or slippage, but I'm unsure.