UTA detail page becomes an exchange frontend#330
Merged
Conversation
The page now answers the two questions an exchange frontend exists to answer — "what state is my account in" and "what happened to my orders" — instead of leaking implementation internals: - Order History / Trades tabs: domain-level projections of the git log (services/uta order-history.ts, types in uta-protocol) collapse each order's lifecycle to one row — side/qty/limit/fill/status, External chip for orders observed rather than placed, expandable to commit hash + message. Trades show fills only, with reconcile foldings labeled instead of disguised. Projection lives in the domain so MCP and CLI surfaces can reuse it. - Contract rendering follows the IBKR superset from day one: shared ContractCell formats OPT (strike/right/expiry/×multiplier), FUT (expiry), CRYPTO (venue symbol + PERP) — options arrive without a display retrofit. PortfolioPage reuses the same formatter. - Market-clock chip in the header: Market Open/Closed with countdown for session venues, 24/7 for crypto — the context that was invisible while we waited for US market hours all week. - SNAPSHOTS raw timeline removed — snapshot scheduling is curve fuel, not a user concept. Equity curve axes fixed: explicit Y ticks with range-aware precision (no more "$100.7K $100.7K $100.6K"), X ticks aligned to round time boundaries. Demo fixtures cover the new endpoints, including an AAPL 300C option order on the IBKR demo account so the superset rendering is visible. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…gned header actions Layout: the detail page drops the single-column stack for a workspace grid — curve/positions/orders own a wide main column, the Account panel rides a sticky 320px sidebar (summary-first on narrow screens). Account panel replaces the four-evenly-spread hero metrics, which both omitted the obvious (Positions Value — netLiq and cash were shown but never what's actually held) and fabricated the missing (Realized P&L rendered "+$0.00" for Alpaca, whose API doesn't report the field). New rows: Cash, Positions Value (Σ position marketValue), Utilization (deployed % with a subtle bar), Unrealized P&L (with % vs cost basis), then strictly capability-gated rows — Realized P&L / Buying Power / Margin Used / Day Trades Left render ONLY when the broker reports them. The AccountInfo contract is the IBKR superset; a broker that doesn't fill a field gets the row omitted, never a zero. "today" delta relabeled "24h" (that's what it is — a snapshot diff). Header action row de-drunked: ReconnectButton had a baked-in mt-3 from its dialog origin (the misalignment), three buttons used three hand-rolled size/style combos, and the green toggle collided with the health-badge color language. Now: one row, shared btn classes at one size, single filled-accent primary (Place Order), toggle in accent behind a divider. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
External/Reconcilelabeling; rows expand to commit hash + message). Projection is domain-level (order-history.ts+ uta-protocol types) so MCP/CLI reuse it. Verified against live OKX demo history: external orders, cancels, sync fills and the fee-dust reconcile all render correctly.ContractCellhandles OPT (strike/right/expiry/×multiplier), FUT, CRYPTO/PERP from day one, per the "design the display abstraction for the big interface before options arrive" direction. PortfolioPage unified onto the same formatter; demo includes an AAPL 300C order to keep the path visibly exercised.Test plan
pnpm test1885 passing (new: order/trade projection specs incl. option-field preservation, external lifecycle, reconcile labeling, double-count guard)Boundary touch
New read-only trading routes (order-history / trade-history); no order-path changes.
🤖 Generated with Claude Code