Skip to main content

Trade8:Desk - Business Requirements & Functionality

Audience: product owners, business analysts, and anyone evaluating what Trade8:Desk does for the business. For architecture read README.md; for wire-level detail read DESIGN.md.

1. Business Purpose​

  • Give professional traders one place to enter, manage, cancel, replace, and flatten orders across all supported venues and brokers, with sub-second acceptance and a complete, regulator-audit trail.
  • Provide the trading desk's operational backbone: instrument catalogs, broker/destination routing catalogs, trading calendars, market session control, and the short-sale locate pool.
  • Guarantee that no order is accepted without a pre-trade authorization (desk-owned risk is delegated to Trade8:Risk, called synchronously).
  • Give compliance an immutable record of every order action, including who acted, when, and on whose behalf (keystroke + audit journaling).

2. Business Scope (What the Service Provides)​

CapabilityDescription
Order intakeNew orders (limit/market/stop classes) with idempotent client order ids; per-item basket submission
Order managementCancel, cancel-replace (chained order ids), one-click flatten with typed strategy parameters
Working-order stateLive order/state tracking per session with an append-only transition ledger
Pre-trade gate integrationSynchronous authorization against Trade8:Risk; fail-closed when the gate is unavailable
Session controlMarket session lifecycle (preopen → open → close-pending → closed) driven by scheduler callbacks or admin action
Overnight processingPark overnight-GTC orders at close; restore them at preopen
Instrument catalogsMarkets, symbols (incl. futures), tick rules, trading calendars, market periods, fees, reject codes
Routing catalogsDestinations, gateways, broker/office routing triples, outbound message templates
Short-sale locate poolPer-symbol availability, office-level borrow caps, ETB/HTB classification, short-exempt management
Audit & keystroke trailWho acted on which order, when, from which surface, including strategy-proxy actions
Admin workspaceRFW admin pages: overview, orders, symbols, markets, destinations, offices, borrow, session
Event publicationOutbox-first events for other desk systems (Router routes on acceptance; PnL/Risk track state)
Two-way trader channelWS order entry with the same authorization and audit trail as REST
Strategy host surfaceProxy-back API for Sentin8:Func strategy modules acting on behalf of a trader

What the service does NOT own (business boundary)​

ConcernOwned by
Pre-trade risk limits & authorization mathTrade8:Risk
Broker connectivity, FIX/OUCH sessions, execution reports, fee applicationTrade8:Router
Market data distribution and alertsTrade8:Feed
Historical bars and EOD reportsTrade8:Bars
Positions, day P&L, office roll-upsTrade8:Pnl
Scheduling (session times, journal purge, EOD)Sentin8:Cron
Strategy module executionSentin8:Func
Identity, sign-in, role/permission administrationSentin8:Auth + Shield

3. Business Capabilities​

AreaCapabilityBusiness rule
IntakeStructural validationSymbol must exist and be feed-active; price/qty must respect tick bands and instrument scales; destination must be valid for the symbol's market
IntakeIdempotent submissionResubmitting the same client order id returns the existing order and never duplicates it
IntakeBasket submissionEach basket item is risk-checked and persisted independently (per-item all-or-none, not across items)
AuthorizationRisk-gated acceptanceAn order only leaves Pending with an allow verdict from Trade8:Risk; a deny is journaled with the full trace
AuthorizationFail-closedIf Risk is unreachable, the order is rejected, never accepted without authorization
LifecycleCancelAny non-terminal order can be cancelled by its owner or by a manager with cancel permission; the reason is journaled
LifecycleCancel-replaceReplaces create a new order id linked to the chain root; the replaced order becomes terminal
LifecycleLocate managementShort-selling needs pool availability (respecting office blocks); accepted shorts decrement the pool; cancels/rejects restore it
LifecycleShort-exemptSymbols on the exempt list bypass locate for qualifying orders (Risk enforces)
SessionSession gatingOrders are accepted only when the session state allows; opening/closing are controlled actions, fully journaled
SessionClose sweepAt close, day-remaining orders are cancelled and overnight orders parked with their carried details
SessionPreopen restoreParked overnight orders return to Pending state for the trader to action
FlattenStrategy-driven exitFlatten takes typed strategy parameters (attempt count, hold time, price mode, visibility) and delegates the attempt ladder to the configured strategy module
CatalogsReference dataTraders/destinations/symbols come from admin-managed catalogs, not from order entry
AuditKeystroke journalEvery order-affecting action from any surface lands in the audit trail with actor and on-behalf-of attribution

4. Business Events (Outbound)​

EventFires when
trade8:desk:order:submittedA structurally valid order is parked for authorization
trade8:desk:order:acceptedRisk allows and the order is persisted
trade8:desk:order:rejectedDeny (risk or structural) - includes the reject code and trace
trade8:desk:order:cancelledUser/manager/session/close/risk cancellation
trade8:desk:order:replacedA cancel-replace chains a new order
trade8:desk:order:flattenA flatten instruction is requested (strategy trigger)
trade8:desk:order:overnight · :restoredOvernight parking / preopen restore
trade8:desk:session:stateSession transitions (preopen/open/close-pending/closed)
trade8:desk:borrow:updatedLocate pool mutation (reserve/release/admin adjustment)
trade8:desk:keystroke:loggedA keystroke-audit action is recorded

Consumed (business view): fills and session status come back through Trade8:Router's events; quote snapshots for flatten pricing come from Trade8:Feed. Inbound events (trade8:router:fill:executed, trade8:feed:trade:printed, …) update working state, but the order-of-record state stays in Desk.

5. Business Rules & Invariants​

  1. No order is ever accepted without a synchronous allow verdict from Trade8:Risk.
  2. Every order-state change is journaled with actor and reason; the ledger is immutable and complete for the trading day.
  3. Resubmitted client order ids are idempotent - one order per client order id.
  4. Short sells reserve locate availability before acceptance and release it on terminal states - availability never goes negative.
  5. Close parks overnight orders and cancels day remnants; preopen restores parked orders exactly as parked.
  6. The blotter shows only orders the trader is entitled to see (own / office / environment by role).
  7. All catalog changes, session actions, and borrow adjustments are admin permission-gated and audited.
  8. Strategy modules act only through the proxy-back interface and are always attributed (never appear as the trader).

6. Target-User Roles & Use Cases​

PersonaUse cases
TraderEnter/cancel/replace orders, watch the working blotter, flatten positions, park/restore overnight orders, manage personal shortcuts
Office/branch managerMonitor the office blotter, flatten an office's positions, control borrowing blocks for the office
Trading desk supervisorOpen/close the session, manage the locate pool (ETB/HTB, exempt list), handle rejects
Back office / catalog adminMaintain symbols, markets, destinations, fees, reject codes
ComplianceReview the keystroke/audit trail for any order action
Automations (strategies)Flattening and basket modules submitting/cancelling on a trader's behalf through the host interface

7. KPIs / Success Criteria​

  • Order acceptance path completes (validate + authorize + persist + reply) within the session's latency budget; submit/cancel P50 tracked by the latency harness and must remain well below the trader-perceived threshold.
  • Zero un-authorized accepts (fail-closed proof in tests).
  • 100% of transitions journaled; audit journal delivery to the platform is retried until pushed (no lost audit).
  • Locate availability never negative; cancels always restore reserved shares.
  • Overnight park/restore round-trips exactly (no lost or duplicated orders).
  • Blotter queries remain scope-correct under role changes (RLS-verified).

8. Dependencies & Reliance on Other Services​

DependencyWhy the business relies on it
Trade8:RiskThe authorization verdict is the gate for every acceptance
Trade8:RouterTurns accepted orders into broker traffic and reports fills back
Trade8:FeedBBO snapshot for close-only/flatten pricing; triggers strategies
Trade8:PnlPosition context for flatten planning (via its own service)
Sentin8:CronSession opening/closing and scheduled sweeps
Sentin8:FuncRuns the flattening/basket strategy modules
Sentin8:Auth + ShieldIdentity, live role grants, and the authorization decision
Sentin8:BusDelivery of desk events to Router/Risk/PnL (outbox-first)
Sentin8:SysAudit ingest and service administration
Sentin8:DBDurable persistence (schema desk, db trade8)

9. Acceptance Criteria​

  1. A trader can submit, see, cancel, and replace orders end-to-end through the app with every step authorized and journaled.
  2. A denied order is visible in the blotter with its reject reason and trace.
  3. Session close parks overnight orders; next preopen restores them intact.
  4. The locate pool reflects accepts/cancels/adjustments within the same transaction that changed the order.
  5. Admins manage catalogs, offices, borrow lists, and session state through the admin workspace without engineering involvement.
  6. Compliance can reconstruct any order's full history (who/what/when/why).
  7. Basket submission reports per-item outcomes and never blocks on one item's failure.

10. Open Business Questions​

  • Should basket submission support an async "request then progress" mode for very large baskets (the declared trade8:desk:order:batch-requested trigger is unused today)?
  • Does the business need per-reservation borrow events for downstream systems, or is the summary event sufficient?
  • Office-manager cross-environment flatten (supervising multiple desks) - product decision pending.
  • Catalog replication across offices/environments: one owner catalog per environment vs a centrally-owned, event-replicated catalog.

Architecture & Design: trade8:desk and its underlying concepts were designed by Hamid Jahanzad.