补齐币本位期权开平仓微信推送:单位用ETH/BTC,手动/目标/翻倍平仓与翻倍提醒均必达。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-08-20 17:57:58 +08:00
parent a7d0c2f875
commit 440778e9e6
6 changed files with 122 additions and 44 deletions
+6 -1
View File
@@ -303,6 +303,9 @@ def _notify_target_close(
conn: Any = None,
) -> None:
"""目标位平仓推送:优先走统一平仓必发(幂等);无 cfg 时回退旧文案."""
from lib.options.options_notify_lib import resolve_premium_ccy
ccy = resolve_premium_ccy(inst_id=inst_id)
if result.get("fully_closed") or result.get("already_flat"):
if cfg is not None:
try:
@@ -318,6 +321,7 @@ def _notify_target_close(
close_quote=result.get("locked_bid_px") or result.get("bid"),
target_index=target,
trigger_idx=idx,
premium_ccy=ccy,
)
return
except Exception:
@@ -325,6 +329,7 @@ def _notify_target_close(
if not send_wechat:
return
try:
recv = result.get("premium_received")
send_wechat(
"\n".join(
[
@@ -334,7 +339,7 @@ def _notify_target_close(
f"目标指数:{target:g}",
f"触发指数:{idx:g}",
f"提交张数:{result.get('submitted_sheets') or ''}",
f"预估收回:{result.get('premium_received') if result.get('premium_received') is not None else ''} USDC",
f"预估收回:{recv if recv is not None else ''} {ccy}",
f"状态:{'已全平' if (result.get('fully_closed') or result.get('already_flat')) else '挂单中/部分'}",
]
)