Polish risk sizing: 2dp money preview, editable ratio/exit, plan badge.

Exit unit and perp/option units scale with k; plan page shows 以损定仓.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-29 23:48:34 +08:00
parent 3a4c8d639c
commit a47a9b6377
8 changed files with 349 additions and 38 deletions
+17 -3
View File
@@ -151,7 +151,9 @@ export default function PlanPage() {
const exitRuleLabel =
exitMode === "premium_multiple"
? `权利金×${fmt(plan?.premium_exit_multiple ?? 1, 2)}`
: `固定 ${fmt(plan?.net_profit_target ?? 15)} U`;
: plan?.risk_based || plan?.sizing_mode === "risk_based"
? `以损定仓 · 固定 ${fmt(exitTarget)} U(基数${fmt(plan?.risk_exit_unit ?? 15)}`
: `固定 ${fmt(plan?.net_profit_target ?? 15)} U`;
const phaseLabel = PHASE_ZH[plan?.phase || ""] || plan?.phase || "—";
const atmRule = plan?.fixed_direction_enabled
? plan?.fixed_perp_side === "short"
@@ -343,8 +345,20 @@ export default function PlanPage() {
<div className="kv">
<span></span>
<span className="mono">
{fmt(plan?.perp_qty_eth ?? 1, 0)}ETH/
{fmt(plan?.option_qty_eth ?? 2, 0)}ETH ·
{plan?.risk_based || plan?.sizing_mode === "risk_based" ? (
<>
<span className="status-running"></span>
{" · "}
{fmt(plan?.risk_perp_unit ?? 1, 2)}:
{fmt(plan?.risk_option_unit ?? 2, 2)}
{plan?.risk_last_k
? ` · k=${fmt(plan.risk_last_k, 1)}`
: ""}
{" · "}
</>
) : null}
{fmt(plan?.perp_qty_eth ?? 1, 2)}ETH/
{fmt(plan?.option_qty_eth ?? 2, 2)}ETH ·
{fmt(plan?.min_option_hours, 0)}h ·
{fmt(plan?.min_option_leverage, 0)}x
{plan?.fixed_direction_enabled