Update Agent balance tracking
This commit is contained in:
@@ -413,10 +413,11 @@ public class DataController : ControllerBase
|
||||
|
||||
// Convert to detailed view model with additional information using separate scopes to avoid DbContext concurrency
|
||||
var result = await Task.WhenAll(
|
||||
userStrategies.Select(strategy =>
|
||||
userStrategies.Select(strategy =>
|
||||
ServiceScopeHelpers.WithScopedService<ITradingService, UserStrategyDetailsViewModel>(
|
||||
_serviceScopeFactory,
|
||||
async tradingService => await MapStrategyToViewModelAsync(strategy, agentBalanceHistory, tradingService)))
|
||||
_serviceScopeFactory,
|
||||
async tradingService =>
|
||||
await MapStrategyToViewModelAsync(strategy, agentBalanceHistory, tradingService)))
|
||||
);
|
||||
|
||||
return Ok(result);
|
||||
@@ -487,7 +488,7 @@ public class DataController : ControllerBase
|
||||
|
||||
// Convert agent balance history to wallet balances dictionary
|
||||
var walletBalances = agentBalanceHistory?.AgentBalances?
|
||||
.ToDictionary(b => b.Time, b => b.TotalValue) ?? new Dictionary<DateTime, decimal>();
|
||||
.ToDictionary(b => b.Time, b => b.TotalBalanceValue) ?? new Dictionary<DateTime, decimal>();
|
||||
|
||||
return new UserStrategyDetailsViewModel
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user