Developer fixes off-grid price validation bug in Polymarket's Python SDK
A developer auditing Polymarket's open-source Python SDK, py-sdk, discovered a bug in the order validation logic that incorrectly checks decimal place count instead of verifying whether a price is an actual multiple of the market's tick size. The flaw affects half-step tick sizes of 0.005 and 0.0025, allowing off-grid prices like 0.007 to pass client-side validation even though they would ultimately be rejected by the exchange. Because Polymarket orders are signed using EIP-712 and the price is embedded in the signature, the exchange cannot adjust an off-grid price without invalidating the signature, making the failed signing round-trip entirely avoidable. The fix, an eight-line additive patch adding a modulo-based grid membership check to both validator functions, was submitted as a pull request and reported upstream to Polymarket's repository. The patch was verified against approximately 23,000 enumerated price cases across all supported tick sizes, with no false rejections or false acceptances recorded.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in