feat(alpaca): add permission-gated single-leg options trading - #1470
Draft
luokerenx4 wants to merge 1 commit into
Draft
feat(alpaca): add permission-gated single-leg options trading#1470luokerenx4 wants to merge 1 commit into
luokerenx4 wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Alpaca already exposes option contracts and snapshots, but the adapter rejected every option write and omitted OPT from account capabilities. This connects single-leg orders to the existing UTA staging/approval path, advertises OPT for approved accounts, refreshes venue permissions before entry/amendment, and validates whole contract quantities and supported order fields.
Partial closes now match the OCC native key rather than the underlying symbol and reject quantities exceeding the position. Position reads normalize Alpaca's signed short quantity into UTA's positive quantity plus side convention, avoiding double-signing on downstream recomputation. Multi-leg orders, exercise instructions and option history remain outside this change.
Validation:
Acceptance still pending; keep draft: the paper account reports approved/trading level 3, but the market was closed. Alpaca accepted the hanger and refused its replacement with
42210000: cannot replace order in accepted status; the full reason reached CLI. Successful replacement, fills, partial/full closes and the remaining applicable S1–S14 scenarios need a market-open pass before promotion. No remote production pack was replaced.Order rules checked against https://docs.alpaca.markets/us/docs/options-trading (whole qty, no notional, DAY/GTC, market/limit/stop/stop_limit, no extended hours).