Skip to content

Enforce valid order sizing in manual entry - #763

Draft
luokerenx4 wants to merge 1 commit into
devfrom
codex/order-entry-size-exclusive
Draft

Enforce valid order sizing in manual entry#763
luokerenx4 wants to merge 1 commit into
devfrom
codex/order-entry-size-exclusive

Conversation

@luokerenx4

Copy link
Copy Markdown
Contributor

Summary

  • make Quantity and Cash Qty mutually exclusive in the manual order form
  • clear Quantity when notional sizing is entered, and clear Cash Qty when share/contract sizing becomes authoritative
  • expose Cash Qty only for Market orders and remove it when switching to Limit
  • build the request defensively so it can never carry both sizing fields
  • add component coverage for both sizing directions and the Market-to-Limit transition

Root cause

The form claimed Cash Qty would override Quantity, but retained both values and sent both fields. UTA explicitly rejects totalQuantity + cashQty as mutually exclusive. The form also allowed a Limit order to use Cash Qty even though UTA supports notional sizing only for Market orders.

Verification

  • pnpm vitest run ui/src/components/uta/OrderEntryDialog.spec.tsx
  • npx tsc --noEmit
  • cd ui && npx tsc -b
  • pnpm test (358 passed, 1 skipped; 3391 tests passed, 9 skipped)
  • git diff --check
  • Demo browser walkthrough on Alpaca Paper: reproduced Quantity 1 + Cash Qty 100 with submit enabled before the fix; after the fix, entering Cash Qty clears Quantity, and switching to Limit removes Cash Qty and disables submit until valid Limit sizing is supplied

Boundary touch

  • trading UI validation only; no UTA, broker adapter, account state, or order execution code changed
  • live-paper execution was not required because the change prevents a request that UTA already rejects before any broker write

@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openalice-demo Ready Ready Preview, Comment Jul 28, 2026 10:02pm

Request Review

@luokerenx4 luokerenx4 added area:trading UTA, orders, positions, portfolio, or trading review review:deep Requires deliberate human review before merge theme:safety Correctness, validation, destructive-action, or trading safety workflow:parallel Autonomous parallel contribution; leave open for later acceptance labels Jul 29, 2026 — with ChatGPT Codex Connector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:trading UTA, orders, positions, portfolio, or trading review review:deep Requires deliberate human review before merge theme:safety Correctness, validation, destructive-action, or trading safety workflow:parallel Autonomous parallel contribution; leave open for later acceptance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant