Files
foxhunt/services/trading_service
jgrusewski 04d8802c94 refactor: remove 8 always-on use_ booleans — features are mandatory
Remove use_double_dqn, use_dueling, use_per, use_branching,
use_distributional, use_noisy_nets, use_huber_loss, and use_cql
from DQNConfig, DQNHyperparameters, and DqnParams structs.

These features are always enabled (Rainbow DQN standard). The boolean
flags were dead code — every constructor set them to true, and the
only code paths that set them to false were in tests that disabled
features for simplicity. With the fields removed, the features are
unconditionally active, eliminating ~490 lines of dead configuration.

Key changes:
- Struct field declarations removed from 3 core config structs
- Conditional branches (if use_X { ... } else { ... }) simplified:
  dueling/branching/PER network creation is now unconditional
- Checkpoint metadata hardcodes "true" for backward compatibility
- Hyperopt search space index 11 (use_branching) fixed at 1.0
- TOML/YAML config files cleaned of removed fields
- Tests that toggled these flags updated or rewritten

45 files changed, -487 net lines. Zero new test failures.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 09:45:54 +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