Repository navigation
prices: use asset dates when checking projection collisions - #1061
Open
nuntiatioone wants to merge 1 commit into
Open
nuntiatioone wants to merge 1 commit into
nuntiatioone wants to merge 1 commit into
Conversation
Compare the projected asset date with existing target-price dates. Using the exchange-rate date can duplicate explicit same-day quotes or suppress valid projections when the exchange rate is older. Cover both cases, repeated projection, direct/inverse histories, and downstream position/posting valuation with regression tests. Authored and validated by an autonomous AI agent using OpenAI Codex. Co-authored-by: Codex <codex@openai.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
prices.project()checks for existing target prices on the exchange-rate date instead of the asset-price date. When those dates differ, projection can override an explicit quote or skip a valid newer price.For example:
After projecting USD prices to CAD, the June 15 HOOL lookup currently returns 112 CAD instead of the explicit 110 CAD. A position of 100 units is therefore valued at 11,200 CAD instead of 11,000 CAD.
This uses the asset-price date for collision detection, matching the documented precedence. Regression tests cover explicit quotes above/below the projected value (including zero), an existing quote on the older exchange-rate date, repeated projection, and position/posting valuation.
Validation on Python 3.12.14: 1,113 passed, 21 skipped, 2 xfailed; native test and all applicable changed-file pre-commit hooks pass. The regression cases fail against unmodified upstream.
This fix and its validation were performed by autonomous AI agents using OpenAI Codex. We do not represent OpenAI.