bulltrackers-module 1.0.545 → 1.0.546
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.
|
@@ -108,22 +108,22 @@ async function processPortfolio(context, config, taskData, isPI) {
|
|
|
108
108
|
data.username = username;
|
|
109
109
|
|
|
110
110
|
if (isPI) {
|
|
111
|
-
// Deep Dive Logic for PIs
|
|
112
|
-
if (config.enablePiDeepPortfolio
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
} else {
|
|
125
|
-
|
|
126
|
-
}
|
|
111
|
+
// Deep Dive Logic for PIs - DISABLED
|
|
112
|
+
// if (config.enablePiDeepPortfolio === true) {
|
|
113
|
+
// const topPositions = (data.AggregatedPositions || []).sort((a, b) => b.Invested - a.Invested).slice(0, 10);
|
|
114
|
+
// const deepPositions = [];
|
|
115
|
+
// for (const pos of topPositions) {
|
|
116
|
+
// try {
|
|
117
|
+
// const posUrl = `${config.ETORO_API_POSITIONS_URL}?cid=${cid}&InstrumentID=${pos.InstrumentID}&client_request_id=${uuid}`;
|
|
118
|
+
// const deepRes = await fetchWithRetry(posUrl, requestOptions, proxyManager, logger, 'DeepPos', headerManager);
|
|
119
|
+
// deepPositions.push({ instrumentId: pos.InstrumentID, ...(await deepRes.json()) });
|
|
120
|
+
// } catch (e) {} // Skip failed deep positions
|
|
121
|
+
// }
|
|
122
|
+
// if (deepPositions.length) await storePopularInvestorPortfolio({ db, logger, collectionRegistry, cid, date: today, portfolioData: data, deepPortfolioData: { positions: deepPositions } });
|
|
123
|
+
// else await storePopularInvestorPortfolio({ db, logger, collectionRegistry, cid, date: today, portfolioData: data });
|
|
124
|
+
// } else {
|
|
125
|
+
await storePopularInvestorPortfolio({ db, logger, collectionRegistry, cid, date: today, portfolioData: data });
|
|
126
|
+
// }
|
|
127
127
|
} else {
|
|
128
128
|
await storeSignedInUserPortfolio({ db, logger, collectionRegistry, cid, date: today, portfolioData: data });
|
|
129
129
|
}
|