Show expiry settlement as index vs strike intrinsic.

Persist settle_index_px and surface formula in trade detail so expiry closes are not mistaken for book fills.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-29 16:15:22 +08:00
parent 3df64aeb2d
commit 8518a207a7
6 changed files with 130 additions and 7 deletions
+9 -1
View File
@@ -52,10 +52,18 @@ export function positionSidesZh(
return `${sideZh(perp)}/${sideZh(option)}`;
}
export function fillDescZh(leg: string, action: string, side: string): string {
export function fillDescZh(
leg: string,
action: string,
side: string,
closeReason?: string | null,
): string {
const l = LEG_ZH[leg] || leg;
const a = ACTION_ZH[action] || action;
const s = SIDE_ZH[side] || side;
if (leg === "option" && action === "close" && closeReason === "expiry") {
return "期权到期结算";
}
// 期权买入开仓:「期权开多」;永续:「永续开多/开空」
if (leg === "option" && action === "open") return "期权开多";
if (leg === "option" && action === "close") return "期权平多";