fix(core): avoid float drift in venue decimal math#955
Conversation
| const bestAsk = contract.prices?.bestAsk ? parseFloat(contract.prices.bestAsk) : 0.5; | ||
| const bestBidRaw = contract.prices?.bestBid ?? '0.5'; | ||
| const bestAskRaw = contract.prices?.bestAsk ?? '0.5'; | ||
| const bestBid = parseFloat(bestBidRaw); |
| const bestBidRaw = contract.prices?.bestBid ?? '0.5'; | ||
| const bestAskRaw = contract.prices?.bestAsk ?? '0.5'; | ||
| const bestBid = parseFloat(bestBidRaw); | ||
| const bestAsk = parseFloat(bestAskRaw); |
PR Review: PASS (NOT VERIFIED)What This DoesIntroduces decimal-string helpers and applies them in venue price/amount arithmetic to reduce floating-point drift in financial fields. Blast RadiusCore normalizers/order helpers for Gemini Titan, Kalshi, Opinion, Polymarket US, Smarkets, plus new decimal-math tests. Consumer VerificationBefore (base branch): After (PR branch): Test Results
FindingsNo blocking findings. PMXT Pipeline Check
Semver Impactpatch -- financial precision bug fix without API shape change. RiskLive venue payloads were not sampled, so this review verifies the arithmetic/unit path rather than real exchange data. |
Summary
Fixes #718
Fixes #714
Fixes #709
Fixes #674
Fixes #671
Fixes #666
Fixes #664
Fixes #295
Fixes #286
Fixes #229
Fixes #713
Test Plan