Repository navigation
portfolio: additional tests for edge cases. - #33
Merged
Merged
Conversation
…hecks In PortfolioExchange::check_portfolio_market_order, flipping a position can invalidate the position offset of resting limit orders on that market, so post_req must recompute order_margin against the post-flip position rather than keeping the pre-flip order margin. Add boundary and sign tests for check_portfolio_market_order (same-direction, flip with profit/loss/fees/other-market uPnL, flip with resting order offset loss) and check_portfolio_limit_order (order margin delta + maker fee reserve).
…in reconciliation Cover PortfolioExchange's collateral accounting and margin-call victim selection: - reserved_maker_fees and required_collateral summing bids and asks - largest_collateral_contributor across bids, asks, maker fees, and multiple markets - reconcile_portfolio_margin and update_market at exact zero excess and maintenance margin boundaries.
…liquidation ledger Cover remaining PortfolioExchange order lifecycle and margin/stop edge cases: - amend_limit_order (OrderIdNotFound vs OrderNoLongerActive boundary, CBOE leaves-qty arithmetic, AmendQtyAlreadyFilled cancellation, post-only crossing) - submit_limit_order rate limiting and post-only rejection - add_market stop capacity accumulation, delisted market stop draining, stop-protection collar rejection, and strictly-reducing checks on both sides - liquidation clearance fee ledger reconciliation.
SummaryThe PR fixes the position-flip pre-trade check in IssuesNone |
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.
No description provided.