Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a swap pair.

A pair consists of two parts:

  • the underlying pool, and
  • the strategy, which determines how the pool should be traded.

Unlike UniswapV2, there may be multiple pairs for a given set of two tokens. For example: there could exist both a StableSwap and a CP-AMM pair for two tokens. It is up to the trade calculator to determine

Type Parameters

  • P = unknown

Hierarchy

  • Pair

Index

Constructors

Properties

pool: P
strategy: PoolStrategy<P>
fromStableSwap: ((pool: StableSwapPool) => Pair<StableSwapPool>) = pairFromStableSwap

Type declaration

fromWrappedToken: ((wrapped: WrappedToken) => Pair<WrappedToken>) = pairFromWrappedToken

Type declaration

Accessors

  • get network(): Network
  • get token0(): Token
  • get token0Price(): Price
  • get token1(): Token
  • get token1Price(): Price

Methods

  • asAction(outputToken: Token): Action
  • hasZeroLiquidity(): boolean
  • involvesToken(token: Token): boolean
  • priceOf(token: Token): Price
  • Return the price of the given token in terms of the other token in the pair.

    Parameters

    • token: Token

      token to return price of

    Returns Price

  • toString(): string

Generated using TypeDoc