Implement A1, A6, A2: Add TraderPosition entity, PositionPnLEngine (Average-Cost-Method), Market-level WinRate, and integrate with TraderAnalyticsWorker
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Predictalytics.Application.Interfaces;
|
||||
|
||||
public interface IPositionPnLEngine
|
||||
{
|
||||
/// <summary>
|
||||
/// Recalculates all positions, average costs, and PnL values for a trader by re-playing their trade history.
|
||||
/// Updates the TraderPosition records in the database, calculates realized/unrealized PnL,
|
||||
/// and updates the Trader's TotalPnl and WinRate.
|
||||
/// </summary>
|
||||
Task RecalculateTraderPositionsAsync(int traderId, CancellationToken ct = default);
|
||||
}
|
||||
Reference in New Issue
Block a user