Add volume history to platform summary

This commit is contained in:
2025-08-15 21:27:07 +07:00
parent 4292e9e02f
commit b4f6dc871b
8 changed files with 67 additions and 1 deletions

View File

@@ -39,6 +39,11 @@ public interface IPlatformSummaryGrain : IGrainWithStringKey
/// </summary>
Task<int> GetTotalPositionCountAsync();
/// <summary>
/// Gets the daily volume history for the last 30 days for chart visualization
/// </summary>
Task<List<VolumeHistoryPoint>> GetVolumeHistoryAsync();
// Event handlers for immediate updates
/// <summary>
/// Updates the active strategy count

View File

@@ -130,3 +130,5 @@ public class DailySnapshot
[Id(6)]
public int TotalPositionCount { get; set; }
}

View File

@@ -119,4 +119,29 @@ public class PlatformSummaryViewModel
/// </summary>
[Id(17)]
public required DateTime Last24HourSnapshot { get; set; }
/// <summary>
/// Daily volume history for the last 30 days for chart visualization
/// </summary>
[Id(18)]
public required List<VolumeHistoryPoint> VolumeHistory { get; set; }
}
/// <summary>
/// Represents a volume data point for historical charting
/// </summary>
[GenerateSerializer]
public class VolumeHistoryPoint
{
/// <summary>
/// Date of the volume measurement
/// </summary>
[Id(0)]
public required DateTime Date { get; set; }
/// <summary>
/// Total volume for that date in USD
/// </summary>
[Id(1)]
public required decimal Volume { get; set; }
}