Split fee stats by leg and hide LIVE slip.

SIM shows perp/option fees and slip separately; LIVE keeps real exchange fees only with slip forced to zero.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-29 16:37:18 +08:00
parent 8518a207a7
commit 1c75db4a19
8 changed files with 122 additions and 20 deletions
+23 -2
View File
@@ -3,10 +3,14 @@ import { apiFetch } from "../api/client";
import { closeReasonZh } from "../labels";
type Summary = {
mode?: "SIM" | "LIVE" | string;
show_slip?: boolean;
groups: number;
wins: number;
win_rate: number;
total_pnl: number;
fees_perp?: number;
fees_option?: number;
total_fees: number;
total_slip: number;
close_reasons: Record<string, number>;
@@ -26,6 +30,7 @@ export default function StatsPage() {
const reasonEntries = s
? Object.entries(s.close_reasons).sort((a, b) => b[1] - a[1])
: [];
const showSlip = s?.show_slip ?? s?.mode !== "LIVE";
return (
<div className="card">
@@ -46,11 +51,27 @@ export default function StatsPage() {
<span className="mono">{s.total_pnl.toFixed(2)}</span>
</div>
<div className="kv">
<span> / </span>
<span></span>
<span className="mono">
{s.total_fees.toFixed(2)} / {s.total_slip.toFixed(2)}
{(s.fees_perp ?? 0).toFixed(4)}
</span>
</div>
<div className="kv">
<span></span>
<span className="mono">
{(s.fees_option ?? 0).toFixed(4)}
</span>
</div>
<div className="kv">
<span></span>
<span className="mono">{s.total_fees.toFixed(4)}</span>
</div>
{showSlip ? (
<div className="kv">
<span></span>
<span className="mono">{s.total_slip.toFixed(4)}</span>
</div>
) : null}
<div className="kv" style={{ alignItems: "flex-start" }}>
<span></span>
<span className="mono" style={{ textAlign: "right" }}>