Documentation
    Preparing search index...

    Function getSqrtPriceSlippageBounds

    • Computes min/max sqrt-price bounds for slippage protection.

      Cap: slippage_tolerance_bps is clamped to BPS_DENOMINATOR (10_000) so the radicands (10000 ± bps) stay non-negative and we never take sqrt of a negative.

      Parameters

      • sqrt_price - The current sqrt priceX64
      • slippage_tolerance_bps - The slippage tolerance in basis points

      Returns

      • SqrtPriceSlippageBounds - The min and max sqrt price bounds

      Parameters

      • sqrt_price: bigint
      • slippage_tolerance_bps: number

      Returns SqrtPriceSlippageBounds