Skip to main content

Route

@pegasys-fi/v3-sdk / Exports / Route

Class: Route<TInput, TOutput>

Represents a list of pools through which a swap can occur

Type parameters

NameTypeDescription
TInputextends CurrencyThe input token
TOutputextends CurrencyThe output token

Table of contents

Constructors

Properties

Accessors

Constructors

constructor

new Route<TInput, TOutput>(pools, input, output)

Creates an instance of route.

Type parameters

NameType
TInputextends Currency
TOutputextends Currency

Parameters

NameTypeDescription
poolsPool[]An array of Pool objects, ordered by the route the swap will take
inputTInputThe input token
outputTOutputThe output token

Defined in

entities/route.ts:25

Properties

_midPrice

Private _midPrice: null | Price<TInput, TOutput> = null

Defined in

entities/route.ts:17


input

Readonly input: TInput

Defined in

entities/route.ts:14


output

Readonly output: TOutput

Defined in

entities/route.ts:15


pools

Readonly pools: Pool[]

Defined in

entities/route.ts:12


tokenPath

Readonly tokenPath: Token[]

Defined in

entities/route.ts:13

Accessors

chainId

get chainId(): number

Returns

number

Defined in

entities/route.ts:54


midPrice

get midPrice(): Price<TInput, TOutput>

Returns the mid price of the route

Returns

Price<TInput, TOutput>

Defined in

entities/route.ts:61