Skip to content

Apply small-account whole-share compatibility#71

Merged
Pigbibi merged 1 commit into
mainfrom
small-account-whole-share-compat
May 23, 2026
Merged

Apply small-account whole-share compatibility#71
Pigbibi merged 1 commit into
mainfrom
small-account-whole-share-compat

Conversation

@Pigbibi

@Pigbibi Pigbibi commented May 23, 2026

Copy link
Copy Markdown
Collaborator

Applies the small-account whole-share compatibility layer in LongBridge value-target execution after safe-haven cash substitution. This lets small accounts sell unbuyable oversized sleeves, such as a single SOXX share whose 20% target cannot buy one share, then redeploy into buyable risk targets.

Validation:

  • python -m pytest tests/test_rebalance_service.py -q -k 'small_account_whole_share_layer or safe_haven_target_below_cash_substitute_threshold_stays_cash'
  • python -m py_compile application/execution_service.py

@Pigbibi Pigbibi force-pushed the small-account-whole-share-compat branch from 9aa09c8 to 5240979 Compare May 23, 2026 02:38
@Pigbibi Pigbibi merged commit 28430a2 into main May 23, 2026
1 check passed
@Pigbibi Pigbibi deleted the small-account-whole-share-compat branch May 23, 2026 02:40

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5240979a64

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +274 to +276
safe_haven_symbols = set(allocation.get("safe_haven_symbols", ()))
candidate_symbols = tuple(
symbol for symbol in target_values if symbol not in safe_haven_symbols

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Normalize safe-haven symbols before candidate filtering

When risk_symbols/income_symbols are empty, this branch compares targets keys to safe_haven_symbols without case normalization, so mixed-case plans (for example targets using "BOXX" and safe_haven_symbols containing "boxx") will incorrectly treat safe-haven assets as substitution candidates. In that case, the new small-account projection can zero a safe-haven target below 1 share price, which skips intended cash-substitute buys and leaves cash idle for pure safe-haven allocations.

Useful? React with 👍 / 👎.

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