Files
trex-core/.env.example
T
genichinandClaude Opus 4.8 13837acc60 Implement BAT-006: portfolio-hub ledger integration (REQ-017~019)
- REQ-017: LedgerPort contract (application/ledger_port.py) + portfolio-hub
  adapter + in-memory stub (adapters/ledger/), TREX_PORTFOLIO_HUB_* config
- REQ-018: fill→ledger recording in execution loop; FillStatus carries
  execution_id (deterministic synth) + fee; paper/kis adapters updated
- REQ-019: ledger outbox + retry worker (application/ledger_outbox.py),
  correlation_id idempotency, outcome vocabulary; 002_create_ledger_outbox.sql
- Tests: in-memory/portfolio-hub ledger, execution ledger hook, outbox,
  domain import sweep

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 22:57:31 +09:00

41 lines
1.6 KiB
Bash

# 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
TREX_API_HOST=127.0.0.1
TREX_API_PORT=8080
# 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
# --- 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