Fix agent volume

This commit is contained in:
2025-10-08 19:57:19 +07:00
parent 1a99224d18
commit b2a4e1ca5d
3 changed files with 16 additions and 6 deletions

View File

@@ -9,6 +9,7 @@ using Managing.Common;
using Managing.Core;
using Managing.Core.Exceptions;
using Managing.Domain.Bots;
using Managing.Domain.Shared.Helpers;
using Managing.Domain.Statistics;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
@@ -174,7 +175,7 @@ public class AgentGrain : Grain, IAgentGrain
// Calculate aggregated statistics from position data
var totalPnL = positions.Sum(p => p.ProfitAndLoss?.Realized ?? 0);
var totalVolume = positions.Sum(p => p.Open.Price * p.Open.Quantity * p.Open.Leverage);
var totalVolume = TradingBox.GetTotalVolumeTraded(positions);
var collateral = positions.Sum(p => p.Open.Price * p.Open.Quantity);
var totalFees = positions.Sum(p => p.CalculateTotalFees());