diff --git a/src/lib_python_interop/python_interop_plugins/bybit_execution_gateway.py b/src/lib_python_interop/python_interop_plugins/bybit_execution_gateway.py index 65e6c8cd6..ae386033a 100644 --- a/src/lib_python_interop/python_interop_plugins/bybit_execution_gateway.py +++ b/src/lib_python_interop/python_interop_plugins/bybit_execution_gateway.py @@ -132,9 +132,9 @@ class OrderData: status: str, ): self.price = price - self.filled_quantity = 0 self.quantity = quantity lfq = filled_quantity - self.filled_quantity + lfq = round(lfq, 7) if lfq > 0: if self.filled_quantity == 0: self.last_filled_quantity = filled_quantity @@ -143,6 +143,7 @@ class OrderData: price_diff = avg_filled_price - self.avg_filled_price lfq_weight = filled_quantity / (self.filled_quantity + filled_quantity) lfp = self.avg_filled_price + (price_diff / lfq_weight) + lfp = round(lfp, 7) self.last_filled_price = lfp self.last_filled_quantity = lfq self.filled_quantity = filled_quantity