Files
foxhunt/services/trading_service
jgrusewski 7d1b0f232f refactor(ml): move core types to ml-core + dedup MLError (5a)
Move all inline type definitions from ml/src/lib.rs to ml-core:
MLError, MLResult, Trade, MarketRegime, HealthStatus, Features,
MLModel trait, ModelRegistry, ParallelExecutor, LatencyOptimizer,
TrainingMetrics, ValidationMetrics, InferenceResult, ModelMetadata.

Dedup: consolidate ConfigError{reason}/ConfigurationError(msg) into
single ConfigError(String) tuple variant (was 2 variants, 174 refs).

Cleanup: convert create_hft_* free functions to associated methods
(HFTPerformanceProfile::ultra_low_latency(), ParallelExecutor::hft()).

ml facade re-exports via `pub use ml_core::*`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 15:13:41 +01:00
..

trading_service

Core execution engine for order placement, position keeping, risk integration, and real-time P&L tracking.

Key Types

  • TradingServiceImpl -- main gRPC service
  • OrderExecutor -- high-throughput order handling
  • PositionManager -- real-time position and P&L tracking
  • RiskIntegration -- pre-trade and post-trade compliance

gRPC Endpoints

  • PlaceOrder -- submit new orders
  • CancelOrder -- cancel existing orders
  • GetPosition -- query current positions
  • SubscribeMarketData -- market data feeds
  • GetPnlUpdates -- real-time P&L updates

Configuration

  • GRPC_PORT -- gRPC listen port
  • DATABASE_URL -- PostgreSQL connection string
  • TLS_ENABLED -- enable TLS 1.3 (default: false)
  • TLS_CERT_PATH, TLS_KEY_PATH, TLS_CA_PATH -- TLS certificates
  • TLS_REQUIRE_CLIENT_CERT -- mutual TLS (default: false)

Testing

SQLX_OFFLINE=true cargo test -p trading_service --lib