# trex-core slot-core daemon configuration (copy to .env; .env is gitignored). # Real OS environment variables take precedence over values in .env. # --- Core (required) --- # psycopg DSN for the PostgreSQL single-writer store. TREX_POSTGRESQL_DSN=dbname=trex_core host=/var/run/postgresql # --- Daemon (optional, defaults shown) --- TREX_TOTAL_SLOTS=10 # Background execution loop tick interval (seconds). TREX_EXECUTION_INTERVAL_SEC=1.0 # --- Broker selection (REQ-011/012/013) --- # 'paper' (deterministic test double, default) | 'kis' (real KIS Open API) TREX_BROKER=paper # --- Paper broker tuning (only when TREX_BROKER=paper; for e2e scenarios) --- # Unset == immediate full fills, no rejects (default production-like behaviour). # TREX_PAPER_FILL_AFTER_POLLS=0 # polls before fills begin (delayed fill) # TREX_PAPER_QTY_PER_POLL= # filled qty per poll (partial fill); empty => fill all at once # TREX_PAPER_REJECT_SYMBOLS= # comma-separated symbols to reject (rollback path) # --- KIS broker (only when TREX_BROKER=kis) --- # 모의투자(sandbox): https://openapivts.koreainvestment.com:29443 # 실계좌(live, 실자금): https://openapi.koreainvestment.com:9443 (requires TREX_KIS_ALLOW_LIVE=true) TREX_KIS_BROKER_BASE_URL=https://openapivts.koreainvestment.com:29443 TREX_KIS_BROKER_TIMEOUT=5 TREX_KIS_BROKER_APP_KEY= TREX_KIS_BROKER_APP_SECRET= TREX_KIS_BROKER_ACCOUNT_REF=12345678-01 # Gate for real-account trading. Leave unset/false to stay on 모의투자. TREX_KIS_ALLOW_LIVE=false # Optional: Redis URL for KIS token cache (restart / multi-process survival, REQ-016). # Unset => in-memory token cache only. TREX_KIS_REDIS_URL= # --- portfolio-hub ledger (REQ-017/018/019, BAT-006) --- # When TREX_PORTFOLIO_HUB_BASE_URL is set, fills are recorded via the HTTP # adapter; otherwise the daemon uses an in-memory ledger (no external writes). TREX_PORTFOLIO_HUB_BASE_URL= TREX_PORTFOLIO_HUB_TOKEN= TREX_PORTFOLIO_HUB_TIMEOUT=5 # Ledger outbox writer tick interval (seconds). TREX_LEDGER_INTERVAL_SEC=1.0 # --- Snapshot scheduler (REQ-030, BAT-008) --- # Daily snapshot refresh time (KST, 24h HH:MM). The scheduler also runs once on # daemon boot regardless of this time. TREX_SNAPSHOT_SCHEDULE_KST=07:30 # Scheduler tick interval (seconds) — how often it checks whether the schedule # time has passed. 60s is plenty for a once-a-day refresh. TREX_SNAPSHOT_TICK_SEC=60 # --- RabbitMQ transport (REQ-022, BAT-007) --- # trex-core ↔ 전략 모듈 통신은 RabbitMQ(AMQP) 메시지 기반 (HTTP /v1 API 는 제거됨). # 미설정이면 데몬은 InMemoryTransport stub 으로 기동(개발/CI 용; 전략과 통신 불가). TREX_RABBITMQ_URL= TREX_RABBITMQ_TIMEOUT=5