Fix API offset limit 400 Bad Request, implement requested UI/UX improvements

This commit is contained in:
Richard
2026-07-06 22:34:33 +02:00
parent fb703b6c81
commit 10eefd3546
35 changed files with 4900 additions and 145 deletions
@@ -83,6 +83,30 @@ public class TraderAnalyticsWorker : BackgroundService
using var traderScope = _services.CreateScope();
var pnlEngine = traderScope.ServiceProvider.GetRequiredService<IPositionPnLEngine>();
await pnlEngine.RecalculateTraderPositionsAsync(id, ct);
// Run CopytradingEstimator
var traderRepo = traderScope.ServiceProvider.GetRequiredService<ITraderRepository>();
var tradeRepo = traderScope.ServiceProvider.GetRequiredService<ITradeRepository>();
var estimator = traderScope.ServiceProvider.GetRequiredService<ICopytradingEstimator>();
var trader = await traderRepo.GetByIdAsync(id, ct);
if (trader != null)
{
var trades = await tradeRepo.GetByTraderIdAsync(id, 0, 1000, ct);
if (trades.Count > 0)
{
var estScores = await estimator.CalculateScoresAsync(trader, trades, ct);
var scoreObj = trader.CurrentScore ?? new Predictalytics.Domain.Entities.TraderScore { TraderId = trader.Id };
// Persist advanced copyability and quality scores derived from tape replay
scoreObj.CopytradingScore = estScores.CopyabilityScore;
scoreObj.QualityScore = estScores.QualityScore;
scoreObj.CalculatedAt = DateTime.UtcNow;
trader.CurrentScore = scoreObj;
await traderRepo.UpdateAsync(trader, ct);
}
}
if (activeJob != null && activeJob.TraderId == id)
{