Update Agent balance tracking

This commit is contained in:
2025-10-03 15:30:39 +07:00
parent 43d301e47a
commit 7c13ad5f06
10 changed files with 101 additions and 210 deletions

View File

@@ -208,6 +208,28 @@ namespace Managing.Application.ManageBot
return await grain.GetConfiguration();
}
public async Task<IEnumerable<TradingBotConfig>> GetBotConfigsByIdsAsync(IEnumerable<Guid> botIds)
{
var configs = new List<TradingBotConfig>();
foreach (var botId in botIds)
{
try
{
var grain = _grainFactory.GetGrain<ILiveTradingBotGrain>(botId);
var config = await grain.GetConfiguration();
configs.Add(config);
}
catch (Exception ex)
{
_tradingBotLogger.LogWarning(ex, "Failed to get configuration for bot {BotId}", botId);
// Continue with other bots even if one fails
}
}
return configs;
}
public async Task<IEnumerable<string>> GetActiveBotsNamesAsync()
{
var bots = await _botRepository.GetBotsByStatusAsync(BotStatus.Running);