smart-order-router icon indicating copy to clipboard operation
smart-order-router copied to clipboard

Alpha router returns unverified router addresses

Open searchableguy opened this issue 1 year ago • 0 comments

  • I'm submitting a ... [x] bug report [ ] feature request [ ] question about the decisions made in the repository [ ] question about how to use this project

  • Summary

With the following code, sometimes on polygon - it returns unverified swapRouter address such as 0xe40b4a25328dc87bbe396662bac0cd1c1be6e883.

    const router = new AlphaRouter({
      chainId: network,
      provider,
    })
    const outputAmount = CurrencyAmount.fromRawAmount(tokenOut, amountOut)
    const routeArgs = [
      outputAmount,
      tokenIn,
      TradeType.EXACT_OUTPUT,
      {
        type: SwapType.UNIVERSAL_ROUTER,
        recipient,
        slippageTolerance: new Percent(15, 100),
        deadline: Math.floor(new Date().getTime() / 1000 + 60 * 60), // 1 hour
      },
    ] as const
    // call router
    const swapResponse = await router.route(...routeArgs)

Is this expected? These unverified addresses differ from the uniswap documentation and deployment addresses.

searchableguy avatar Apr 05 '23 20:04 searchableguy