Skip to main content

Route

@uniswap/v4-sdk / Route

Defined in: entities/route.ts:12

Represents a list of pools through which a swap can occur

Type Parameters

Type ParameterDescription
TInput extends CurrencyThe input currency
TOutput extends CurrencyThe output currency

Constructors

new Route()

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

Defined in: entities/route.ts:28

Creates an instance of route.

Parameters

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

Returns

Route<TInput, TOutput>

Properties

currencyPath

readonly currencyPath: Currency[]

Defined in: entities/route.ts:14


input

readonly input: TInput

Defined in: entities/route.ts:15


output

readonly output: TOutput

Defined in: entities/route.ts:16


pathInput

readonly pathInput: Currency

Defined in: entities/route.ts:17


pathOutput

readonly pathOutput: Currency

Defined in: entities/route.ts:18


pools

readonly pools: Pool[]

Defined in: entities/route.ts:13

Accessors

chainId

Get Signature

get chainId(): number

Defined in: entities/route.ts:58

Returns

number


midPrice

Get Signature

get midPrice(): Price<TInput, TOutput>

Defined in: entities/route.ts:65

Returns the mid price of the route

Returns

Price<TInput, TOutput>