Skip to content

UTA detail page becomes an exchange frontend#330

Merged
luokerenx4 merged 3 commits into
masterfrom
UTA-issue
Jun 12, 2026
Merged

UTA detail page becomes an exchange frontend#330
luokerenx4 merged 3 commits into
masterfrom
UTA-issue

Conversation

@luokerenx4

Copy link
Copy Markdown
Contributor

Summary

  • Order History / Trades tabs — exchange-standard projections of the Trading-as-Git log (one row per order lifecycle; fills-only trade list with External/Reconcile labeling; 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.
  • IBKR-superset contract rendering — shared ContractCell handles 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.
  • Market-clock chip — Open/Closed + countdown for session venues, 24/7 for crypto.
  • De-internaled the page — raw SNAPSHOTS timeline removed (curve fuel, not a user concept); equity curve Y-axis duplicate-tick bug fixed (range-aware precision), X-axis on round time boundaries.

Test plan

  • root + ui typecheck clean; uta-protocol typecheck clean
  • pnpm test 1885 passing (new: order/trade projection specs incl. option-field preservation, external lifecycle, reconcile labeling, double-count guard)
  • Live endpoints verified against the OKX demo account's real order history
  • Visual walk of the page (Vite HMR has it live)

Boundary touch

New read-only trading routes (order-history / trade-history); no order-path changes.

🤖 Generated with Claude Code

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>
@vercel

vercel Bot commented Jun 11, 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 Jun 12, 2026 12:08am

Request Review

…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>
@luokerenx4 luokerenx4 merged commit dfc5993 into master Jun 12, 2026
4 of 5 checks passed
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