Show residual bid as price/size and recovery percent from bid premium.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user