Add SIM/LIVE switch with API keys saved to .env and OKX live executor.

Enable settings UI for mode/keys, gate strategy start when LIVE is not ready, and stop PM2 from forcing MODE=SIM.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-26 21:08:39 +08:00
parent c2113b1a57
commit e666230d0b
19 changed files with 1367 additions and 33 deletions
+8 -3
View File
@@ -1,6 +1,7 @@
# eth_hedge_sim — 独立自动对冲模拟盘
# 复制为 .env 后按需填写。模拟阶段禁止真实下单;真密钥不上库。
# eth_hedge_sim — 独立自动对冲(SIM 本地撮合 / LIVE 实盘)
# 复制为 .env 后按需填写。真密钥不上库。
# SIM | LIVE(设置页可改;切 LIVE 须二次确认)
MODE=SIM
ENV_NAME=test
TZ=Asia/Shanghai
@@ -17,7 +18,7 @@ AUTH_PASSWORD=admin123
AUTH_SECRET=change-me-eth-hedge-sim-secret
AUTH_TOKEN_TTL_SEC=604800
# OKXSIM 阶段公共盘口可不填 Key
# OKXSIM 公共盘口可不填LIVE 下单必填
OKX_API_KEY=
OKX_API_SECRET=
OKX_API_PASSPHRASE=
@@ -26,6 +27,10 @@ OKX_WS_PUBLIC=wss://ws.okx.com:8443/ws/v5/public
# 云上一般直连留空;本机受限时再填代理
OKX_HTTP_PROXY=
# 币安私有交易密钥(可落盘;实盘下单后续接入)
BINANCE_API_KEY=
BINANCE_API_SECRET=
# 币安公共行情(SIM
BINANCE_FAPI_BASE=https://fapi.binance.com
BINANCE_EAPI_BASE=https://eapi.binance.com