@tradejs/cli 2.0.18 → 2.0.19

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.
Files changed (41) hide show
  1. package/dist/cli.js +12810 -19565
  2. package/dist/lib/aiExport.js +1 -1607
  3. package/dist/lib/binanceMarketContextBackfill.js +7 -6
  4. package/dist/lib/coinMarketCapContextBackfill.js +19 -18
  5. package/dist/lib/derivativesContextBackfill.js +10 -9
  6. package/dist/lib/hyperliquidWhaleBackfill.js +8 -8
  7. package/dist/lib/hyperliquidWhaleStream.js +4 -4
  8. package/dist/lib/marketContextPrepare.js +83 -1686
  9. package/dist/lib/runEnvironment.js +14 -1666
  10. package/dist/lib/runFormatting.js +1 -1607
  11. package/dist/lib/runtimeDebugEvidence.js +2 -48
  12. package/dist/lib/runtimeRedis.js +6 -57
  13. package/dist/lib/runtimeStrategyBacktest.js +2 -48
  14. package/dist/scripts/aiExport.js +1 -1607
  15. package/dist/scripts/aiPocketSearch.js +1 -1607
  16. package/dist/scripts/aiTrain.js +17 -1623
  17. package/dist/scripts/backtest.js +110 -1759
  18. package/dist/scripts/binanceMarketIngest.js +5 -4
  19. package/dist/scripts/candlesMigrateProvider.js +6 -5186
  20. package/dist/scripts/cleanupMarketContext.js +4 -3
  21. package/dist/scripts/continuity.js +4 -3
  22. package/dist/scripts/derivativesIngest.js +6 -4
  23. package/dist/scripts/derivativesIngestCoinalyzeAll.js +5 -4
  24. package/dist/scripts/doctor.js +2 -5184
  25. package/dist/scripts/hyperliquidWhaleBackfill.js +8 -8
  26. package/dist/scripts/hyperliquidWhaleIngest.js +4 -4
  27. package/dist/scripts/hyperliquidWhalesUpdate.js +1 -1
  28. package/dist/scripts/migration.js +3 -3
  29. package/dist/scripts/mlExport.js +1 -1607
  30. package/dist/scripts/replay.js +133 -1782
  31. package/dist/scripts/replayRunner.js +133 -1782
  32. package/dist/scripts/replayRuntimeEvidence.js +2 -48
  33. package/dist/scripts/researchAuto.js +3 -49
  34. package/dist/scripts/results.js +1 -1607
  35. package/dist/scripts/runtimeEvidence.js +2 -48
  36. package/dist/scripts/runtimeParity.js +121 -1746
  37. package/dist/scripts/signals.js +1057 -2647
  38. package/dist/scripts/signalsDaemon.js +1051 -2608
  39. package/dist/scripts/signalsSummary.js +4 -26
  40. package/dist/workers/testerWorker.js +2 -2
  41. package/package.json +11 -9
@@ -37,7 +37,7 @@ var import_args = __toESM(require("args"));
37
37
 
38
38
  // src/lib/hyperliquidWhaleBackfill.ts
39
39
  var import_progress = __toESM(require("progress"));
40
- var import_timescale = require("@tradejs/infra/timescale");
40
+ var import_hyperliquidWhales = require("@tradejs/infra/timescale/hyperliquidWhales");
41
41
  var import_strategies = require("@tradejs/node/strategies");
42
42
 
43
43
  // src/lib/hyperliquidWhaleData.ts
@@ -292,7 +292,7 @@ var backfillHyperliquidWhaleContext = async (params) => {
292
292
  };
293
293
  const fromMs = Math.floor(params.startMs / HYPERLIQUID_WHALE_BUCKET_MS) * HYPERLIQUID_WHALE_BUCKET_MS;
294
294
  const toMs = minuteCeil(params.endMs);
295
- const cached = await (0, import_timescale.hasHyperliquidWhaleBackfillCoverage)({
295
+ const cached = await (0, import_hyperliquidWhales.hasHyperliquidWhaleBackfillCoverage)({
296
296
  fromMs,
297
297
  toMs,
298
298
  ...identity
@@ -341,7 +341,7 @@ var backfillHyperliquidWhaleContext = async (params) => {
341
341
  items: whales.addresses,
342
342
  concurrency,
343
343
  worker: async (address) => {
344
- const previous = await (0, import_timescale.getHyperliquidWhaleWalletCoverage)({
344
+ const previous = await (0, import_hyperliquidWhales.getHyperliquidWhaleWalletCoverage)({
345
345
  address,
346
346
  fromMs,
347
347
  toMs,
@@ -368,8 +368,8 @@ var backfillHyperliquidWhaleContext = async (params) => {
368
368
  identity
369
369
  })
370
370
  ).filter((row) => row != null);
371
- await (0, import_timescale.upsertHyperliquidWhaleTradeEvents)(addressEvents);
372
- await (0, import_timescale.upsertHyperliquidWhaleWalletCoverage)({
371
+ await (0, import_hyperliquidWhales.upsertHyperliquidWhaleTradeEvents)(addressEvents);
372
+ await (0, import_hyperliquidWhales.upsertHyperliquidWhaleWalletCoverage)({
373
373
  address,
374
374
  fromMs,
375
375
  toMs,
@@ -387,7 +387,7 @@ var backfillHyperliquidWhaleContext = async (params) => {
387
387
  const normalizedError = error instanceof Error ? error : new Error(String(error));
388
388
  failures.push(normalizedError);
389
389
  failedWallets += 1;
390
- await (0, import_timescale.upsertHyperliquidWhaleWalletCoverage)({
390
+ await (0, import_hyperliquidWhales.upsertHyperliquidWhaleWalletCoverage)({
391
391
  address,
392
392
  fromMs,
393
393
  toMs,
@@ -406,7 +406,7 @@ var backfillHyperliquidWhaleContext = async (params) => {
406
406
  );
407
407
  }
408
408
  });
409
- const buckets = await (0, import_timescale.rebuildHyperliquidWhaleFlowRows)({
409
+ const buckets = await (0, import_hyperliquidWhales.rebuildHyperliquidWhaleFlowRows)({
410
410
  fromMs,
411
411
  toMs,
412
412
  ...identity
@@ -422,7 +422,7 @@ var backfillHyperliquidWhaleContext = async (params) => {
422
422
  }
423
423
  );
424
424
  let displayedCoverageBuckets = 0;
425
- const coverageBuckets = await (0, import_timescale.rebuildHyperliquidWhaleCoverageRows)({
425
+ const coverageBuckets = await (0, import_hyperliquidWhales.rebuildHyperliquidWhaleCoverageRows)({
426
426
  fromMs,
427
427
  toMs,
428
428
  expectedWhales: whales.addresses.length,
@@ -26,7 +26,7 @@ module.exports = __toCommonJS(hyperliquidWhaleIngest_exports);
26
26
 
27
27
  // src/lib/hyperliquidWhaleStream.ts
28
28
  var import_ws = require("ws");
29
- var import_timescale = require("@tradejs/infra/timescale");
29
+ var import_hyperliquidWhales = require("@tradejs/infra/timescale/hyperliquidWhales");
30
30
  var import_strategies = require("@tradejs/node/strategies");
31
31
 
32
32
  // src/lib/hyperliquidWhaleData.ts
@@ -186,7 +186,7 @@ var runHyperliquidWhaleStream = async (params) => {
186
186
  const flush = () => {
187
187
  if (!buffer.length) return writes;
188
188
  const batch = buffer.splice(0, buffer.length);
189
- writes = writes.then(() => (0, import_timescale.upsertHyperliquidWhaleTradeEvents)(batch));
189
+ writes = writes.then(() => (0, import_hyperliquidWhales.upsertHyperliquidWhaleTradeEvents)(batch));
190
190
  return writes;
191
191
  };
192
192
  const recordStreamCoverage = (toMs) => {
@@ -205,7 +205,7 @@ var runHyperliquidWhaleStream = async (params) => {
205
205
  })
206
206
  );
207
207
  streamCoverageToMs = toMs;
208
- writes = writes.then(() => (0, import_timescale.upsertHyperliquidWhaleCoverageRows)(rows));
208
+ writes = writes.then(() => (0, import_hyperliquidWhales.upsertHyperliquidWhaleCoverageRows)(rows));
209
209
  return writes;
210
210
  };
211
211
  const finalize = () => {
@@ -213,7 +213,7 @@ var runHyperliquidWhaleStream = async (params) => {
213
213
  const fromMs = Math.max(0, toMs - REBUILD_LOOKBACK_MS);
214
214
  recordStreamCoverage(toMs);
215
215
  writes = writes.then(
216
- () => (0, import_timescale.rebuildHyperliquidWhaleFlowRows)({
216
+ () => (0, import_hyperliquidWhales.rebuildHyperliquidWhaleFlowRows)({
217
217
  fromMs,
218
218
  toMs,
219
219
  deleteEventsBeforeMs: toMs - RAW_EVENT_RETENTION_MS,
@@ -40,7 +40,7 @@ var import_strategies2 = require("@tradejs/node/strategies");
40
40
 
41
41
  // src/lib/hyperliquidWhaleBackfill.ts
42
42
  var import_progress = __toESM(require("progress"));
43
- var import_timescale = require("@tradejs/infra/timescale");
43
+ var import_hyperliquidWhales = require("@tradejs/infra/timescale/hyperliquidWhales");
44
44
  var import_strategies = require("@tradejs/node/strategies");
45
45
 
46
46
  // src/lib/hyperliquidWhaleData.ts
@@ -37,7 +37,7 @@ var import_progress = __toESM(require("progress"));
37
37
  var import_chalk = __toESM(require("chalk"));
38
38
  var import_logger = require("@tradejs/infra/logger");
39
39
  var import_files = require("@tradejs/infra/files");
40
- var import_timescale = require("@tradejs/infra/timescale");
40
+ var import_candles = require("@tradejs/infra/timescale/candles");
41
41
  var DIR = "data/history";
42
42
  var re = /^(.+?)_(\d+)\.json$/;
43
43
  var BATCH = 2e3;
@@ -53,9 +53,9 @@ var migrateFile = async (file) => {
53
53
  [],
54
54
  projectRoot
55
55
  );
56
- const rows = (0, import_timescale.toRows)("bybit", symbol, interval, data);
56
+ const rows = (0, import_candles.toRows)("bybit", symbol, interval, data);
57
57
  for (let i = 0; i < rows.length; i += BATCH) {
58
- await (0, import_timescale.upsertCandles)(rows.slice(i, i + BATCH));
58
+ await (0, import_candles.upsertCandles)(rows.slice(i, i + BATCH));
59
59
  }
60
60
  };
61
61
  var main = async () => {