Skip to content

chore: validate prices and tick sizes#39

Open
suhaiIkakar wants to merge 1 commit intoPolymarket:mainfrom
suhaiIkakar:fix/big-decimal
Open

chore: validate prices and tick sizes#39
suhaiIkakar wants to merge 1 commit intoPolymarket:mainfrom
suhaiIkakar:fix/big-decimal

Conversation

@suhaiIkakar
Copy link
Copy Markdown

@suhaiIkakar suhaiIkakar commented Apr 13, 2026

compare price/tick bounds with Big instead of parseFloat to avoid floating-point edge cases in priceValid and
isTickSizeSmaller.


Note

Medium Risk
Changes core order validation comparisons to use big-integer arithmetic instead of parseFloat, which can alter boundary behavior for prices/tick sizes and impact order submission in edge cases.

Overview
Updates tick/price validation to avoid floating-point edge cases by switching isTickSizeSmaller and priceValid from parseFloat-based comparisons to mjs-biginteger (Big) comparisons, including computing the upper bound as 1 - tickSize with arbitrary-precision math.

Adds mjs-biginteger as a runtime dependency to support these comparisons.

Reviewed by Cursor Bugbot for commit 1f53d4c. Bugbot is set up for automated code reviews on this repo. Configure here.

@suhaiIkakar suhaiIkakar requested a review from a team as a code owner April 13, 2026 17:37
@suhaiIkakar suhaiIkakar changed the title feat: validate prices and tick sizes chore: validate prices and tick sizes Apr 13, 2026
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