@@ -67,23 +67,19 @@ async def main() -> None:
6767 market_id = deriv_market_id ,
6868 subaccount_id = subaccount_id ,
6969 fee_recipient = fee_recipient ,
70- price = Decimal (10500 ),
71- quantity = Decimal (0.01 ),
72- margin = composer .calculate_margin (
73- quantity = Decimal (0.01 ), price = Decimal (10500 ), leverage = Decimal (2 ), is_reduce_only = False
74- ),
70+ price = Decimal ("10500" ),
71+ quantity = Decimal ("0.01" ),
72+ margin = Decimal ("52.5" ),
7573 order_type = "BUY" ,
7674 cid = str (uuid .uuid4 ()),
7775 ),
7876 composer .derivative_order (
7977 market_id = deriv_market_id ,
8078 subaccount_id = subaccount_id ,
8179 fee_recipient = fee_recipient ,
82- price = Decimal (65111 ),
83- quantity = Decimal (0.01 ),
84- margin = composer .calculate_margin (
85- quantity = Decimal (0.01 ), price = Decimal (65111 ), leverage = Decimal (2 ), is_reduce_only = False
86- ),
80+ price = Decimal ("65111" ),
81+ quantity = Decimal ("0.01" ),
82+ margin = Decimal ("325.555" ),
8783 order_type = "SELL" ,
8884 cid = str (uuid .uuid4 ()),
8985 ),
@@ -204,23 +200,19 @@ async def main() -> None:
204200 market_id = deriv_market_id ,
205201 subaccount_id = subaccount_id_2 ,
206202 fee_recipient = fee_recipient ,
207- price = Decimal (25111 ),
208- quantity = Decimal (0.01 ),
209- margin = composer .calculate_margin (
210- quantity = Decimal (0.01 ), price = Decimal (25111 ), leverage = Decimal ("1.5" ), is_reduce_only = False
211- ),
203+ price = Decimal ("25111" ),
204+ quantity = Decimal ("0.01" ),
205+ margin = Decimal ("167.406666666666666667" ),
212206 order_type = "BUY" ,
213207 cid = str (uuid .uuid4 ()),
214208 ),
215209 composer .derivative_order (
216210 market_id = deriv_market_id ,
217211 subaccount_id = subaccount_id_2 ,
218212 fee_recipient = fee_recipient ,
219- price = Decimal (65111 ),
220- quantity = Decimal (0.01 ),
221- margin = composer .calculate_margin (
222- quantity = Decimal (0.01 ), price = Decimal (25111 ), leverage = Decimal (2 ), is_reduce_only = False
223- ),
213+ price = Decimal ("65111" ),
214+ quantity = Decimal ("0.01" ),
215+ margin = Decimal ("125.555" ),
224216 order_type = "SELL" ,
225217 cid = str (uuid .uuid4 ()),
226218 ),
0 commit comments