File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -57,14 +57,14 @@ def binary_options_quantity_to_backend(quantity, denom) -> int:
5757
5858def derivative_margin_to_backend (price , quantity , leverage , denom ) -> int :
5959 price_tick_size = Decimal (denom .min_price_tick_size ) / pow (10 , denom .quote )
60- margin = Decimal ( str ( price )) * Decimal ( str ( quantity )) / Decimal ( str ( leverage ))
61- exchange_margin = margin * pow (10 , 18 + denom .quote )
60+ margin = ( price * quantity ) / leverage
61+ exchange_margin = floor_to ( margin , float ( price_tick_size )) * pow (10 , 18 + denom .quote )
6262 return int (exchange_margin )
6363
6464def binary_options_buy_margin_to_backend (price , quantity , denom ) -> int :
6565 price_tick_size = Decimal (denom .min_price_tick_size ) / pow (10 , denom .quote )
6666 margin = Decimal (str (price )) * Decimal (str (quantity ))
67- exchange_margin = margin * pow (10 , 18 + denom .quote )
67+ exchange_margin = floor_to ( margin , float ( price_tick_size )) * pow (10 , 18 + denom .quote )
6868 return int (exchange_margin )
6969
7070def binary_options_sell_margin_to_backend (price , quantity , denom ) -> int :
You can’t perform that action at this time.
0 commit comments