Skip to content

Commit 4ee456a

Browse files
committed
chore: fix margin conversion for BO
1 parent c19eba4 commit 4ee456a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pyinjective/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def binary_options_buy_margin_to_backend(price, quantity, denom) -> int:
6969

7070
def binary_options_sell_margin_to_backend(price, quantity, denom) -> int:
7171
price_tick_size = Decimal(denom.min_price_tick_size) / pow(10, denom.quote)
72-
margin = (1 - (Decimal(str(price)) / pow (10, denom.quote))) * Decimal(str(quantity))
72+
margin = (1 - (Decimal(str(price)) * (Decimal(str(quantity)))))
7373
exchange_margin = floor_to(margin, float(price_tick_size)) * pow(10, 18 + denom.quote)
7474
return int(exchange_margin)
7575

0 commit comments

Comments
 (0)