Options
All
  • Public
  • Public/Protected
  • All
Menu

A selection of utility functions for the WhirlpoolRouter.

Hierarchy

  • RouterUtils

Index

Constructors

Methods

  • 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%)

  • getTouchedTickArraysFromRoute(route: TradeRoute): PublicKey[]
  • 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.

  • Selects the best executable route from a list of routes using the current execution environment. The wallet support type, available ATA accounts, existance 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.

Generated using TypeDoc