A selection of utility functions for the WhirlpoolRouter.

WhirlpoolRouter will be removed in the future release. Please use endpoint which provides qoutes.

Constructors

Methods

  • Get the default options for generating trade routes.

    Returns RoutingOptions

    Default options for generating trade routes.

    WhirlpoolRouter will be removed in the future release. Please use endpoint which provides qoutes.

  • Calculate the price impact for a route.

    Parameters

    • trade: Trade

      The trade the user used to derive the route.

    • route: TradeRoute

      The route to calculate the price impact for.

    Returns Decimal

    A Decimal object representing the percentage value of the price impact (ex. 3.01%)

    WhirlpoolRouter will be removed in the future release. Please use endpoint which provides qoutes.

  • Get the tick arrays addresses that are touched by a route.

    Parameters

    • route: TradeRoute

      The route to get the tick arrays from.

    Returns PublicKey[]

    The tick arrays addresses that are touched by the route.

    WhirlpoolRouter will be removed in the future release. Please use endpoint which provides qoutes.

  • Selects the best executable route from a list of routes using the current execution environment. The wallet support type, available ATA accounts, existence of lookup tables all effect the transaction size and eligibility of a route.

    Parameters

    Returns Promise<null | ExecutableRoute>

    The best ExecutableRoute that can be used to execute a swap. If no executable route is found, null is returned.

    WhirlpoolRouter will be removed in the future release. Please use endpoint which provides qoutes.