Show equivalent contract leverage on options order panel.
Display notional-over-premium leverage at current index and at the user target price for quick sizing comparison. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -67,6 +67,14 @@ def test_option_moneyness():
|
||||
assert option_moneyness_label("otm") == "虚值"
|
||||
|
||||
|
||||
def test_equivalent_contract_leverage():
|
||||
from lib.options.options_pricing_lib import equivalent_contract_leverage
|
||||
|
||||
# index 1768, 0.2 ETH, premium 2.44 -> ~144.9x
|
||||
lev = equivalent_contract_leverage(index_px=1768, eth_amount=0.2, total_premium=2.44)
|
||||
assert lev == 144.9
|
||||
|
||||
|
||||
def test_estimate_expiry_profit_at_index():
|
||||
from lib.options.options_pricing_lib import estimate_expiry_profit_at_index
|
||||
|
||||
|
||||
Reference in New Issue
Block a user