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
Computes min/max sqrt-price bounds for slippage protection.
Cap:
slippage_tolerance_bpsis 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 priceX64slippage_tolerance_bps- The slippage tolerance in basis pointsReturns
SqrtPriceSlippageBounds- The min and max sqrt price bounds