diff --git a/src/Managing.Application/ManageBot/BotService.cs b/src/Managing.Application/ManageBot/BotService.cs index bbdb87f..81a537c 100644 --- a/src/Managing.Application/ManageBot/BotService.cs +++ b/src/Managing.Application/ManageBot/BotService.cs @@ -301,16 +301,6 @@ namespace Managing.Application.ManageBot { var existingBot = await repo.GetBotByIdentifierAsync(bot.Identifier); if (existingBot == null) - { - _tradingBotLogger.LogInformation("Creating new bot statistics for bot {BotId}", - bot.Identifier); - // Update existing bot - await _botRepository.UpdateBot(bot); - _tradingBotLogger.LogDebug( - "Updated bot statistics for bot {BotId}: Wins={Wins}, Losses={Losses}, PnL={PnL}, ROI={ROI}%, Volume={Volume}, Fees={Fees}", - bot.Identifier, bot.TradeWins, bot.TradeLosses, bot.Pnl, bot.Roi, bot.Volume, bot.Fees); - } - else { _tradingBotLogger.LogInformation("Updating existing bot statistics for bot {BotId}", bot.Identifier); @@ -320,6 +310,16 @@ namespace Managing.Application.ManageBot "Created new bot statistics for bot {BotId}: Wins={Wins}, Losses={Losses}, PnL={PnL}, ROI={ROI}%, Volume={Volume}, Fees={Fees}", bot.Identifier, bot.TradeWins, bot.TradeLosses, bot.Pnl, bot.Roi, bot.Volume, bot.Fees); } + else + { + _tradingBotLogger.LogInformation("Creating new bot statistics for bot {BotId}", + bot.Identifier); + // Update existing bot + await _botRepository.UpdateBot(bot); + _tradingBotLogger.LogDebug( + "Updated bot statistics for bot {BotId}: Wins={Wins}, Losses={Losses}, PnL={PnL}, ROI={ROI}%, Volume={Volume}, Fees={Fees}", + bot.Identifier, bot.TradeWins, bot.TradeLosses, bot.Pnl, bot.Roi, bot.Volume, bot.Fees); + } }); return true;