@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
@@ -47,7 +47,8 @@ var import_chalk = __toESM(require("chalk"));
47
47
  var import_connectors = require("@tradejs/connectors");
48
48
  var import_connectors2 = require("@tradejs/node/connectors");
49
49
  var import_strategies = require("@tradejs/node/strategies");
50
- var import_timescale = require("@tradejs/infra/timescale");
50
+ var import_marketContext = require("@tradejs/infra/timescale/marketContext");
51
+ var import_client = require("@tradejs/infra/timescale/client");
51
52
 
52
53
  // src/lib/binanceMarketData.ts
53
54
  var MARKET_FEATURE_INTERVAL_MS = {
@@ -555,7 +556,7 @@ var backfillBinanceMarketContext = async (params, enabled) => {
555
556
  if (endMs <= Math.min(breadthStartMs, tradeFlowStartMs)) {
556
557
  return skippedBackfillResult();
557
558
  }
558
- await (0, import_timescale.waitForDbReady)();
559
+ await (0, import_client.waitForDbReady)();
559
560
  const connector = await getBinanceConnector({
560
561
  projectRoot: params.projectRoot,
561
562
  userName: params.userName
@@ -601,7 +602,7 @@ var backfillBinanceMarketContext = async (params, enabled) => {
601
602
  )
602
603
  );
603
604
  if (includeTradeFlow && referenceSymbols.length) {
604
- const coverage = await (0, import_timescale.getMarketTradeFlowCoverage)({
605
+ const coverage = await (0, import_marketContext.getMarketTradeFlowCoverage)({
605
606
  symbols: referenceSymbols,
606
607
  interval,
607
608
  startMs: tradeFlowStartMs,
@@ -685,7 +686,7 @@ var backfillBinanceMarketContext = async (params, enabled) => {
685
686
  const ts = row.ts.getTime();
686
687
  return ts >= chunk.startMs && ts <= chunk.endMs;
687
688
  });
688
- await (0, import_timescale.upsertMarketTradeFlowRows)(boundedRows);
689
+ await (0, import_marketContext.upsertMarketTradeFlowRows)(boundedRows);
689
690
  tradeFlowRows += boundedRows.length;
690
691
  chunkBar?.tick(1, {
691
692
  rows: tradeFlowRows,
@@ -713,7 +714,7 @@ var backfillBinanceMarketContext = async (params, enabled) => {
713
714
  });
714
715
  const plans = await Promise.all(
715
716
  breadthUniverses.map(async (definition) => {
716
- const coverage = await (0, import_timescale.getMarketBreadthCoverage)({
717
+ const coverage = await (0, import_marketContext.getMarketBreadthCoverage)({
717
718
  universe: definition.universe,
718
719
  interval,
719
720
  startMs: breadthStartMs,
@@ -814,7 +815,7 @@ var backfillBinanceMarketContext = async (params, enabled) => {
814
815
  const ts = row.ts.getTime();
815
816
  return ts >= chunk.startMs && ts <= chunk.endMs;
816
817
  });
817
- await (0, import_timescale.upsertMarketBreadthRows)(rows);
818
+ await (0, import_marketContext.upsertMarketBreadthRows)(rows);
818
819
  breadthRows += rows.length;
819
820
  }
820
821
  }
@@ -49,7 +49,8 @@ __export(coinMarketCapContextBackfill_exports, {
49
49
  module.exports = __toCommonJS(coinMarketCapContextBackfill_exports);
50
50
  var import_chalk = __toESM(require("chalk"));
51
51
  var import_async = require("@tradejs/core/async");
52
- var import_timescale = require("@tradejs/infra/timescale");
52
+ var import_marketContext = require("@tradejs/infra/timescale/marketContext");
53
+ var import_client = require("@tradejs/infra/timescale/client");
53
54
  var import_userSettings = require("@tradejs/infra/userSettings");
54
55
  var DAY_MS = 864e5;
55
56
  var DEFAULT_CONTEXT_MAX_AGE_MS = 48 * 60 * 6e4;
@@ -313,7 +314,7 @@ var logBackfillSourceDone = (params) => {
313
314
  )
314
315
  );
315
316
  };
316
- var markBackfillCoverage = (rows) => (0, import_timescale.upsertMarketContextBackfillCoverage)(rows);
317
+ var markBackfillCoverage = (rows) => (0, import_marketContext.upsertMarketContextBackfillCoverage)(rows);
317
318
  var coinMarketCapFetch = async (params) => {
318
319
  const url = new URL(`${getBaseUrl()}${params.path}`);
319
320
  for (const [key, value] of Object.entries(params.searchParams)) {
@@ -642,7 +643,7 @@ var backfillCoinMarketCapContext = async (params) => {
642
643
  if (toMs <= fromMs) return skippedResult();
643
644
  const exchangeLiquidityEnabled = isExchangeLiquidityBackfillEnabled();
644
645
  const fearGreedEnabled = isFearGreedBackfillEnabled();
645
- await (0, import_timescale.waitForDbReady)();
646
+ await (0, import_client.waitForDbReady)();
646
647
  const [
647
648
  globalDailyCoverage,
648
649
  referenceDailyCoverage,
@@ -655,66 +656,66 @@ var backfillCoinMarketCapContext = async (params) => {
655
656
  fearGreedBackfillCoverage,
656
657
  indexBackfillCoverage
657
658
  ] = await Promise.all([
658
- (0, import_timescale.getMarketGlobalContextCoverage)({
659
+ (0, import_marketContext.getMarketGlobalContextCoverage)({
659
660
  source: SOURCE_GLOBAL_DAILY,
660
661
  startMs: fromMs,
661
662
  endMs: toMs
662
663
  }),
663
- (0, import_timescale.getMarketReferenceAssetContextCoverage)({
664
+ (0, import_marketContext.getMarketReferenceAssetContextCoverage)({
664
665
  source: SOURCE_REFERENCE,
665
666
  symbols: REFERENCE_ASSETS.map((item) => item.symbol),
666
667
  interval: "1d",
667
668
  startMs: fromMs,
668
669
  endMs: toMs
669
670
  }),
670
- exchangeLiquidityEnabled ? (0, import_timescale.getMarketCmcExchangeLiquidityContextCoverage)({
671
+ exchangeLiquidityEnabled ? (0, import_marketContext.getMarketCmcExchangeLiquidityContextCoverage)({
671
672
  source: SOURCE_EXCHANGE_LIQUIDITY,
672
673
  interval: "1d",
673
674
  startMs: fromMs,
674
675
  endMs: toMs
675
676
  }) : Promise.resolve(null),
676
- fearGreedEnabled ? (0, import_timescale.getMarketCmcFearGreedContextCoverage)({
677
+ fearGreedEnabled ? (0, import_marketContext.getMarketCmcFearGreedContextCoverage)({
677
678
  source: SOURCE_FEAR_GREED,
678
679
  interval: "1d",
679
680
  startMs: fromMs,
680
681
  endMs: toMs
681
682
  }) : Promise.resolve(null),
682
- (0, import_timescale.getMarketCmcIndexContextCoverage)({
683
+ (0, import_marketContext.getMarketCmcIndexContextCoverage)({
683
684
  source: SOURCE_INDEX,
684
685
  indexSlugs: CMC_INDEXES.map((index) => index.slug),
685
686
  interval: "1d",
686
687
  startMs: fromMs,
687
688
  endMs: toMs
688
689
  }),
689
- (0, import_timescale.getMarketContextBackfillCoverage)({
690
+ (0, import_marketContext.getMarketContextBackfillCoverage)({
690
691
  source: SOURCE_GLOBAL_DAILY,
691
692
  scopes: [COVERAGE_SCOPE_ALL],
692
693
  interval: "1d",
693
694
  fromMs,
694
695
  toMs
695
696
  }),
696
- (0, import_timescale.getMarketContextBackfillCoverage)({
697
+ (0, import_marketContext.getMarketContextBackfillCoverage)({
697
698
  source: SOURCE_REFERENCE,
698
699
  scopes: REFERENCE_ASSETS.map((item) => item.symbol),
699
700
  interval: "1d",
700
701
  fromMs,
701
702
  toMs
702
703
  }),
703
- exchangeLiquidityEnabled ? (0, import_timescale.getMarketContextBackfillCoverage)({
704
+ exchangeLiquidityEnabled ? (0, import_marketContext.getMarketContextBackfillCoverage)({
704
705
  source: SOURCE_EXCHANGE_LIQUIDITY,
705
706
  scopes: [COVERAGE_SCOPE_ALL],
706
707
  interval: "1d",
707
708
  fromMs,
708
709
  toMs
709
710
  }) : Promise.resolve([]),
710
- fearGreedEnabled ? (0, import_timescale.getMarketContextBackfillCoverage)({
711
+ fearGreedEnabled ? (0, import_marketContext.getMarketContextBackfillCoverage)({
711
712
  source: SOURCE_FEAR_GREED,
712
713
  scopes: [COVERAGE_SCOPE_ALL],
713
714
  interval: "1d",
714
715
  fromMs,
715
716
  toMs
716
717
  }) : Promise.resolve([]),
717
- (0, import_timescale.getMarketContextBackfillCoverage)({
718
+ (0, import_marketContext.getMarketContextBackfillCoverage)({
718
719
  source: SOURCE_INDEX,
719
720
  scopes: CMC_INDEXES.map((index) => index.slug),
720
721
  interval: "1d",
@@ -905,7 +906,7 @@ var backfillCoinMarketCapContext = async (params) => {
905
906
  }
906
907
  });
907
908
  const rows = coinMarketCapGlobalPayloadToRows(payload, SOURCE_GLOBAL_DAILY);
908
- await (0, import_timescale.upsertMarketGlobalContextRows)(rows);
909
+ await (0, import_marketContext.upsertMarketGlobalContextRows)(rows);
909
910
  await markBackfillCoverage([
910
911
  {
911
912
  source: SOURCE_GLOBAL_DAILY,
@@ -939,7 +940,7 @@ var backfillCoinMarketCapContext = async (params) => {
939
940
  }
940
941
  });
941
942
  const rows = coinMarketCapHistoricalQuotesPayloadToRows(payload, "1d");
942
- await (0, import_timescale.upsertMarketReferenceAssetContextRows)(rows);
943
+ await (0, import_marketContext.upsertMarketReferenceAssetContextRows)(rows);
943
944
  await markBackfillCoverage(
944
945
  REFERENCE_ASSETS.map((asset) => ({
945
946
  source: SOURCE_REFERENCE,
@@ -978,7 +979,7 @@ var backfillCoinMarketCapContext = async (params) => {
978
979
  payload,
979
980
  "1d"
980
981
  );
981
- await (0, import_timescale.upsertMarketCmcExchangeLiquidityContextRows)(rows);
982
+ await (0, import_marketContext.upsertMarketCmcExchangeLiquidityContextRows)(rows);
982
983
  await markBackfillCoverage([
983
984
  {
984
985
  source: SOURCE_EXCHANGE_LIQUIDITY,
@@ -1023,7 +1024,7 @@ var backfillCoinMarketCapContext = async (params) => {
1023
1024
  const oldestPageTs = Math.min(...pageRows.map((row) => row.ts.getTime()));
1024
1025
  if (oldestPageTs < fromMs || pageRows.length < pageSize) break;
1025
1026
  }
1026
- await (0, import_timescale.upsertMarketCmcFearGreedContextRows)(rows);
1027
+ await (0, import_marketContext.upsertMarketCmcFearGreedContextRows)(rows);
1027
1028
  await markBackfillCoverage([
1028
1029
  {
1029
1030
  source: SOURCE_FEAR_GREED,
@@ -1057,7 +1058,7 @@ var backfillCoinMarketCapContext = async (params) => {
1057
1058
  }))
1058
1059
  );
1059
1060
  const rows = rowsByIndex.flatMap((item) => item.result.rows);
1060
- await (0, import_timescale.upsertMarketCmcIndexContextRows)(rows);
1061
+ await (0, import_marketContext.upsertMarketCmcIndexContextRows)(rows);
1061
1062
  await markBackfillCoverage(
1062
1063
  rowsByIndex.map(({ index, result }) => ({
1063
1064
  source: SOURCE_INDEX,
@@ -57,7 +57,8 @@ var import_progress = __toESM(require("progress"));
57
57
  var import_async = require("@tradejs/core/async");
58
58
  var import_constants = require("@tradejs/core/constants");
59
59
  var import_indicators = require("@tradejs/core/indicators");
60
- var import_timescale = require("@tradejs/infra/timescale");
60
+ var import_derivatives = require("@tradejs/infra/timescale/derivatives");
61
+ var import_client = require("@tradejs/infra/timescale/client");
61
62
  var import_userSettings = require("@tradejs/infra/userSettings");
62
63
  var HOUR_MS = 60 * 60 * 1e3;
63
64
  var DAY_MS = 24 * HOUR_MS;
@@ -573,13 +574,13 @@ var backfillDerivativesContext = async (params, enabled, mode) => {
573
574
  if (!intervalWindows.length) {
574
575
  return skippedBackfillResult();
575
576
  }
576
- await (0, import_timescale.waitForDbReady)();
577
+ await (0, import_client.waitForDbReady)();
577
578
  const edgesByInterval = /* @__PURE__ */ new Map();
578
579
  await Promise.all(
579
580
  intervalWindows.map(async ({ interval }) => {
580
581
  edgesByInterval.set(
581
582
  interval,
582
- await (0, import_timescale.getDerivativesDataEdgesForSymbols)(symbols, interval)
583
+ await (0, import_derivatives.getDerivativesDataEdgesForSymbols)(symbols, interval)
583
584
  );
584
585
  })
585
586
  );
@@ -596,14 +597,14 @@ var backfillDerivativesContext = async (params, enabled, mode) => {
596
597
  nowMs: coverageNowMs
597
598
  });
598
599
  const [coverageRows, liquidationCoverageRows] = await Promise.all([
599
- (0, import_timescale.getDerivativesBackfillCoverage)({
600
+ (0, import_derivatives.getDerivativesBackfillCoverage)({
600
601
  source: "coinalyze",
601
602
  symbols,
602
603
  interval: window.interval,
603
604
  fromMs: window.fromMs,
604
605
  toMs: window.toMs
605
606
  }),
606
- confirmedLiquidationWindow ? (0, import_timescale.getDerivativesMetricCoverage)({
607
+ confirmedLiquidationWindow ? (0, import_derivatives.getDerivativesMetricCoverage)({
607
608
  source: "coinalyze",
608
609
  metric: "liquidation",
609
610
  symbols,
@@ -774,7 +775,7 @@ var backfillDerivativesContext = async (params, enabled, mode) => {
774
775
  );
775
776
  for (const window of intervalWindows) {
776
777
  const { interval, intervalMs } = window;
777
- const edgesBySymbol = edgesByInterval.get(interval) ?? await (0, import_timescale.getDerivativesDataEdgesForSymbols)(
778
+ const edgesBySymbol = edgesByInterval.get(interval) ?? await (0, import_derivatives.getDerivativesDataEdgesForSymbols)(
778
779
  matches.map((item) => item.symbol),
779
780
  interval
780
781
  );
@@ -897,7 +898,7 @@ var backfillDerivativesContext = async (params, enabled, mode) => {
897
898
  );
898
899
  }
899
900
  if (rows.length) {
900
- await (0, import_timescale.upsertDerivatives)(rows);
901
+ await (0, import_derivatives.upsertDerivatives)(rows);
901
902
  totalRows += rows.length;
902
903
  }
903
904
  const confirmedLiquidationWindow = (0, import_indicators.resolveCoinalyzeConfirmedIntradayCoverage)({
@@ -925,7 +926,7 @@ var backfillDerivativesContext = async (params, enabled, mode) => {
925
926
  eventRowsCount
926
927
  };
927
928
  });
928
- await (0, import_timescale.applyDerivativesMetricCoverage)(metricCoverageRows);
929
+ await (0, import_derivatives.applyDerivativesMetricCoverage)(metricCoverageRows);
929
930
  for (const coverageRow of metricCoverageRows) {
930
931
  const symbol = coverageRow.symbol.toUpperCase();
931
932
  const ranges = liquidationCoverageRangesBySymbol.get(symbol) ?? [];
@@ -957,7 +958,7 @@ var backfillDerivativesContext = async (params, enabled, mode) => {
957
958
  rowsCount
958
959
  };
959
960
  });
960
- await (0, import_timescale.upsertDerivativesBackfillCoverage)(coverageRows);
961
+ await (0, import_derivatives.upsertDerivativesBackfillCoverage)(coverageRows);
961
962
  for (const coverageRow of coverageRows) {
962
963
  const symbol = coverageRow.symbol.toUpperCase();
963
964
  edgesBySymbol.set(
@@ -35,7 +35,7 @@ __export(hyperliquidWhaleBackfill_exports, {
35
35
  });
36
36
  module.exports = __toCommonJS(hyperliquidWhaleBackfill_exports);
37
37
  var import_progress = __toESM(require("progress"));
38
- var import_timescale = require("@tradejs/infra/timescale");
38
+ var import_hyperliquidWhales = require("@tradejs/infra/timescale/hyperliquidWhales");
39
39
  var import_strategies = require("@tradejs/node/strategies");
40
40
 
41
41
  // src/lib/hyperliquidWhaleData.ts
@@ -290,7 +290,7 @@ var backfillHyperliquidWhaleContext = async (params) => {
290
290
  };
291
291
  const fromMs = Math.floor(params.startMs / HYPERLIQUID_WHALE_BUCKET_MS) * HYPERLIQUID_WHALE_BUCKET_MS;
292
292
  const toMs = minuteCeil(params.endMs);
293
- const cached = await (0, import_timescale.hasHyperliquidWhaleBackfillCoverage)({
293
+ const cached = await (0, import_hyperliquidWhales.hasHyperliquidWhaleBackfillCoverage)({
294
294
  fromMs,
295
295
  toMs,
296
296
  ...identity
@@ -339,7 +339,7 @@ var backfillHyperliquidWhaleContext = async (params) => {
339
339
  items: whales.addresses,
340
340
  concurrency,
341
341
  worker: async (address) => {
342
- const previous = await (0, import_timescale.getHyperliquidWhaleWalletCoverage)({
342
+ const previous = await (0, import_hyperliquidWhales.getHyperliquidWhaleWalletCoverage)({
343
343
  address,
344
344
  fromMs,
345
345
  toMs,
@@ -366,8 +366,8 @@ var backfillHyperliquidWhaleContext = async (params) => {
366
366
  identity
367
367
  })
368
368
  ).filter((row) => row != null);
369
- await (0, import_timescale.upsertHyperliquidWhaleTradeEvents)(addressEvents);
370
- await (0, import_timescale.upsertHyperliquidWhaleWalletCoverage)({
369
+ await (0, import_hyperliquidWhales.upsertHyperliquidWhaleTradeEvents)(addressEvents);
370
+ await (0, import_hyperliquidWhales.upsertHyperliquidWhaleWalletCoverage)({
371
371
  address,
372
372
  fromMs,
373
373
  toMs,
@@ -385,7 +385,7 @@ var backfillHyperliquidWhaleContext = async (params) => {
385
385
  const normalizedError = error instanceof Error ? error : new Error(String(error));
386
386
  failures.push(normalizedError);
387
387
  failedWallets += 1;
388
- await (0, import_timescale.upsertHyperliquidWhaleWalletCoverage)({
388
+ await (0, import_hyperliquidWhales.upsertHyperliquidWhaleWalletCoverage)({
389
389
  address,
390
390
  fromMs,
391
391
  toMs,
@@ -404,7 +404,7 @@ var backfillHyperliquidWhaleContext = async (params) => {
404
404
  );
405
405
  }
406
406
  });
407
- const buckets = await (0, import_timescale.rebuildHyperliquidWhaleFlowRows)({
407
+ const buckets = await (0, import_hyperliquidWhales.rebuildHyperliquidWhaleFlowRows)({
408
408
  fromMs,
409
409
  toMs,
410
410
  ...identity
@@ -420,7 +420,7 @@ var backfillHyperliquidWhaleContext = async (params) => {
420
420
  }
421
421
  );
422
422
  let displayedCoverageBuckets = 0;
423
- const coverageBuckets = await (0, import_timescale.rebuildHyperliquidWhaleCoverageRows)({
423
+ const coverageBuckets = await (0, import_hyperliquidWhales.rebuildHyperliquidWhaleCoverageRows)({
424
424
  fromMs,
425
425
  toMs,
426
426
  expectedWhales: whales.addresses.length,
@@ -26,7 +26,7 @@ __export(hyperliquidWhaleStream_exports, {
26
26
  });
27
27
  module.exports = __toCommonJS(hyperliquidWhaleStream_exports);
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
@@ -194,7 +194,7 @@ var runHyperliquidWhaleStream = async (params) => {
194
194
  const flush = () => {
195
195
  if (!buffer.length) return writes;
196
196
  const batch = buffer.splice(0, buffer.length);
197
- writes = writes.then(() => (0, import_timescale.upsertHyperliquidWhaleTradeEvents)(batch));
197
+ writes = writes.then(() => (0, import_hyperliquidWhales.upsertHyperliquidWhaleTradeEvents)(batch));
198
198
  return writes;
199
199
  };
200
200
  const recordStreamCoverage = (toMs) => {
@@ -213,7 +213,7 @@ var runHyperliquidWhaleStream = async (params) => {
213
213
  })
214
214
  );
215
215
  streamCoverageToMs = toMs;
216
- writes = writes.then(() => (0, import_timescale.upsertHyperliquidWhaleCoverageRows)(rows));
216
+ writes = writes.then(() => (0, import_hyperliquidWhales.upsertHyperliquidWhaleCoverageRows)(rows));
217
217
  return writes;
218
218
  };
219
219
  const finalize = () => {
@@ -221,7 +221,7 @@ var runHyperliquidWhaleStream = async (params) => {
221
221
  const fromMs = Math.max(0, toMs - REBUILD_LOOKBACK_MS);
222
222
  recordStreamCoverage(toMs);
223
223
  writes = writes.then(
224
- () => (0, import_timescale.rebuildHyperliquidWhaleFlowRows)({
224
+ () => (0, import_hyperliquidWhales.rebuildHyperliquidWhaleFlowRows)({
225
225
  fromMs,
226
226
  toMs,
227
227
  deleteEventsBeforeMs: toMs - RAW_EVENT_RETENTION_MS,