Remove endpoint update generatedClient
This commit is contained in:
@@ -383,49 +383,6 @@ public class DataController : ControllerBase
|
||||
return Ok(topStrategiesByRoi);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the top 3 performing agents based on PnL.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="TopAgentsByPnLViewModel"/> containing the top performing agents by PnL.</returns>
|
||||
[HttpGet("GetTopAgentsByPnL")]
|
||||
public async Task<ActionResult<TopAgentsByPnLViewModel>> GetTopAgentsByPnL()
|
||||
{
|
||||
try
|
||||
{
|
||||
// Get all agent summaries
|
||||
var allAgentSummaries = await _mediator.Send(new GetAllAgentSummariesCommand());
|
||||
|
||||
// Filter agents with valid PnL data and order by NetPnL
|
||||
var agentsWithPnL = allAgentSummaries
|
||||
.Where(agent => agent.NetPnL != 0) // Only include agents with actual NetPnL
|
||||
.OrderByDescending(agent => agent.NetPnL)
|
||||
.Take(3)
|
||||
.ToList();
|
||||
|
||||
// Map to view model
|
||||
var topAgentsByPnL = new TopAgentsByPnLViewModel
|
||||
{
|
||||
TopAgentsByPnL = agentsWithPnL
|
||||
.Select(agent => new AgentPerformance
|
||||
{
|
||||
AgentName = agent.AgentName,
|
||||
PnL = agent.TotalPnL,
|
||||
NetPnL = agent.NetPnL,
|
||||
TotalROI = agent.TotalROI,
|
||||
TotalVolume = agent.TotalVolume,
|
||||
ActiveStrategiesCount = agent.ActiveStrategiesCount,
|
||||
TotalBalance = agent.TotalBalance
|
||||
})
|
||||
.ToList()
|
||||
};
|
||||
|
||||
return Ok(topAgentsByPnL);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return StatusCode(500, $"Error retrieving top agents by PnL: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves list of the active strategies for a user with detailed information
|
||||
|
||||
Reference in New Issue
Block a user