Align emergency option close to OKX: use bid only, never mark.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -214,14 +214,14 @@ def test_option_intrinsic_and_close_bid_floor() -> None:
|
||||
assert settled.notional == 44.0
|
||||
assert abs(settled.fee - 44.0 * 0.0005) < 1e-12
|
||||
|
||||
# 紧急垃圾买一 0.2,内在价值 22 → 抬到 22
|
||||
# 紧急:对齐 OKX 市价卖,只按买一(垃圾买一不抬到内在价值/标记)
|
||||
assert (
|
||||
resolve_option_close_bid(
|
||||
bid=0.2, mark=0.2, intrinsic=22.0, bypass_liquidity=True
|
||||
bid=0.2, mark=22.0, intrinsic=22.0, bypass_liquidity=True
|
||||
)
|
||||
== 22.0
|
||||
== 0.2
|
||||
)
|
||||
# 常规也有内在价值地板
|
||||
# 常规:内在价值地板
|
||||
assert (
|
||||
resolve_option_close_bid(
|
||||
bid=0.2, mark=0.2, intrinsic=22.0, bypass_liquidity=False
|
||||
@@ -235,10 +235,10 @@ def test_option_intrinsic_and_close_bid_floor() -> None:
|
||||
)
|
||||
== 25.0
|
||||
)
|
||||
# bypass 无买一,用标记与内在价值
|
||||
# 紧急无买一 → 无法定价(不能用标记)
|
||||
assert (
|
||||
resolve_option_close_bid(
|
||||
bid=None, mark=3.0, intrinsic=22.0, bypass_liquidity=True
|
||||
)
|
||||
== 22.0
|
||||
is None
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user