Clean and update event

This commit is contained in:
2025-09-27 22:20:12 +07:00
parent 6d91c75ec2
commit d432549d26
13 changed files with 255 additions and 239 deletions

View File

@@ -19,31 +19,6 @@ public interface IPlatformSummaryGrain : IGrainWithStringKey
/// </summary>
Task RefreshDataAsync();
/// <summary>
/// Gets the total volume traded across all strategies
/// </summary>
Task<decimal> GetTotalVolumeAsync();
/// <summary>
/// Gets the total PnL across all strategies
/// </summary>
Task<decimal> GetTotalPnLAsync();
/// <summary>
/// Gets the total open interest across all positions
/// </summary>
Task<decimal> GetTotalOpenInterest();
/// <summary>
/// Gets the total number of open positions
/// </summary>
Task<int> GetTotalPositionCountAsync();
/// <summary>
/// Gets the total platform fees
/// </summary>
Task<decimal> GetTotalFeesAsync();
// Event handlers for immediate updates
/// <summary>
/// Updates the active strategy count
@@ -96,4 +71,10 @@ public class PositionOpenEvent : PlatformMetricsEvent
[Id(4)] public TradeDirection Direction { get; set; }
[Id(5)] public Guid PositionIdentifier { get; set; }
}
[GenerateSerializer]
public class PositionUpdatedEvent : PlatformMetricsEvent
{
[Id(1)] public Guid PositionIdentifier { get; set; }
}

View File

@@ -11,7 +11,7 @@ public class AgentSummaryUpdateEvent
{
[Id(0)] public Guid BotId { get; set; }
[Id(1)] public AgentSummaryEventType EventType { get; set; }
[Id(1)] public NotificationEventType EventType { get; set; }
[Id(2)] public DateTime Timestamp { get; set; } = DateTime.UtcNow;

View File

@@ -19,7 +19,6 @@ public interface ITradingService
Task<Scenario> GetScenarioByNameAsync(string scenario);
Task InsertPositionAsync(Position position);
Task UpdatePositionAsync(Position position);
Task UpdateTradeAsync(Trade trade);
Task<IndicatorBase> GetIndicatorByNameAsync(string strategy);
Task InsertScenarioAsync(Scenario scenario);
Task InsertIndicatorAsync(IndicatorBase indicatorBase);