feat: add Activity API trade processing with cross-source dedup#64
Merged
feat: add Activity API trade processing with cross-source dedup#64
Conversation
- Stop filtering trades from Activity API (v3) results - Add trade rules (buy/sell/fallback) to transaction rules engine - Add cross-source dedup: prefer Orders API data, keep Activity API trades for history - Add Symbol/Quantity/Price fields to Activity API query - Add formatTradeNotes() for Activity API trade formatting - Bump version to 6.11.0
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.
Details
The Questrade Orders API (v1) only returns recent orders and cannot be relied on for historic sync. Previously, trades were filtered out of Activity API results to avoid duplicates with the Orders API. This change instead keeps all Activity API trades and deduplicates them against Orders API data using composite signature keys (symbol:date:action), preferring Orders API data when available and falling back to Activity API data for historic trades.
New transaction rules
trades-buy: Activity API buy tradestrades-sell: Activity API sell tradestrades-fallback: Activity API trades with unknown actionTrade note formatting
Activity API trades include: description, filled qty @ price, commission, total amount, and settlement date.