You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.
How can i retrive the Route for two tokens that have not a pair ?
The following code uses two tokens that doesn't have a pair on uniswap, and during the execution encouter an error that is reported below. The same code if applied on tokens with a pair works well ( forx example WETH and DAI ) , so i am wondering what i have to change to make this works also with tokens without a pair?
Warning: 0x3301ee63fb29f863f2333bd4466acb46cd8323e6 is not checksummed.
Warning: 0xf32aa187d5bc16a2c02a6afb7df1459d0d107574 is not checksummed.
(node:138647) UnhandledPromiseRejectionWarning: Error: call revert exception (method="getReserves()", errorArgs=null, errorName=null, errorSignature=null, reason=null, code=CALL_EXCEPTION, version=abi/5.4.1)
at Logger.makeError (/home/pero/projects/web3-testing/node_modules/@ethersproject/contracts/node_modules/@ethersproject/logger/lib/index.js:199:21)
at Logger.throwError (/home/pero/projects/web3-testing/node_modules/@ethersproject/contracts/node_modules/@ethersproject/logger/lib/index.js:208:20)
at Interface.decodeFunctionResult (/home/pero/projects/web3-testing/node_modules/@ethersproject/contracts/node_modules/@ethersproject/abi/lib/interface.js:384:23)
at Contract.<anonymous> (/home/pero/projects/web3-testing/node_modules/@ethersproject/contracts/lib/index.js:338:56)
at step (/home/pero/projects/web3-testing/node_modules/@ethersproject/contracts/lib/index.js:48:23)
at Object.next (/home/pero/projects/web3-testing/node_modules/@ethersproject/contracts/lib/index.js:29:53)
at fulfilled (/home/pero/projects/web3-testing/node_modules/@ethersproject/contracts/lib/index.js:20:58)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:138647) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:138647) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
The text was updated successfully, but these errors were encountered:
The best option for routing at the moment is the Universal Router or the corresponding SDK.
To take a deep dive into the routing logic Uniswap uses take a look at the Smart Order Router.
I didn't find an option provided by Uniswap to only consider V2 pairs. You could use the V2 Subgraph to query all pairs and use a pathfinding algorithm to find routes between them, for example Bellman-Ford.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
How can i retrive the Route for two tokens that have not a pair ?
The following code uses two tokens that doesn't have a pair on uniswap, and during the execution encouter an error that is reported below. The same code if applied on tokens with a pair works well ( forx example WETH and DAI ) , so i am wondering what i have to change to make this works also with tokens without a pair?
CODE
OUTPUT
The text was updated successfully, but these errors were encountered: