skyfffire 4 hónapja
szülő
commit
b188ae3b03
1 módosított fájl, 3 hozzáadás és 1 törlés
  1. 3 1
      s_mexc_to_erc20.py

+ 3 - 1
s_mexc_to_erc20.py

@@ -340,9 +340,10 @@ class ArbitrageProcess:
 
                     if order['status'] in ["FILLED", "PARTIALLY_CANCELED"]:
                         # 以实际成交数量为准
+                        money = Decimal(order['cummulativeQuoteQty'])
                         self.already_bought_amount = self.already_bought_amount + Decimal(order['executedQty'])
 
-                        self.buy_value = self.buy_value + Decimal(order['cummulativeQuoteQty'])
+                        self.buy_value = self.buy_value + money
                         self.buy_price = self.buy_value / self.already_bought_amount
                         self.buy_price = self.buy_price.quantize(Decimal('1e-16'), rounding=ROUND_DOWN)
 
@@ -352,6 +353,7 @@ class ArbitrageProcess:
                         add_state_flow_entry(self.process_item, self.current_state, msg, "success")
 
                         self.exchange_withdrawal_amount = self.already_bought_amount
+                        break
                     else:
                         time.sleep(1)
                         waiting_times = waiting_times - 1