Show residual bid as price/size and recovery percent from bid premium.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-08-03 07:43:27 +08:00
parent a10ecf7409
commit 09abb8d35b
3 changed files with 47 additions and 5 deletions
+5 -1
View File
@@ -206,7 +206,11 @@ def test_manual_close_skips_premium_ratio(tmp_path, monkeypatch) -> None:
enriched = m.list_residual_options_enriched()
assert len(enriched) == 1
assert enriched[0]["liquidity_ok"] is True
assert enriched[0]["recovery_pct"] is not None
assert enriched[0]["bid_px"] == 5.0
assert enriched[0]["bid_sz"] == 10_000.0
assert abs(float(enriched[0]["bid_sz_eth"]) - 100.0) < 1e-9 # 10000*0.01
assert abs(float(enriched[0]["current_premium"]) - 10.0) < 1e-9 # 5*2
assert abs(float(enriched[0]["recovery_pct"]) - 10.0) < 1e-9 # 10/100*100
assert float(enriched[0]["recovery_pct"]) < 20.0
r = m.close_residual_manual("G-res")