aiden-shared-calculations-unified 1.0.33 → 1.0.34
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.
|
@@ -121,22 +121,8 @@ class AssetCrowdFlow {
|
|
|
121
121
|
const avg_day1_value = this.asset_values[rawInstrumentId].day1_value_sum / this.user_count;
|
|
122
122
|
const avg_day2_value = this.asset_values[rawInstrumentId].day2_value_sum / this.user_count;
|
|
123
123
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
// Check priceMap presence
|
|
127
|
-
if (!this.priceMap || !this.priceMap[instrumentId]) {
|
|
128
|
-
console.debug(`[AssetCrowdFlow] Missing priceMap entry for instrumentId ${instrumentId} (${ticker})`);
|
|
129
|
-
} else {
|
|
130
|
-
const priceDay1 = this.priceMap[instrumentId][yesterdayStr];
|
|
131
|
-
const priceDay2 = this.priceMap[instrumentId][todayStr];
|
|
132
|
-
|
|
133
|
-
if (priceDay1 == null) console.debug(`[AssetCrowdFlow] Missing price for ${instrumentId} (${ticker}) on ${yesterdayStr}`);
|
|
134
|
-
if (priceDay2 == null) console.debug(`[AssetCrowdFlow] Missing price for ${instrumentId} (${ticker}) on ${todayStr}`);
|
|
135
|
-
|
|
136
|
-
if (priceDay1 != null && priceDay2 != null && priceDay1 > 0) {
|
|
137
|
-
priceChangePct = (priceDay2 - priceDay1) / priceDay1;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
124
|
+
// FIX to detect weekends and skip them
|
|
125
|
+
const priceChangePct = getDailyPriceChange(instrumentId, yesterdayStr, todayStr, this.priceMap);
|
|
140
126
|
|
|
141
127
|
if (priceChangePct === null) {
|
|
142
128
|
// <--- MODIFICATION: We no longer add a warning object. We just skip it.
|