@@ -68,7 +68,7 @@ class TestOptionsMarginMode(unittest.TestCase):
|
|||||||
def test_sheets_from_coin(self):
|
def test_sheets_from_coin(self):
|
||||||
from lib.options.options_margin_mode_lib import calc_sheets_from_coin_balance
|
from lib.options.options_margin_mode_lib import calc_sheets_from_coin_balance
|
||||||
|
|
||||||
# ask 0.01 ETH per 1 ETH, ctMult 0.01 → 每张 0.0001 ETH; 0.01 ETH 可开 100 张
|
# ask 0.01 ETH per 1 ETH, ctMult 0.01 → 每张 0.0001 ETH; 0.01 ETH×0.97 缓冲可开 97 张
|
||||||
r = calc_sheets_from_coin_balance(
|
r = calc_sheets_from_coin_balance(
|
||||||
quote_per_unit=0.01,
|
quote_per_unit=0.01,
|
||||||
ct_mult=0.01,
|
ct_mult=0.01,
|
||||||
@@ -76,7 +76,7 @@ class TestOptionsMarginMode(unittest.TestCase):
|
|||||||
coin_available=0.01,
|
coin_available=0.01,
|
||||||
)
|
)
|
||||||
self.assertTrue(r["ok"])
|
self.assertTrue(r["ok"])
|
||||||
self.assertEqual(r["sheets"], 100)
|
self.assertEqual(r["sheets"], 97)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user