Files
foxhunt/services/broker_gateway_service/k8s/configmap.yaml
jgrusewski 00ef9e2866 Wave 15: Complete FactoredAction migration to 45-action system
Major Changes:
- Migrated from 3-action TradingAction to 45-action FactoredAction
- 45 actions: 5 exposure × 3 order types × 3 urgency levels
- Absolute exposure model (target positions -1.0 to +1.0)
- Transaction cost differentiation (Market 0.15%, LimitMaker 0.05%, IoC 0.10%)
- Fixed action diversity threshold (1.11% → 0.5% for 45-action space)

Bug Fixes:
- Bug #15: Incomplete FactoredAction integration (code existed but unused)
- Bug #16: Runtime crash in action diversity checking (hardcoded 3-action match)

Code Changes (13 files, ~464 lines):
- ml/src/dqn/action_space.rs: Core FactoredAction + 4 helper methods
- ml/src/trainers/dqn.rs: Action diversity refactored (3→45 dynamic)
- ml/src/dqn/reward.rs: calculate_reward() signature updated
- ml/src/dqn/portfolio_tracker.rs: execute_action() absolute exposure
- ml/src/dqn/dqn.rs: WorkingDQN action selection migrated
- ml/tests/*.rs: 9 test files updated with FactoredAction assertions

Test Results:
- 1-epoch smoke test: 100% action diversity (45/45 actions, 80.2s)
- 10-epoch production: 87.8% readiness (79/90 scorecard, 14.0 min)
- Loss convergence: 96.9% reduction (119K → 3.6K)
- Action diversity: 100% → 44% (healthy specialization)
- Checkpoint reliability: 12/12 files saved (100%)
- DQN tests: 195/195 passing (100%)
- ML baseline: 1,514/1,515 passing (99.93%)

Production Status:  CERTIFIED (87.8% readiness)
Go/No-Go:  GO FOR 100-EPOCH PRODUCTION TRAINING

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-11 23:27:02 +01:00

122 lines
4.1 KiB
YAML

apiVersion: v1
kind: ConfigMap
metadata:
name: broker-gateway-config
namespace: foxhunt
labels:
app: broker-gateway-service
component: broker
tier: backend
data:
# ============================================================================
# Service Configuration
# ============================================================================
GRPC_PORT: "50056"
HEALTH_PORT: "8086"
METRICS_PORT: "9096"
# ============================================================================
# Database Configuration
# ============================================================================
DATABASE_URL: "postgresql://foxhunt:foxhunt_password@postgres-service:5432/foxhunt"
DATABASE_POOL_SIZE: "20"
DATABASE_TIMEOUT_SECONDS: "30"
DATABASE_MAX_CONNECTIONS: "50"
DATABASE_MIN_CONNECTIONS: "5"
DATABASE_IDLE_TIMEOUT: "600"
DATABASE_MAX_LIFETIME: "1800"
# ============================================================================
# Redis Configuration
# ============================================================================
REDIS_URL: "redis://redis-service:6379"
REDIS_POOL_SIZE: "10"
REDIS_TIMEOUT_SECONDS: "5"
REDIS_MAX_CONNECTIONS: "20"
REDIS_MIN_IDLE: "5"
REDIS_CONNECTION_TIMEOUT: "5"
# ============================================================================
# Broker Configuration (CQG via AMP Futures)
# ============================================================================
CQG_HOST: "fix.amp.cqg.com"
CQG_PORT: "6100"
CQG_TARGET_COMP_ID: "AMPFUTURES"
CQG_HEARTBEAT_INTERVAL: "30"
CQG_RECONNECT_INTERVAL: "60"
CQG_MAX_RECONNECT_ATTEMPTS: "5"
# ============================================================================
# FIX Protocol Configuration
# ============================================================================
FIX_VERSION: "FIX.4.4"
FIX_LOG_DIR: "/app/logs/fix"
FIX_SESSION_TIMEOUT: "60"
FIX_LOGON_TIMEOUT: "30"
FIX_LOGOUT_TIMEOUT: "10"
FIX_RESET_ON_LOGON: "Y"
FIX_RESET_ON_LOGOUT: "Y"
FIX_RESET_ON_DISCONNECT: "Y"
FIX_PERSIST_MESSAGES: "Y"
FIX_VALIDATE_FIELDS_OUT_OF_ORDER: "Y"
FIX_VALIDATE_FIELDS_HAVE_VALUES: "Y"
FIX_VALIDATE_USER_DEFINED_FIELDS: "N"
FIX_CHECK_LATENCY: "Y"
FIX_MAX_LATENCY: "2" # 2 seconds
# ============================================================================
# Observability Configuration
# ============================================================================
RUST_LOG: "info,broker_gateway_service=debug,sqlx=warn,tonic=info"
RUST_BACKTRACE: "1"
LOG_FORMAT: "json"
LOG_LEVEL: "info"
# Metrics configuration
METRICS_ENABLED: "true"
METRICS_PATH: "/metrics"
METRICS_NAMESPACE: "foxhunt"
METRICS_SUBSYSTEM: "broker_gateway"
# Tracing configuration
TRACING_ENABLED: "true"
TRACING_ENDPOINT: "http://jaeger-collector:14268/api/traces"
TRACING_SAMPLE_RATE: "0.1"
# ============================================================================
# Feature Flags
# ============================================================================
ENABLE_FIX_PROTOCOL: "false" # MVP mode: disabled
MVP_MODE: "true"
ENABLE_ORDER_VALIDATION: "true"
ENABLE_POSITION_TRACKING: "true"
ENABLE_METRICS: "true"
ENABLE_HEALTH_CHECK: "true"
# ============================================================================
# Performance Tuning
# ============================================================================
# gRPC configuration
GRPC_MAX_CONCURRENT_STREAMS: "1000"
GRPC_KEEPALIVE_TIME: "60"
GRPC_KEEPALIVE_TIMEOUT: "20"
GRPC_KEEPALIVE_PERMIT_WITHOUT_CALLS: "true"
GRPC_HTTP2_ADAPTIVE_WINDOW: "true"
GRPC_HTTP2_MAX_FRAME_SIZE: "16384"
# Worker threads
TOKIO_WORKER_THREADS: "4"
TOKIO_MAX_BLOCKING_THREADS: "512"
# Connection pooling
CONNECTION_POOL_SIZE: "20"
CONNECTION_TIMEOUT: "30"
# ============================================================================
# Security Configuration
# ============================================================================
ENABLE_TLS: "false" # Development mode
TLS_CERT_PATH: "/app/certs/tls.crt"
TLS_KEY_PATH: "/app/certs/tls.key"
TLS_CA_PATH: "/app/certs/ca.crt"