fix: round liquidation price to precision in a different spot

closes #11110
This commit is contained in:
Matthias
2024-12-19 19:37:30 +01:00
parent 564d874869
commit 8ee2c849b4
2 changed files with 4 additions and 2 deletions

View File

@@ -3642,7 +3642,7 @@ class Exchange:
liquidation_price_buffer = ( liquidation_price_buffer = (
liquidation_price - buffer_amount if is_short else liquidation_price + buffer_amount liquidation_price - buffer_amount if is_short else liquidation_price + buffer_amount
) )
return self.price_to_precision(pair, max(liquidation_price_buffer, 0.0)) return max(liquidation_price_buffer, 0.0)
else: else:
return None return None

View File

@@ -777,7 +777,9 @@ class LocalTrade:
""" """
if liquidation_price is None: if liquidation_price is None:
return return
self.liquidation_price = liquidation_price self.liquidation_price = price_to_precision(
liquidation_price, self.price_precision, self.precision_mode_price
)
def set_funding_fees(self, funding_fee: float) -> None: def set_funding_fees(self, funding_fee: float) -> None:
""" """