Implement WinRate, Bankroll, Positions UI and add Trades30d to Analytics
This commit is contained in:
@@ -155,4 +155,14 @@ public class TraderRepository : ITraderRepository
|
||||
.Take(take)
|
||||
.ToListAsync(ct);
|
||||
}
|
||||
|
||||
public async Task<IReadOnlyList<TraderPosition>> GetPositionsAsync(int traderId, CancellationToken ct = default)
|
||||
{
|
||||
return await _db.TraderPositions
|
||||
.Include(p => p.MarketOutcome)
|
||||
.ThenInclude(o => o.Market)
|
||||
.Where(p => p.TraderId == traderId && (p.SharesHeld > 0 || p.RealizedPnl != 0))
|
||||
.OrderByDescending(p => p.LastTradeExecutedAt ?? DateTime.MinValue)
|
||||
.ToListAsync(ct);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user