diff --git a/lib/exchange/okx_options_lib.py b/lib/exchange/okx_options_lib.py index 7b0dbac..62df52d 100644 --- a/lib/exchange/okx_options_lib.py +++ b/lib/exchange/okx_options_lib.py @@ -411,8 +411,6 @@ def build_option_chain( mark = q["mark_px"] ask_sz = q["ask_sz"] bid_sz = q["bid_sz"] - if ask is None and bid is None and mark is None: - continue expiry_be = expiry_breakeven_from_ask( opt_type=opt_type, strike=strike, diff --git a/lib/options/templates/options_panel.html b/lib/options/templates/options_panel.html index 06a5386..2a1b8d3 100644 --- a/lib/options/templates/options_panel.html +++ b/lib/options/templates/options_panel.html @@ -136,4 +136,4 @@ - + diff --git a/tests/test_options_pricing.py b/tests/test_options_pricing.py index d9b803f..295bdb9 100644 --- a/tests/test_options_pricing.py +++ b/tests/test_options_pricing.py @@ -90,6 +90,21 @@ def test_estimate_expiry_profit_at_index(): assert p2 == round(-12.2 * 0.01, 4) +def test_resolve_chain_quote_otm_no_quote(): + from lib.exchange.okx_options_lib import _resolve_chain_quote + + q = _resolve_chain_quote( + ticker={}, + meta={"tickSz": "0.2"}, + opt_type="C", + strike=1800, + index_px=1776, + ) + assert q["ask"] is None + assert q["bid"] is None + assert q["ask_estimated"] is False + + def test_resolve_chain_quote_estimated_ask(): from lib.exchange.okx_options_lib import _resolve_chain_quote