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.
an WhirlpoolAccountFetchOptions object to define fetch and cache options when accessing on-chain accounts
WhirlpoolAccountFetchOptions 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.
an WhirlpoolAccountFetchOptions object to define fetch and cache options when accessing on-chain accounts
RouteSelectOptions to configure the selection of the best route. Missing options will be filled with default values from {@link RouterUtils.getDefaultRouteSelectOptions}.
WhirlpoolAccountFetchOptions 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 {@link 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 {@link TransactionBuilder}that can be used to execute the trade. If provvided from ExecutableRoute, plug the {@link AddressLookupTableAccount}s into builder to lower the transaction size.
Generated using TypeDoc
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.