hedgequantx 2.3.19 → 2.3.21
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.
- package/dist/lib/api.jsc +0 -0
- package/dist/lib/api2.jsc +0 -0
- package/dist/lib/core.jsc +0 -0
- package/dist/lib/core2.jsc +0 -0
- package/dist/lib/data.jsc +0 -0
- package/dist/lib/data2.jsc +0 -0
- package/dist/lib/decoder.jsc +0 -0
- package/dist/lib/m/mod1.jsc +0 -0
- package/dist/lib/m/mod2.jsc +0 -0
- package/dist/lib/n/r1.jsc +0 -0
- package/dist/lib/n/r2.jsc +0 -0
- package/dist/lib/n/r3.jsc +0 -0
- package/dist/lib/n/r4.jsc +0 -0
- package/dist/lib/n/r5.jsc +0 -0
- package/dist/lib/n/r6.jsc +0 -0
- package/dist/lib/n/r7.jsc +0 -0
- package/dist/lib/o/util1.jsc +0 -0
- package/dist/lib/o/util2.jsc +0 -0
- package/package.json +1 -1
- package/src/pages/algo/one-account.js +12 -17
package/dist/lib/api.jsc
CHANGED
|
Binary file
|
package/dist/lib/api2.jsc
CHANGED
|
Binary file
|
package/dist/lib/core.jsc
CHANGED
|
Binary file
|
package/dist/lib/core2.jsc
CHANGED
|
Binary file
|
package/dist/lib/data.jsc
CHANGED
|
Binary file
|
package/dist/lib/data2.jsc
CHANGED
|
Binary file
|
package/dist/lib/decoder.jsc
CHANGED
|
Binary file
|
package/dist/lib/m/mod1.jsc
CHANGED
|
Binary file
|
package/dist/lib/m/mod2.jsc
CHANGED
|
Binary file
|
package/dist/lib/n/r1.jsc
CHANGED
|
Binary file
|
package/dist/lib/n/r2.jsc
CHANGED
|
Binary file
|
package/dist/lib/n/r3.jsc
CHANGED
|
Binary file
|
package/dist/lib/n/r4.jsc
CHANGED
|
Binary file
|
package/dist/lib/n/r5.jsc
CHANGED
|
Binary file
|
package/dist/lib/n/r6.jsc
CHANGED
|
Binary file
|
package/dist/lib/n/r7.jsc
CHANGED
|
Binary file
|
package/dist/lib/o/util1.jsc
CHANGED
|
Binary file
|
package/dist/lib/o/util2.jsc
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -200,19 +200,9 @@ const launchAlgo = async (service, account, contract, config) => {
|
|
|
200
200
|
ui.addLog('info', `Target: $${dailyTarget} | Max Risk: $${maxRisk}`);
|
|
201
201
|
ui.addLog('info', 'Monitoring positions from API...');
|
|
202
202
|
|
|
203
|
-
//
|
|
204
|
-
const measureLatency = async () => {
|
|
205
|
-
try {
|
|
206
|
-
const start = Date.now();
|
|
207
|
-
await service.getPositions(account.accountId);
|
|
208
|
-
stats.latency = Date.now() - start;
|
|
209
|
-
} catch (e) {
|
|
210
|
-
stats.latency = 0;
|
|
211
|
-
}
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
// Poll data from API - 100% real data
|
|
203
|
+
// Poll data from API - 100% real data, measure latency during poll
|
|
215
204
|
const pollAPI = async () => {
|
|
205
|
+
const pollStart = Date.now();
|
|
216
206
|
try {
|
|
217
207
|
pollCount++;
|
|
218
208
|
|
|
@@ -290,17 +280,17 @@ const launchAlgo = async (service, account, contract, config) => {
|
|
|
290
280
|
ui.addLog('error', `SESSION MAX RISK! -$${Math.abs(stats.pnl).toFixed(2)}`);
|
|
291
281
|
}
|
|
292
282
|
|
|
283
|
+
// Update latency (measured during this poll)
|
|
284
|
+
stats.latency = Date.now() - pollStart;
|
|
285
|
+
|
|
293
286
|
} catch (e) {
|
|
287
|
+
stats.latency = Date.now() - pollStart;
|
|
294
288
|
ui.addLog('error', `API: ${e.message}`);
|
|
295
289
|
}
|
|
296
290
|
};
|
|
297
291
|
|
|
298
292
|
const refreshInterval = setInterval(() => { if (running) ui.render(stats); }, 250);
|
|
299
293
|
|
|
300
|
-
// Measure API latency every 5 seconds
|
|
301
|
-
measureLatency(); // Initial measurement
|
|
302
|
-
const latencyInterval = setInterval(() => { if (running) measureLatency(); }, 5000);
|
|
303
|
-
|
|
304
294
|
// Poll data from API every 2 seconds
|
|
305
295
|
pollAPI(); // Initial poll
|
|
306
296
|
const apiInterval = setInterval(() => { if (running) pollAPI(); }, 2000);
|
|
@@ -331,11 +321,16 @@ const launchAlgo = async (service, account, contract, config) => {
|
|
|
331
321
|
});
|
|
332
322
|
|
|
333
323
|
clearInterval(refreshInterval);
|
|
334
|
-
clearInterval(latencyInterval);
|
|
335
324
|
clearInterval(apiInterval);
|
|
336
325
|
if (cleanupKeys) cleanupKeys();
|
|
337
326
|
ui.cleanup();
|
|
338
327
|
|
|
328
|
+
// Ensure stdin is ready for prompts after algo cleanup
|
|
329
|
+
if (process.stdin.isTTY) {
|
|
330
|
+
process.stdin.setRawMode(false);
|
|
331
|
+
}
|
|
332
|
+
process.stdin.resume();
|
|
333
|
+
|
|
339
334
|
// Calculate duration
|
|
340
335
|
const durationMs = Date.now() - stats.startTime;
|
|
341
336
|
const hours = Math.floor(durationMs / 3600000);
|