Go-live gate: refuse unsafe live trading
Setting MODE=live alone no longer starts trading. check_live_ready requires an active risk limit, MAX_POSITION_PCT < 1.0, LIVE_CONFIRMATION exactly "I UNDERSTAND THE RISK", a minimum balance, and exchange credentials. Enforced in Runtime.start_many (both start paths) and surfaced at GET /api/live-check; the dashboard shows a banner and blocks the start buttons. Adds tests.
This commit is contained in:
1 parent
b60cddf13d
commit
0173e46cfb
10 files changed
+241
-1
No files matched your search
@@ -39,6 +39,13 @@ class Settings(BaseSettings):
|
||||
exchange_api_secret: str = ""
|
||||
exchange_sandbox: bool = False
|
||||
|
||||
# --- Go-live gate ---
|
||||
# Live trading only starts when this is exactly "I UNDERSTAND THE RISK".
|
||||
# It is deliberately not a boolean: setting MODE=live alone is not enough.
|
||||
live_confirmation: str = ""
|
||||
# Refuse to start live below this account size (quote currency).
|
||||
min_live_balance: float = 100.0
|
||||
|
||||
# --- Risk controls (0 disables a limit) ---
|
||||
# Absolute loss in quote currency since the start of the UTC day.
|
||||
max_daily_loss: float = 0.0
|
||||
|
||||
Reference in new issue
Block a user