aiden-shared-calculations-unified 1.0.26 → 1.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -95,21 +95,22 @@ class DailyUserActivityTracker {
95
95
 
96
96
  // 3. Check for reallocation (only possible if we have AggregatedPositions for both days)
97
97
  // This checks for changes in the 'Invested' percentage
98
+ // 3. Check for reallocation (only possible if we have AggregatedPositions for both days)
98
99
  if (yHasAgg && tHasAgg) {
99
100
  for (const tId of tIds) {
100
- // We know tId is also in yIds from the checks above
101
101
  const tInvested = tPosMap.get(tId).invested;
102
- const yInvested = yPosMap.get(yId).invested;
102
+ const yInvested = yPosMap.get(tId)?.invested ?? 0;
103
103
 
104
104
  // Check for a meaningful change (e.g., > 0.01% to avoid float noise)
105
105
  if (Math.abs(tInvested - yInvested) > 0.0001) {
106
106
  isActive = true;
107
107
  this.activityEvents.reallocation++;
108
- break; // Found activity
108
+ break;
109
109
  }
110
110
  }
111
111
  }
112
112
 
113
+
113
114
  if (isActive) {
114
115
  this.activeUserIds.add(userId);
115
116
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiden-shared-calculations-unified",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "description": "Shared calculation modules for the BullTrackers Computation System.",
5
5
  "main": "index.js",
6
6
  "files": [