fix: sqlite decimal precision + portfolio sync bug fixes#424
Merged
Conversation
8ba5269 to
2a3e9b4
Compare
- Replace Float columns with SqliteDecimal (TEXT-backed) across all models for correct precision with large exchange numbers - Fix slippage: execute_order now copies actual execution price from exchange - Fix BUY cancel/expire/reject/fail: restore EUR size (not asset units) to trading symbol position - Fix check_pending_orders crash when exchange returns None for an order - Fix missing buy order amount-change reconciliation during sync - Deduplicate cancel/expire/reject/fail into shared helpers - Add order_price to OrderExecutorTest stub, return_none_for_order to PortfolioProviderTest stub - Add 21 tests: numeric precision, startup sync, and all 5 sync fixes - Replace deprecated window_size with warmup_window in test_eventloop
2a3e9b4 to
ddd5b5e
Compare
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.
Summary
SQLite Decimal Precision
Floatcolumns withSqliteDecimal(TEXT-backed TypeDecorator) across all 8 model files for correct precision with large exchange numbers (e.g. BTC prices)Portfolio Sync Bug Fixes
execute_order()now copies actual execution price from the exchange responsecheck_pending_orders: No longer crashes when exchange returnsNonefor an order lookup_restore_buy_order_balance()and_restore_sell_order_position()shared helpers from 8 nearly-identical methodsTest & Stub Updates
order_pricetoOrderExecutorTeststub for slippage testingreturn_none_for_orderflag toPortfolioProviderTeststubwindow_sizewithwarmup_windowintest_eventloop.pyAll tests pass