Files
foxhunt/services/broker_gateway_service/README.md
jgrusewski e2a0576ef5 docs: create/update README.md for all services, CLI, and testing crates
Create 3 missing service READMEs (api_gateway, data_acquisition_service,
trading_agent_service). Create bin/fxt/README.md. Create
testing/service-integration/README.md. Update existing service and testing
READMEs to standard template. Delete 4 subdirectory READMEs from
testing/integration/ and testing/e2e/.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 22:50:38 +01:00

1.2 KiB

broker_gateway_service

Broker communication gateway with FIX 4.2/4.4 protocol, order routing, execution management, and position reconciliation via CQG.

Status: MVP (database persistence only, FIX protocol deferred to Phase 2)

Key Types

  • BrokerGatewayService -- main gRPC service (7 methods)
  • SequenceManager -- FIX MsgSeqNum tracking
  • OrderStateMachine -- order lifecycle state transitions
  • PositionReconciler -- 3-way sync (CQG, database, trading service)
  • CircuitBreaker -- broker connection protection

gRPC Endpoints

  • RouteOrder -- submit order to broker
  • CancelOrder -- cancel existing order
  • GetOrderStatus -- query order state
  • GetPositions -- current account positions
  • StreamExecutions -- real-time execution reports

Configuration

  • GRPC_PORT (50056) -- gRPC listen port
  • HEALTH_PORT (8086) -- HTTP health check
  • METRICS_PORT (9096) -- Prometheus metrics
  • DATABASE_URL -- PostgreSQL (broker_orders, broker_executions tables)
  • REDIS_URL -- session state and sequence numbers
  • FIX_* -- FIX session parameters (Phase 2)

Testing

SQLX_OFFLINE=true cargo test -p broker_gateway_service --lib