Skip to content

fix: make price and per-fill notional conversions exact - #2

Merged
dev-belly merged 1 commit into
mainfrom
codex/20261004-exact-conversion
Oct 4, 2026
Merged

dev-belly merged 1 commit into
mainfrom
codex/20261004-exact-conversion

Conversation

@dev-belly

Copy link
Copy Markdown
Owner

A caller's Decimal precision of 2 made valid price conversion raise InvalidOperation and changed 39.12 × 13 from 508.56 to 510. Even the default context rounded a sufficiently long decimal just below a half tick up to the next tick.

Round prices using their exact integer ratios and half-up semantics. Construct tick prices and per-fill notionals from decimal coefficients without inheriting caller arithmetic settings. Reject non-finite prices/tick sizes with InstrumentError, and document this boundary in ADR-001.

Validation: all 48 domain tests passed, including 10 new cases and the strengthened Fill regression; full local suite: 755 passed, 150 skipped (optional C++/artifact-dependent checks); Ruff lint and formatting passed across 129 files; mypy passed for 100 source files; git diff --check passed. CI separately runs the compiled C++ differential and sanitizer jobs.

@dev-belly
dev-belly merged commit 2685c4b into main Oct 4, 2026
6 checks passed
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