Fix LIVE open/close double-book and security audit findings.
Prevent expiry dual-close from re-booking option cash, abandon ledger rejection, margin-mode mismatch, and manual close races; harden fill wait and refuse default AUTH_SECRET on LIVE. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -36,6 +36,14 @@ async def lifespan(app: FastAPI):
|
||||
# 而 health 显示 DB 里的 binance → 合约号/盘口错乱(期权一直 -/-)
|
||||
from .exchange.runtime import load_runtime_settings
|
||||
|
||||
app_settings = get_settings()
|
||||
if not app_settings.is_sim:
|
||||
secret = (app_settings.auth_secret or "").strip()
|
||||
if not secret or secret == "change-me-eth-hedge-sim-secret":
|
||||
raise RuntimeError(
|
||||
"LIVE 拒绝启动:请在 .env 设置非默认 AUTH_SECRET(勿用 change-me-eth-hedge-sim-secret)"
|
||||
)
|
||||
|
||||
settings = load_runtime_settings()
|
||||
engine = StrategyEngine()
|
||||
set_engine(engine)
|
||||
|
||||
Reference in New Issue
Block a user