Update Agent balance tracking
This commit is contained in:
@@ -5,7 +5,7 @@ using Managing.Infrastructure.Databases.InfluxDb.Abstractions;
|
||||
using Managing.Infrastructure.Databases.InfluxDb.Models;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Managing.Infrastructure.Databases;
|
||||
namespace Managing.Infrastructure.Databases.InfluxDb;
|
||||
|
||||
public class AgentBalanceRepository : IAgentBalanceRepository
|
||||
{
|
||||
@@ -26,8 +26,7 @@ public class AgentBalanceRepository : IAgentBalanceRepository
|
||||
var balanceDto = new AgentBalanceDto
|
||||
{
|
||||
AgentName = balance.AgentName,
|
||||
TotalValue = balance.TotalValue,
|
||||
TotalAccountUsdValue = balance.TotalAccountUsdValue,
|
||||
TotalBalanceValue = balance.TotalBalanceValue,
|
||||
BotsAllocationUsdValue = balance.BotsAllocationUsdValue,
|
||||
PnL = balance.PnL,
|
||||
Time = balance.Time
|
||||
@@ -57,8 +56,7 @@ public class AgentBalanceRepository : IAgentBalanceRepository
|
||||
return result.Select(balance => new AgentBalance
|
||||
{
|
||||
AgentName = balance.AgentName,
|
||||
TotalValue = balance.TotalValue,
|
||||
TotalAccountUsdValue = balance.TotalAccountUsdValue,
|
||||
TotalBalanceValue = balance.TotalBalanceValue,
|
||||
BotsAllocationUsdValue = balance.BotsAllocationUsdValue,
|
||||
PnL = balance.PnL,
|
||||
Time = balance.Time
|
||||
@@ -89,11 +87,10 @@ public class AgentBalanceRepository : IAgentBalanceRepository
|
||||
.Select(g => new AgentBalanceHistory
|
||||
{
|
||||
AgentName = g.Key,
|
||||
AgentBalances = g.Select(b => new AgentBalance
|
||||
AgentBalances = g.Select(b => new AgentBalance
|
||||
{
|
||||
AgentName = b.AgentName,
|
||||
TotalValue = b.TotalValue,
|
||||
TotalAccountUsdValue = b.TotalAccountUsdValue,
|
||||
TotalBalanceValue = b.TotalBalanceValue,
|
||||
BotsAllocationUsdValue = b.BotsAllocationUsdValue,
|
||||
PnL = b.PnL,
|
||||
Time = b.Time
|
||||
|
||||
@@ -7,9 +7,7 @@ public class AgentBalanceDto
|
||||
{
|
||||
[Column("agent_name", IsTag = true)] public string AgentName { get; set; }
|
||||
|
||||
[Column("total_value")] public decimal TotalValue { get; set; }
|
||||
|
||||
[Column("total_account_usd_value")] public decimal TotalAccountUsdValue { get; set; }
|
||||
[Column("total_balance_value")] public decimal TotalBalanceValue { get; set; }
|
||||
|
||||
[Column("bots_allocation_usd_value")] public decimal BotsAllocationUsdValue { get; set; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user