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.
|
@@ -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);
|
|
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
|
-
//
|
|
83
|
-
this.results = {
|
|
84
|
-
|
|
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
|
}
|