From 2c5f99aedb348d477e3ffe19edc97b80eb98ad32 Mon Sep 17 00:00:00 2001 From: jgrusewski Date: Wed, 4 Mar 2026 02:10:00 +0100 Subject: [PATCH] feat(proto): add 9 streaming RPCs for TUI live data New poll-to-stream RPCs (gateway adapters): - broker_gateway: StreamAccountState, StreamSessionStatus - risk: StreamCircuitBreakerStatus, StreamRiskMetrics - data_acquisition: StreamDownloadStatus - ml: StreamModelStatus - trading_agent: StreamAgentStatus - trading: StreamPortfolioSummary, StreamOrderBook Co-Authored-By: Claude Opus 4.6 --- proto/broker_gateway.proto | 16 ++++++++++++++++ proto/data_acquisition.proto | 9 +++++++++ proto/ml.proto | 10 ++++++++++ proto/risk.proto | 18 ++++++++++++++++++ proto/trading.proto | 19 +++++++++++++++++++ proto/trading_agent.proto | 9 +++++++++ 6 files changed, 81 insertions(+) diff --git a/proto/broker_gateway.proto b/proto/broker_gateway.proto index 5677dfa76..f00838838 100644 --- a/proto/broker_gateway.proto +++ b/proto/broker_gateway.proto @@ -32,6 +32,12 @@ service BrokerGatewayService { // Health check rpc HealthCheck(HealthCheckRequest) returns (HealthCheckResponse); + + // Server-streaming: polls GetAccountState at gateway level + rpc StreamAccountState(StreamAccountStateRequest) returns (stream GetAccountStateResponse); + + // Server-streaming: polls GetSessionStatus at gateway level + rpc StreamSessionStatus(StreamSessionStatusRequest) returns (stream GetSessionStatusResponse); } // ============================================================================ @@ -203,6 +209,16 @@ enum ExecutionType { EXECUTION_TYPE_REJECTED = 4; // Order rejected } +// Streaming request messages + +message StreamAccountStateRequest { + uint32 interval_seconds = 1; // 0 = server default (3s) +} + +message StreamSessionStatusRequest { + uint32 interval_seconds = 1; // 0 = server default (5s) +} + enum SessionState { SESSION_STATE_DISCONNECTED = 0; SESSION_STATE_CONNECTED = 1; diff --git a/proto/data_acquisition.proto b/proto/data_acquisition.proto index 67b484d96..cdc0969b4 100644 --- a/proto/data_acquisition.proto +++ b/proto/data_acquisition.proto @@ -21,6 +21,15 @@ service DataAcquisitionService { // Service Health and Status // Check service health and resource availability rpc HealthCheck(HealthCheckRequest) returns (HealthCheckResponse); + + // Server-streaming: polls ListDownloadJobs at gateway level + rpc StreamDownloadStatus(StreamDownloadStatusRequest) returns (stream ListDownloadJobsResponse); +} + +// Streaming request messages + +message StreamDownloadStatusRequest { + uint32 interval_seconds = 1; // 0 = server default (5s) } // --- Core Request/Response Messages --- diff --git a/proto/ml.proto b/proto/ml.proto index 830bc07fa..562493aaf 100644 --- a/proto/ml.proto +++ b/proto/ml.proto @@ -39,6 +39,16 @@ service MLService { // Stream real-time signal strength indicators across models rpc StreamSignalStrength(StreamSignalStrengthRequest) returns (stream SignalStrengthEvent); + + // Server-streaming: polls GetModelStatus at gateway level + rpc StreamModelStatus(StreamModelStatusRequest) returns (stream GetModelStatusResponse); +} + +// Streaming request messages + +message StreamModelStatusRequest { + string model_name = 1; // empty = all models + uint32 interval_seconds = 2; // 0 = server default (5s) } // Prediction Messages diff --git a/proto/risk.proto b/proto/risk.proto index f5a7cc14d..f6d26b121 100644 --- a/proto/risk.proto +++ b/proto/risk.proto @@ -33,6 +33,24 @@ service RiskService { // Get status of all circuit breakers and safety mechanisms rpc GetCircuitBreakerStatus(GetCircuitBreakerStatusRequest) returns (GetCircuitBreakerStatusResponse); + + // Server-streaming: polls GetCircuitBreakerStatus at gateway level + rpc StreamCircuitBreakerStatus(StreamCircuitBreakerStatusRequest) returns (stream GetCircuitBreakerStatusResponse); + + // Server-streaming: polls GetRiskMetrics at gateway level + rpc StreamRiskMetrics(StreamRiskMetricsRequest) returns (stream GetRiskMetricsResponse); +} + +// Streaming request messages + +message StreamCircuitBreakerStatusRequest { + optional string symbol = 1; // Filter by symbol (all if not specified) + uint32 interval_seconds = 2; // 0 = server default (2s) +} + +message StreamRiskMetricsRequest { + optional string portfolio_id = 1; // Portfolio identifier (default if not specified) + uint32 interval_seconds = 2; // 0 = server default (3s) } // VaR (Value at Risk) Messages diff --git a/proto/trading.proto b/proto/trading.proto index 53bafc934..965f0474d 100644 --- a/proto/trading.proto +++ b/proto/trading.proto @@ -59,6 +59,25 @@ service TradingService { // Get regime transition history for a symbol rpc GetRegimeTransitions(GetRegimeTransitionsRequest) returns (GetRegimeTransitionsResponse); + + // Server-streaming: polls GetPortfolioSummary at gateway level + rpc StreamPortfolioSummary(StreamPortfolioSummaryRequest) returns (stream GetPortfolioSummaryResponse); + + // Server-streaming: polls GetOrderBook at gateway level + rpc StreamOrderBook(StreamOrderBookRequest) returns (stream GetOrderBookResponse); +} + +// Streaming request messages + +message StreamPortfolioSummaryRequest { + string account_id = 1; // Account ID for portfolio summary + uint32 interval_seconds = 2; // 0 = server default (3s) +} + +message StreamOrderBookRequest { + string symbol = 1; + int32 depth = 2; + uint32 interval_seconds = 3; // 0 = server default (1s) } // Order Management Messages diff --git a/proto/trading_agent.proto b/proto/trading_agent.proto index c51737cc2..62da5467d 100644 --- a/proto/trading_agent.proto +++ b/proto/trading_agent.proto @@ -61,6 +61,15 @@ service TradingAgentService { // Service Health rpc HealthCheck(HealthCheckRequest) returns (HealthCheckResponse); + + // Server-streaming: polls GetAgentStatus at gateway level + rpc StreamAgentStatus(StreamAgentStatusRequest) returns (stream GetAgentStatusResponse); +} + +// Streaming request messages + +message StreamAgentStatusRequest { + uint32 interval_seconds = 1; // 0 = server default (3s) } // Universe Selection Messages