Skip to content

fix(fx): clamp slippageBps to valid range [0, 10000] in applySlippageFloor - #28

Open
yappermoar-boop wants to merge 1 commit into
circlefin:masterfrom
yappermoar-boop:fix-slippage-floor-bounds-clamp
Open

fix(fx): clamp slippageBps to valid range [0, 10000] in applySlippageFloor#28
yappermoar-boop wants to merge 1 commit into
circlefin:masterfrom
yappermoar-boop:fix-slippage-floor-bounds-clamp

Conversation

@yappermoar-boop

Copy link
Copy Markdown

Updated applySlippageFloor in src/lib/fx.ts to clamp slippageBps to the valid range [0, 10000] (0% to 100%) using Math.max(0, Math.min(10_000, slippageBps)). Previously, passing invalid or custom BPS values outside [0, 10000] produced negative minimum output strings or amounts exceeding the original output amount.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant