Skip to main content

Trade8:Feed - Business Requirements & Functionality

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

1. Business Purpose​

  • Put a single, clean, entitlement-gated market-data stream behind every trader screen: live quotes, depth, prints, and auction imbalance - regardless of vendor wire format.
  • Protect data entitlements with the same authorization plane as orders: a subscriber without depth rights never receives level data.
  • Give traders sub-second price alerts with a simple declarative rule format - and a path for tenants to author richer alert logic.
  • Give trading systems trustworthy anchors: prints that drive chart bars, halt/uptick state for the risk gate, and reference prices for flatten operations.

2. Business Scope (What the Service Provides)​

CapabilityDescription
Vendor adapter frameworkPluggable adapters (ITCH, IDC, crypto WS, FIX-MD, sim) behind one trait
Data normalizationAll vendor packets → four internal event shapes (L1, L2, imbalance, print)
Quote consolidationCross-source BBO merge (best bid/ask, sizes summed at extremes - NBBO-style)
Market-data streamingPer-symbol SSE: snapshot frame + live frames with sequence numbers
Snapshot APIsPoint-in-time L1/L2 reads for app cold start and service callers
Price alertsDeclarative rules (>, <, ≥, ≤ thresholds) evaluated on prints; fired-alert inbox + acknowledge
Feed healthPer-link status (healthy/degraded/dead), silence-based classification, admin wall
Vendor credential custodySecret-reference-only link configuration
Admin workspaceRFW pages: link wall, quote-source catalog, alert queue with ack
Simulation/replayDeterministic recorded sessions for demos, tests, and cutover rehearsal

What the service does NOT own (business boundary)​

ConcernOwned by
Bar aggregation/historyTrade8:Bars
Instrument catalog (symbols)Trade8:Desk
Halt/uptick decisionsTrade8:Risk (consumes feed events)
Complex alert condition authoringSentin8:Func (on_quote modules)
Vendor connectivity credentials storageSentin8 secrets (Feed stores references)
Multicast distributionOut of scope (venue-side concern)

3. Business Capabilities​

AreaCapabilityBusiness rule
IngestMulti-vendor adaptersEach link declares its protocol kind; adapters parse to one raw record shape
IngestSimulated feedsRecorded sessions replay deterministically for demos/tests
NormalizationOne event vocabularyFour event types cover quotes, depth, imbalance, prints - consumers downstream need no vendor knowledge
ConsolidationNBBO-style best quoteBest bid across sources, best ask across sources; sizes summed at the extremes
StreamingSnapshot-then-liveA new subscriber gets the current snapshot first, then live frames with per-topic sequence numbers
StreamingSymbol-scoped deliveryA symbol's stream carries only that symbol's frames
AlertsDeclarative rulesUsers create symbol + comparator + threshold rules; matches fire on prints within sub-seconds
AlertsAcknowledge trailFired alerts persist and stay in an ack queue until acknowledged (who/when recorded)
HealthLink lifecycleSilence classifies links (5s+ degraded, 30s+ dead); transitions emit status events
EntitlementTiered accessL1 vs L2 are separate permissions; subscription-time rejection (no partial data)

4. Business Events (Outbound)​

EventFires when
trade8:feed:quote:updatedA quote packet normalizes (per-source + consolidated state)
trade8:feed:depth:updatedA level update normalizes
trade8:feed:imbalance:updatedAn auction imbalance snapshot normalizes
trade8:feed:trade:printedA consolidated print occurs - Bars's aggregation input
trade8:feed:alert:firedAn alert rule matches
trade8:feed:feed:statusA link's health state changes

Consumed: tenant-authoring trigger on quotes (Sentin8:Func price-alerts module).

5. Business Rules & Invariants​

  1. Every data frame leaving Feed is normalized - vendor formats never leak downstream.
  2. Consolidated quotes dominate per-source quotes: best bid/ask logic is deterministic and test-pinned.
  3. A subscriber receives a snapshot before any live frame.
  4. Alerts fire once per trigger crossing and persist until acknowledged; acks record who and when.
  5. Feed health transitions are evented, not just page-refreshed.
  6. Vendor credentials are stored only as secret references.
  7. Depth data requires its own entitlement - quote access is not implicit depth access.

6. Target-User Roles & Use Cases​

PersonaUse cases
TraderWatch ladder/tape, set price alerts, see NBBO in the ticket
Risk (system)Halt + uptick mirror from prints/quotes
Bars (system)Aggregate prints into chart bars
Desk (system)BBO snapshot for flatten pricing
Trading opsLink wall monitoring; degraded/dead feeds; restart cycles
Compliance/entitlements adminControl L1/L2/depth scope assignment
Tenant power usersAuthor complex alert conditions as Func modules

7. KPIs / Success Criteria​

  • Ingest+fan-out throughput meets the latency budget (harness-pinned; 100k quotes/s design target).
  • Alert latency: a triggering print fires a persisted alert within the ingest budget (sub-second).
  • Zero entitlement leakage (depth frames to non-entitled subscribers).
  • Feed health accuracy: stale links classified within one health interval.
  • Adapter restart storms bounded (backoff cap 30s).
  • Snapshot-first delivery on every stream (cold start correct).

8. Dependencies & Reliance on Other Services​

DependencyWhy the business relies on it
VendorsThe raw market-data streams
Trade8:BarsThe primary print consumer (charts)
Trade8:RiskThe halt/uptick mirror consumer
Trade8:DeskSymbol catalog context (via directory wiring)
Sentin8:FuncTenant-authored alert complexity
Sentin8:BusEvent fan-out to vertical consumers
Sentin8:Auth + ShieldStream/read entitlement decisions
Sentin8:SysAudit delivery
Sentin8:DBLinks/rules/alerts/status persistence (schema feed)

9. Acceptance Criteria​

  1. A trader sees live quotes/tape immediately after opening a workspace (snapshot-then-live).
  2. Depth access is denied cleanly when the entitlement is absent.
  3. A price alert fires within a second of the triggering print and sits in the admin ack queue until handled.
  4. A vendor outage is visible on the health wall (degraded/dead) without operator polling.
  5. Vendor onboarding requires only a new adapter + link row (no engine changes).
  6. Simulated sessions reproduce recorded sequences deterministically.

10. Open Business Questions​

  • Which vendors demand the FIX-MD adapter path first?
  • Should alert rules support sustained-condition windows at launch (window_ms confirm) or remain instant-trigger?
  • Does the business need imbalance data in trader screens at launch (API exists; app surface pending)?
  • Market-data redistribution policies (per-office vs per-trader quotas) - enforced where: Shield attributes vs Feed throttles?

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