aiden-shared-calculations-unified 1.0.153 → 1.0.155

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.
@@ -40,7 +40,6 @@ class GlobalAumPerAsset30D {
40
40
  // Result: { AAPL: 5000000, TSLA: ... }
41
41
  this.results = globalTotals;
42
42
 
43
- // Return for potential debugging or further chaining
44
43
  return this.results;
45
44
  }
46
45
 
@@ -45,8 +45,6 @@ class PIDailyAssetAUM {
45
45
 
46
46
  if (historicalAum > 0) {
47
47
  piAum = historicalAum;
48
- // Optional: Log that we used historical data
49
- // context.logger.log('INFO', `Using historical AUM for ${userId} from ${dateKey}: $${piAum}`);
50
48
  break;
51
49
  }
52
50
  }
@@ -66,10 +64,9 @@ class PIDailyAssetAUM {
66
64
  const ticker = context.mappings.instrumentToTicker[instId] || `ID:${instId}`;
67
65
 
68
66
  // Get Weight (%)
69
- const pct = extract.getPositionWeight(pos); // Uses Invested or Amount based on schema
67
+ const pct = extract.getPositionWeight(pos);
70
68
 
71
69
  // Calculate $ Value: AUM * (Weight / 100)
72
- // Note: Ensure pct is treated as percentage (e.g. 5.5 = 5.5%)
73
70
  if (pct > 0) {
74
71
  const usdValue = piAum * (pct / 100);
75
72
 
@@ -79,10 +76,10 @@ class PIDailyAssetAUM {
79
76
  });
80
77
 
81
78
  // --- STEP C: Output Results ---
82
- // Format: { [UserId]: { Ticker: $Amount } }
83
- this.results = {
84
- [userId]: allocationMap
85
- };
79
+ // CRITICAL FIX: Accumulate results, do not overwrite 'this.results'
80
+ if (!this.results) this.results = {};
81
+
82
+ this.results[userId] = allocationMap;
86
83
 
87
84
  return this.results;
88
85
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiden-shared-calculations-unified",
3
- "version": "1.0.153",
3
+ "version": "1.0.155",
4
4
  "description": "Shared calculation modules for the BullTrackers Computation System.",
5
5
  "main": "index.js",
6
6
  "files": [