Class TickMath

Hierarchy

  • TickMath

Constructors

Properties

INVALID_TICK: number = -99999999
MAX_TICK: number = -TickMath.MIN_TICK
MAX_TICK_VALUE: string = "∞"
MIN_TICK: number = -887272
MIN_TICK_VALUE: string = "0"

Methods

  • getBaseTickRange(fromToken: IToken, toToken: IToken, fee: Fee_Amount, leftRange: string, rightRange: string): { tickLower: number; tickUpper: number }
  • Parameters

    Returns { tickLower: number; tickUpper: number }

    • tickLower: number
    • tickUpper: number
  • getFormattedPriceByTick(tick: Value, fee: Fee_Amount): string
  • Parameters

    Returns string

  • getNearestPriceByInput(feeAmount: Fee_Amount, price: string): string
  • Parameters

    Returns string

  • getNearestPricesByFullTick(fee: Fee_Amount): { highestPrice: string; lowestPrice: string }
  • Parameters

    Returns { highestPrice: string; lowestPrice: string }

    • highestPrice: string
    • lowestPrice: string
  • getNearestTickByPrice(feeAmount: Fee_Amount, value: string): number
  • Compute nearest tick of price for input

    Parameters

    Returns number

  • getPriceBySqrtPrice(sqrtPrice: string): string
  • Parameters

    • sqrtPrice: string

    Returns string

  • getPriceByTick(tick: Value): string
  • Parameters

    • tick: Value

    Returns string

  • getSqrtPriceByPrice(price: string): string
  • Parameters

    • price: string

    Returns string

  • isHighestTick(tick: Value, fee: Fee_Amount): boolean
  • Parameters

    Returns boolean

  • isLowestTick(tick: Value, fee: Fee_Amount): boolean
  • Parameters

    Returns boolean

  • nearestUsableTick(tick: number, tickSpacing: number): number
  • Parameters

    • tick: number
    • tickSpacing: number

    Returns number