diff --git a/api/deals/controllers.py b/api/deals/controllers.py index 3c0e34a34..8ee380a5a 100644 --- a/api/deals/controllers.py +++ b/api/deals/controllers.py @@ -332,6 +332,15 @@ def open_deal(self): - If base order deal is not executed, bot is not activated """ + # Check if bot with same pair is already active + active_bot = self.db_collection.find_one( + {"pair": self.active_bot.pair, "status": Status.active} + ) + if active_bot: + raise CreateDealControllerError( + f"Bot with pair {self.active_bot.pair} is already active" + ) + # If there is already a base order do not execute base_order_deal = next( ( diff --git a/api/orders/controller.py b/api/orders/controller.py index 8daedcece..65204aa3f 100644 --- a/api/orders/controller.py +++ b/api/orders/controller.py @@ -80,7 +80,7 @@ def sell_order(self, symbol, qty, price=None): data = self.signed_request(url=self.order_url, method="POST", payload=payload) - if data["price"] == 0: + if float(data["price"]) == 0: total_qty = 0 weighted_avg = 0 for item in data["fills"]: diff --git a/web/src/components/VolumesRanking.jsx b/web/src/components/VolumesRanking.jsx index bc04e3f8f..e62c4ee2a 100644 --- a/web/src/components/VolumesRanking.jsx +++ b/web/src/components/VolumesRanking.jsx @@ -22,7 +22,7 @@ const average = (data) => { return (acc + parseFloat(x.quoteVolume) + parseFloat(x.volume)); }, 0); - return total / data.length - 1; + return (total / data.length - 1).toLocaleString(); } export default function VolumesRankingCard({ data, title }) { @@ -50,7 +50,7 @@ export default function VolumesRankingCard({ data, title }) { bg="success" className="u-float-right" > - {(parseFloat(x.quoteVolume) + parseFloat(x.volume)).toFixed(2)} + {(parseFloat(x.quoteVolume) + parseFloat(x.volume)).toLocaleString()}