SShortSingh.
Back to feed

Developer fixes off-grid price validation bug in Polymarket's Python SDK

0
·1 views

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.

Read the full story at DEV Community

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

Related stories

0
ProgrammingDEV Community ·

How 'Act Like an Owner' Culture Often Leaves Employees With Nothing

Many tech companies tell new hires they are owners by granting equity, but the fine print frequently tells a different story. Standard agreements typically include a four-year vesting schedule, a one-year cliff, and a 90-day window to purchase shares after leaving. Most departing employees cannot afford to exercise their options within that window, effectively forfeiting the stock they were promised. This structure is not an exception or oversight — it is the industry norm. Critics argue the 'ownership' framing is largely performative, designed to motivate workers without transferring meaningful financial stake.

0
ProgrammingDEV Community ·

Developer scraps misleading 68% cost-saving claim from open-source AI tool ORA

A developer has released ORA, an open-source Go binary that breaks tasks into subtasks and routes each to the most cost-effective AI model available, compatible with tools like Claude Code, Codex, and Cursor. The original README prominently featured a claim that ORA was 68% cheaper than using a flagship model alone, but the figure was based on a hypothetical worked example rather than actual measurements. The developer acknowledged the number was misleading because it ignored that cheaper models often use more tokens and require retries, making raw cost-per-token comparisons unreliable. Rather than refine the metric, the developer deleted it entirely and replaced it with a straightforward display of real token usage multiplied by actual per-model pricing. The move reflects a broader critique of AI tooling benchmarks that compare real runs against imagined baselines chosen by the vendor making the announcement.

0
ProgrammingDEV Community ·

Three Gorges Dam Ship Lift Moves 15,500 Tonnes Using Counterweight Balance

The Three Gorges Dam on China's Yangtze River houses the world's largest ship lift, designed to vertically transport vessels across a 113-metre elevation difference. Rather than using traditional step-by-step lock systems that take hours, engineers chose to move ships in a single vertical journey inside a water-filled steel basin. The combined weight of the ship, water, and basin reaches approximately 15,500 tonnes, which is nearly offset by a counterweight system so that motors only handle the small remaining imbalance. A rack-and-pinion mechanism ensures all four corners of the basin rise at identical speeds, preventing water from sloshing, while a nut-and-screw safety system instantly locks the basin if a fault occurs. The dam operates two separate transit solutions side by side — the large ship lift for vessels up to 3,000 tonnes and a smaller express channel for lighter boats — completing each vertical crossing in roughly 40 minutes.

0
ProgrammingDEV Community ·

Developer finds critical agentic workflow bugs only visible at runtime, not in code

A developer building ArDD, a structured AI coding tool that breaks projects into plans and tasks for Claude Code agents, discovered significant flaws only after running live smoke tests rather than relying on code review. A key bug revealed that delegated git worktrees branched from the remote tracking branch instead of local HEAD, meaning locally committed state was invisible to subagents. A separate, unexplained issue caused git worktrees to corrupt the primary checkout's configuration by flipping core.bare to true. The developer responded with a mandatory alignment script for subagents and a coordinator-level tripwire to detect the config corruption, while acknowledging neither was a true fix. The experience prompted a broader architectural redesign so that coordinating state only lands on the main branch alongside the code it describes, ensuring failed runs leave no partial state behind.

Developer fixes off-grid price validation bug in Polymarket's Python SDK · ShortSingh