9351dec226
Security: - Move hardcoded Binance API key/secret from rest.ts to env.yaml (exchange config segment) - Add ExchangeConfig validation in config/validators.ts - Export typed exchange config from config/index.ts - Update AGENTS/07-caveats.md to reflect the new policy Kline intervals (add 3m / 2h / 6h / 8h / 1mon): - TypeScript: update KlineInterval type, KLINE_INTERVAL_MS mapping, build_aggregates_sql refresh chain - Python: sync KlineInterval Literal type, INTERVAL_TO_TABLE and INTERVAL_MS mappings, db_test table list - SQL: add 5 continuous aggregate materialized views (klines_3m/2h/6h/8h/1mon) with indexes - SQL: extend default kline_intervals in trading_pairs table - SQL: add cross-sectional query indexes for klines_1d and klines_1w DB: - Enable pg_prewarm extension (backtest warmup) - Enable pg_stat_statements extension (slow query monitoring) Other: - data/run/exchange.ts: graceful pgsql shutdown after backfill completes - Config path: load from data/env.yaml (symlink) instead of project root
37 lines
1.1 KiB
YAML
37 lines
1.1 KiB
YAML
# ============================================================
|
||
# Trade System — 统一环境配置(YAML)
|
||
# ============================================================
|
||
# 使用方式:
|
||
# data 模块通过 data/config.ts 读取此文件
|
||
# Python 模块通过 yaml.safe_load 读取此文件
|
||
#
|
||
# 修改后重启服务即可生效,无需重新构建。
|
||
# ============================================================
|
||
|
||
# --- TimescaleDB / PostgreSQL 连接 ---
|
||
db:
|
||
host: 10.0.0.7
|
||
port: 5432
|
||
name: trade
|
||
user: trader
|
||
password: fucketh
|
||
|
||
# --- Redis 连接 ---
|
||
redis:
|
||
url: redis://localhost:6379
|
||
# 是否启用 Pub/Sub 行情发布(开发时可关闭以节省资源)
|
||
publish_enabled: true
|
||
|
||
# --- 交易所 API 密钥 ---
|
||
exchange:
|
||
binance:
|
||
api_key: "ONSJKIGRpDYLn6FdV17aAKfjclZ4I2LzamflhuMpsoRQA427lLKeyJlGtg2RZ7DH"
|
||
api_secret: "5Mfv4TgvDlRzCHbtl2nJL4mVHUvMm8pyjKiRjMoosBMxrhlqMw6CuQbg2qbS2Npd"
|
||
|
||
# --- 日志 ---
|
||
logging:
|
||
# 日志级别:trace / debug / info / warn / error / fatal
|
||
level: debug
|
||
# 运行环境:development 启用 pretty print;production 输出 JSON
|
||
node_env: development
|