Description
-
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],
}
);