fix: OKX options buy/close orders with tick alignment and reduceOnly

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-07 08:52:18 +08:00
parent ae0c44e20d
commit 05586242f0
6 changed files with 269 additions and 65 deletions
+7
View File
@@ -5,6 +5,13 @@ from lib.options.options_pricing_lib import (
sheets_from_eth_amount,
total_premium,
)
from lib.exchange.okx_options_lib import format_option_px, round_option_px
def test_round_option_px():
assert round_option_px(14.9184, "0.2", "sell") == 14.8
assert round_option_px(14.81, "0.2", "buy") == 15.0
assert format_option_px(14.8, "0.2") == "14.8"
def test_premium_per_sheet():