Finds all possible routes for a trade, ordered by the best other token amount you would get from a trade. Use RouterUtils.selectFirstExecutableRoute to find the best executable route.
The trade to find routes for.
Optional
opts: Partial<RoutingOptions>an WhirlpoolAccountFetchOptions object to define fetch and cache options when accessing on-chain accounts
Optional
fetchOpts: SimpleAccountFetchOptionsWhirlpoolAccountFetchOptions to configure the fetching of on-chain data.
A list of TradeRoute that can be used to execute a swap, ordered by the best other token amount.
Finds all possible routes for a trade and select the best route that is executable under the current execution environment.
The trade to find routes for.
Optional
opts: Partial<RoutingOptions>an WhirlpoolAccountFetchOptions object to define fetch and cache options when accessing on-chain accounts
Optional
selectionOpts: Partial<RouteSelectOptions>RouteSelectOptions to configure the selection of the best route. Missing options will be filled with default values from RouterUtils.getDefaultRouteSelectOptions.
Optional
fetchOpts: SimpleAccountFetchOptionsWhirlpoolAccountFetchOptions to configure the fetching of on-chain data.
The best ExecutableRoute that can be used to execute a swap. If no executable route is found, null is returned.
Construct a TransactionBuilder to help execute a trade route.
The trade route to execute.
The slippage tolerance for the trade.
The ATA accounts that the executing wallet owns / needed by the execution. If not provided, the router will attempt to resolve them.
A TransactionBuilderthat can be used to execute the trade. If provvided from ExecutableRoute, plug the AddressLookupTableAccounts into builder to lower the transaction size.
Convienience class to find routes through a set of Whirlpools and execute a swap across them. The router only supports up to 2-hop trades between pools and does not support arbitrage trades between the same token.
Deprecated
WhirlpoolRouter will be removed in the future release. Please use endpoint which provides qoutes.