Files
trumpsignal-frontend/app/[locale]/page.tsx
T
k 594d9817ba 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>
2026-05-30 01:03:15 +08:00

58 lines
1.6 KiB
TypeScript

import { getPosts } from '@/lib/api'
import type { Metadata } from 'next'
import DashboardClient from './DashboardClient'
export const revalidate = 30
const siteUrl = process.env.NEXT_PUBLIC_SITE_URL || 'https://trumpsignal.com'
interface OverviewPageProps {
params: Promise<{ locale: string }>
}
export async function generateMetadata({ params }: OverviewPageProps): Promise<Metadata> {
const { locale } = await params
const isZh = false // i18n shelved — Chinese branches kept as dead code for future revival; see messages/zh.json
const title = isZh
? 'Trump Alpha — 实时加密信号研究台'
: 'Trump Alpha — Live Crypto Signal Desk'
const description = isZh
? 'Endorphin 研究台追踪四个先于市场共识的信号:Trump 帖子、BTC 宏观底部、资金费率极值,以及 KOL 言行偏离。每个信号公开且带时间戳。'
: 'Endorphin tracks four signals that move crypto before the crowd: Trump posts, BTC macro bottoms, funding-rate extremes, and what KOLs do vs say. Public and timestamped.'
const path = `${siteUrl}/${locale}`
return {
title,
description,
alternates: {
canonical: path,
languages: {
en: `${siteUrl}/en`,
'x-default': `${siteUrl}/en`,
},
},
openGraph: {
title,
description,
url: path,
locale: isZh ? 'zh_CN' : 'en_US',
alternateLocale: isZh ? ['en_US'] : ['zh_CN'],
},
twitter: {
title,
description,
},
}
}
export default async function OverviewPage() {
const posts = await getPosts(500, 1).catch(() => [])
return (
<DashboardClient
initialPosts={posts}
/>
)
}