Split OO budget per leg and size Call/Put independently.

Each half of the risk budget buys its own qty from ask; equal qty no longer forced.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-08-07 17:08:05 +08:00
parent 24943adf13
commit 24a860ad3f
11 changed files with 210 additions and 110 deletions
+1
View File
@@ -367,6 +367,7 @@ export type PlanState = {
oo_min_option_hours?: number;
oo_min_leverage?: number;
oo_reward_ratio?: number;
oo_put_qty_eth?: number;
sizing_mode?: "manual" | "risk_based";
risk_based?: boolean;
ledger: { equity: number; available: number; reserved: number };
+11 -2
View File
@@ -223,7 +223,7 @@ export default function PlanPage() {
: `待估算(基数${fmt(plan?.risk_exit_unit ?? 15)}`
: `固定 ${fmt(plan?.net_profit_target ?? 15)} U`;
const riskRatioLabel = isOo
? "Call:Put 1:1"
? "预算平分 Call/Put"
: `比例${Number(plan?.risk_perp_unit ?? 1)}:${Number(plan?.risk_option_unit ?? 2)}`;
const sizingModeLabel = riskBased
? [
@@ -268,7 +268,16 @@ export default function PlanPage() {
"虚值Call@高·Put@低",
`剩余≥${fmt(plan?.oo_min_option_hours ?? 24, 0)}h`,
`杠杆≥${fmt(plan?.oo_min_leverage ?? 200, 0)}x`,
displayOptQty != null ? `单腿${fmt(displayOptQty, 1)}ETH` : null,
displayOptQty != null
? `Call${fmt(displayOptQty, 1)}/Put${fmt(
Number(
plan?.risk_sizing_preview?.put_qty_eth ??
plan?.oo_put_qty_eth ??
displayOptQty,
),
1,
)}ETH`
: null,
]
.filter(Boolean)
.join(" · ");
+15 -7
View File
@@ -756,7 +756,7 @@ export default function SettingsPage() {
/>
<p className="hint" style={{ margin: "0.35rem 0 0" }}>
= × 100U 2
200U 1:1 /
200U Call/Put
</p>
</div>
) : null}
@@ -785,7 +785,7 @@ export default function SettingsPage() {
<div className="field">
<label></label>
<div className="mono" style={{ fontSize: 13 }}>
· Call/Put 1:1
·
</div>
</div>
)}
@@ -1048,11 +1048,19 @@ export default function SettingsPage() {
? ` · 倍投待命(连亏${Number(mg.loss_days) || 0}天)`
: "";
return isOo
? `预算=${budS}U · 估亏=${mxS}U · 出场=预算×${ooRewardRatio}${
riskPreview.option_qty_eth != null
? ` · 单腿≈${riskPreview.option_qty_eth}ETH`
: ""
}${mgS}`
? `预算=${budS}U · 各腿≈${
riskPreview.leg_budget != null
? Number(riskPreview.leg_budget).toFixed(2)
: budS !== ""
? (Number(budS) / 2).toFixed(2)
: "—"
}U · Call≈${
riskPreview.call_qty_eth ??
riskPreview.option_qty_eth ??
"—"
} · Put≈${
riskPreview.put_qty_eth ?? "—"
} · 出场=预算×${ooRewardRatio}${mgS}`
: `k=${pk ?? "—"} · 预算=${budS}U · 估亏=${mxS}U · 永续=${perp ?? "—"} · 期权=${opt ?? "—"} · 出场=${exit ?? "—"}${basisS}${mgS}`;
})()}
</div>