{platformData?.dailySnapshots && platformData.dailySnapshots.length > 0 ? (
- [...platformData.dailySnapshots]
- .sort((a, b) => new Date(a.date || 0).getTime() - new Date(b.date || 0).getTime())
- .slice(-7) // Last 7 days
- .map((snapshot, index) => {
- const maxVolume = Math.max(...platformData.dailySnapshots?.map(s => s.totalVolume || 0) || [0])
- const height = maxVolume > 0 ? ((snapshot.totalVolume || 0) / maxVolume) * 100 : 0
- return (
-
- )
- })
+ <>
+ {/* Historical data bars */}
+ {[...platformData.dailySnapshots]
+ .sort((a, b) => new Date(a.date || 0).getTime() - new Date(b.date || 0).getTime())
+ .slice(-7) // Last 7 days
+ .map((snapshot, index) => {
+ const maxVolume = Math.max(...platformData.dailySnapshots?.map(s => s.totalVolume || 0) || [0], platformData?.totalPlatformVolume || 0)
+ const height = maxVolume > 0 ? ((snapshot.totalVolume || 0) / maxVolume) * 100 : 0
+ return (
+
+ )
+ })}
+ {/* Current data bar */}
+
{
+ const maxVolume = Math.max(...platformData.dailySnapshots?.map(s => s.totalVolume || 0) || [0], platformData?.totalPlatformVolume || 0)
+ const height = maxVolume > 0 ? ((platformData?.totalPlatformVolume || 0) / maxVolume) * 100 : 0
+ return Math.max(height, 4)
+ })()}%`
+ }}
+ title={`Current Total: ${formatCurrency(platformData?.totalPlatformVolume || 0)}`}
+ />
+ >
) : (
)}
@@ -372,9 +388,13 @@ function PlatformSummary({index}: { index: number }) {
{formatNumber(platformData?.positionCountByDirection?.Long || 0)}
- {platformData?.totalPositionCount ?
- ((platformData.positionCountByDirection?.Long || 0) / platformData.totalPositionCount * 100).toFixed(1) : 0}%
- of total
+ {(() => {
+ const longCount = platformData?.positionCountByDirection?.Long || 0;
+ const shortCount = platformData?.positionCountByDirection?.Short || 0;
+ const total = longCount + shortCount;
+ if (total === 0) return '0%';
+ return ((longCount / total) * 100).toFixed(1) + '%';
+ })()} of total positions
@@ -384,13 +404,35 @@ function PlatformSummary({index}: { index: number }) {
{formatNumber(platformData?.positionCountByDirection?.Short || 0)}
- {platformData?.totalPositionCount ?
- ((platformData.positionCountByDirection?.Short || 0) / platformData.totalPositionCount * 100).toFixed(1) : 0}%
- of total
+ {(() => {
+ const longCount = platformData?.positionCountByDirection?.Long || 0;
+ const shortCount = platformData?.positionCountByDirection?.Short || 0;
+ const total = longCount + shortCount;
+ if (total === 0) return '0%';
+ return ((shortCount / total) * 100).toFixed(1) + '%';
+ })()} of total positions
+ {/* Platform Metrics Chart */}
+