fix(analytics): never mix paper + live P&L; settings live-switch copy

Money-safety/accuracy bug: analytics computed total P&L, win rate, drawdown,
and every metric over ALL trades regardless of is_paper. A user who tried
paper mode then went live saw simulated and real P&L summed into one number
on the page whose entire purpose is 'did the bot make REAL money'.

Now: split trades by is_paper. Default to LIVE. A Live/Paper toggle appears
only when the wallet has both; otherwise auto-pick whichever exists. Paper
view shows a prominent 'SIMULATED — not real-money results' banner. All
metrics derive from the selected mode's trades only.

Also: BotConfigPanel handleUpgradeToLive copy now states Auto-Trade is forced
OFF on the paper→live switch (matches backend subscribe.py safety reset).

tsc + next build clean.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
k
2026-05-30 01:03:15 +08:00
parent e78a61bd6e
commit 594d9817ba
8 changed files with 72 additions and 25 deletions
+2 -2
View File
@@ -1,10 +1,10 @@
# Trump Alpha
> AI-powered crypto intelligence platform. Four uncorrelated signal sources: Trump Truth Social sentiment, Macro Vibes (crypto macro regime dashboard), KOL Substack/podcast signals, and talks-vs-trades on-chain divergence.
> A crypto research project by Endorphin, a research desk. Tracks four uncorrelated signals that move markets before consensus catches up: Trump Truth Social sentiment, Macro Vibes (crypto macro regime dashboard), KOL Substack/podcast signals, and talks-vs-trades on-chain divergence. Every signal is public and timestamped.
## What this site does
Trump Alpha aggregates four signal engines and one macro context view into one live dashboard. All four dashboards are free to read — no account required.
Trump Alpha is Endorphin's public signal desk: four independent signal engines and one macro context view in one live dashboard. All four dashboards are free to read — no account required, every call timestamped.
1. **Trump Truth Social Signal** — Scrapes Trump's Truth Social posts within 15 seconds of publish. AI classifies each post as LONG (bullish crypto), SHORT (bearish), or NOISE (off-topic) with a confidence score 0100. Only posts scoring ≥ 88 confidence trigger the optional auto-trader. The entire pipeline from post to classification runs in under 3 seconds. Optional: auto-execute on Hyperliquid with isolated margin, automatic TP/SL, and six user-defined safety limits (leverage cap, position size, daily budget, active-hours window, confidence floor, stop-loss floor).