Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set protocols (v2 or v3) for AlphaRouter.routeToRatio #772

Open
hubagaspar91 opened this issue Dec 2, 2024 · 0 comments
Open

Comments

@hubagaspar91
Copy link

hubagaspar91 commented Dec 2, 2024

  • 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

No matter what you set as protocols in the parameters of AlphaRouter.routeToRatio, it seems it gets overwritten inside the method to [Protocol.V2, Protocol.V3] (https://github.com/Uniswap/smart-order-router/blob/main/src/routers/alpha-router/alpha-router.ts#L1141).

This causes problems with our integration, where we want to specifically force to only use V3. Moreover, this seems like an unreasonable implicit behavior, and it should be configurable from the outside.

  • Other information (e.g. detailed explanation, stack traces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)

Something like this would make way more sense (with the inclusion of checks before this, to throw or return error if Protocol.Mixed is passed, as it seems from the comment that that option is not handled):

swap = await this.route(
    amountToSwap,
    outputBalance.currency,
    TradeType.EXACT_INPUT,
    undefined,
    {
      ...DEFAULT_ROUTING_CONFIG_BY_CHAIN(this.chainId),
      ...routingConfig,
      protocols: routingConfig.protocols || [Protocol.V3, Protocol.V2],
    }
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant