dexbot 1.4.17 → 1.4.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 (247) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +1 -0
  3. package/analysis/README.md +43 -43
  4. package/analysis/ama_fitting/README.md +8 -8
  5. package/analysis/ama_fitting/package.json +1 -1
  6. package/analysis/bot_fitting/README.md +4 -4
  7. package/analysis/bot_fitting/backtest_ama_sweep.ts +1 -1
  8. package/analysis/bot_usage/discover_bot_accounts.ts +11 -11
  9. package/analysis/tradingview/README.md +4 -4
  10. package/analysis/trend_detection/DYNAMIC_WEIGHT_RESEARCH.md +2 -2
  11. package/analysis/trend_detection/SIGNAL_DOCUMENTATION.md +1 -1
  12. package/analysis/trend_detection/package.json +1 -1
  13. package/claw/README.md +45 -45
  14. package/claw/docs/AI_BOT_LIBRARY_API.md +6 -6
  15. package/claw/examples/short_mpa_bts_strategy.ts +3 -3
  16. package/claw/package.json +21 -21
  17. package/claw/runtimes/openclaw-plugin/openclaw.plugin.json +1 -1
  18. package/claw/runtimes/openclaw-plugin/package.json +1 -1
  19. package/claw/scripts/claw_bridge.ts +2 -2
  20. package/claw/scripts/claw_skill_md.ts +1 -1
  21. package/claw/skills/launcher-ops/references/launcher-workflow.md +5 -5
  22. package/claw/skills/margin-trading/references/honest-asset-list.md +1 -1
  23. package/claw/skills/memu-memory/SKILL.md +3 -3
  24. package/claw/tests/test_claw_mcp_transport.ts +2 -2
  25. package/dist/analysis/ama_fitting/analyze_ama_price_changes.d.ts +3 -0
  26. package/dist/analysis/ama_fitting/analyze_ama_price_changes.d.ts.map +1 -0
  27. package/dist/analysis/ama_fitting/analyze_ama_price_changes.js +148 -0
  28. package/dist/analysis/ama_fitting/analyze_ama_price_changes.js.map +1 -0
  29. package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.d.ts +12 -0
  30. package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.d.ts.map +1 -0
  31. package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.js +389 -0
  32. package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.js.map +1 -0
  33. package/dist/analysis/ama_fitting/calibrate_convergence_er.d.ts +3 -0
  34. package/dist/analysis/ama_fitting/calibrate_convergence_er.d.ts.map +1 -0
  35. package/dist/analysis/ama_fitting/calibrate_convergence_er.js +200 -0
  36. package/dist/analysis/ama_fitting/calibrate_convergence_er.js.map +1 -0
  37. package/dist/analysis/ama_fitting/fetch_lp_candles.d.ts +3 -0
  38. package/dist/analysis/ama_fitting/fetch_lp_candles.d.ts.map +1 -0
  39. package/dist/analysis/ama_fitting/fetch_lp_candles.js +213 -0
  40. package/dist/analysis/ama_fitting/fetch_lp_candles.js.map +1 -0
  41. package/dist/analysis/ama_fitting/generate_unified_comparison_chart.d.ts +25 -0
  42. package/dist/analysis/ama_fitting/generate_unified_comparison_chart.d.ts.map +1 -0
  43. package/dist/analysis/ama_fitting/generate_unified_comparison_chart.js +247 -0
  44. package/dist/analysis/ama_fitting/generate_unified_comparison_chart.js.map +1 -0
  45. package/dist/analysis/ama_fitting/optimizer_high_resolution.d.ts +35 -0
  46. package/dist/analysis/ama_fitting/optimizer_high_resolution.d.ts.map +1 -0
  47. package/dist/analysis/ama_fitting/optimizer_high_resolution.js +782 -0
  48. package/dist/analysis/ama_fitting/optimizer_high_resolution.js.map +1 -0
  49. package/dist/analysis/analyze_derivatives.d.ts +86 -0
  50. package/dist/analysis/analyze_derivatives.d.ts.map +1 -0
  51. package/dist/analysis/analyze_derivatives.js +285 -0
  52. package/dist/analysis/analyze_derivatives.js.map +1 -0
  53. package/dist/analysis/analyze_dynamic_weight.d.ts +14 -0
  54. package/dist/analysis/analyze_dynamic_weight.d.ts.map +1 -0
  55. package/dist/analysis/analyze_dynamic_weight.js +197 -0
  56. package/dist/analysis/analyze_dynamic_weight.js.map +1 -0
  57. package/dist/analysis/analyze_kalman.d.ts +13 -0
  58. package/dist/analysis/analyze_kalman.d.ts.map +1 -0
  59. package/dist/analysis/analyze_kalman.js +118 -0
  60. package/dist/analysis/analyze_kalman.js.map +1 -0
  61. package/dist/analysis/analyze_regime.d.ts +20 -0
  62. package/dist/analysis/analyze_regime.d.ts.map +1 -0
  63. package/dist/analysis/analyze_regime.js +139 -0
  64. package/dist/analysis/analyze_regime.js.map +1 -0
  65. package/dist/analysis/analyze_regime_windows.d.ts +19 -0
  66. package/dist/analysis/analyze_regime_windows.d.ts.map +1 -0
  67. package/dist/analysis/analyze_regime_windows.js +414 -0
  68. package/dist/analysis/analyze_regime_windows.js.map +1 -0
  69. package/dist/analysis/analyze_risk_profile.d.ts +3 -0
  70. package/dist/analysis/analyze_risk_profile.d.ts.map +1 -0
  71. package/dist/analysis/analyze_risk_profile.js +186 -0
  72. package/dist/analysis/analyze_risk_profile.js.map +1 -0
  73. package/dist/analysis/analyze_trade_heatmap.d.ts +3 -0
  74. package/dist/analysis/analyze_trade_heatmap.d.ts.map +1 -0
  75. package/dist/analysis/analyze_trade_heatmap.js +358 -0
  76. package/dist/analysis/analyze_trade_heatmap.js.map +1 -0
  77. package/dist/analysis/analyze_volatility.d.ts +22 -0
  78. package/dist/analysis/analyze_volatility.d.ts.map +1 -0
  79. package/dist/analysis/analyze_volatility.js +165 -0
  80. package/dist/analysis/analyze_volatility.js.map +1 -0
  81. package/dist/analysis/bot_fitting/backtest_ama_sweep.d.ts +91 -0
  82. package/dist/analysis/bot_fitting/backtest_ama_sweep.d.ts.map +1 -0
  83. package/dist/analysis/bot_fitting/backtest_ama_sweep.js +792 -0
  84. package/dist/analysis/bot_fitting/backtest_ama_sweep.js.map +1 -0
  85. package/dist/analysis/bot_fitting/backtest_bot_fitting.d.ts +2 -0
  86. package/dist/analysis/bot_fitting/backtest_bot_fitting.d.ts.map +1 -0
  87. package/dist/analysis/bot_fitting/backtest_bot_fitting.js +380 -0
  88. package/dist/analysis/bot_fitting/backtest_bot_fitting.js.map +1 -0
  89. package/dist/analysis/bot_fitting/shared_utils.d.ts +26 -0
  90. package/dist/analysis/bot_fitting/shared_utils.d.ts.map +1 -0
  91. package/dist/analysis/bot_fitting/shared_utils.js +42 -0
  92. package/dist/analysis/bot_fitting/shared_utils.js.map +1 -0
  93. package/dist/analysis/bot_key_utils.d.ts +11 -0
  94. package/dist/analysis/bot_key_utils.d.ts.map +1 -0
  95. package/dist/analysis/bot_key_utils.js +153 -0
  96. package/dist/analysis/bot_key_utils.js.map +1 -0
  97. package/dist/analysis/bot_usage/discover_bot_accounts.d.ts +3 -0
  98. package/dist/analysis/bot_usage/discover_bot_accounts.d.ts.map +1 -0
  99. package/dist/analysis/bot_usage/discover_bot_accounts.js +499 -0
  100. package/dist/analysis/bot_usage/discover_bot_accounts.js.map +1 -0
  101. package/dist/analysis/bot_usage/kibana_bot_queries.d.ts +531 -0
  102. package/dist/analysis/bot_usage/kibana_bot_queries.d.ts.map +1 -0
  103. package/dist/analysis/bot_usage/kibana_bot_queries.js +399 -0
  104. package/dist/analysis/bot_usage/kibana_bot_queries.js.map +1 -0
  105. package/dist/analysis/chart_css.d.ts +17 -0
  106. package/dist/analysis/chart_css.d.ts.map +1 -0
  107. package/dist/analysis/chart_css.js +49 -0
  108. package/dist/analysis/chart_css.js.map +1 -0
  109. package/dist/analysis/chart_ui.d.ts +45 -0
  110. package/dist/analysis/chart_ui.d.ts.map +1 -0
  111. package/dist/analysis/chart_ui.js +97 -0
  112. package/dist/analysis/chart_ui.js.map +1 -0
  113. package/dist/analysis/chart_utils.d.ts +27 -0
  114. package/dist/analysis/chart_utils.d.ts.map +1 -0
  115. package/dist/analysis/chart_utils.js +153 -0
  116. package/dist/analysis/chart_utils.js.map +1 -0
  117. package/dist/analysis/derivative_chart_generator.d.ts +12 -0
  118. package/dist/analysis/derivative_chart_generator.d.ts.map +1 -0
  119. package/dist/analysis/derivative_chart_generator.js +891 -0
  120. package/dist/analysis/derivative_chart_generator.js.map +1 -0
  121. package/dist/analysis/math_utils.d.ts +22 -0
  122. package/dist/analysis/math_utils.d.ts.map +1 -0
  123. package/dist/analysis/math_utils.js +43 -0
  124. package/dist/analysis/math_utils.js.map +1 -0
  125. package/dist/analysis/price_sources.d.ts +40 -0
  126. package/dist/analysis/price_sources.d.ts.map +1 -0
  127. package/dist/analysis/price_sources.js +94 -0
  128. package/dist/analysis/price_sources.js.map +1 -0
  129. package/dist/analysis/resolve_source.d.ts +25 -0
  130. package/dist/analysis/resolve_source.d.ts.map +1 -0
  131. package/dist/analysis/resolve_source.js +69 -0
  132. package/dist/analysis/resolve_source.js.map +1 -0
  133. package/dist/analysis/trade_profitability.d.ts +115 -0
  134. package/dist/analysis/trade_profitability.d.ts.map +1 -0
  135. package/dist/analysis/trade_profitability.js +1240 -0
  136. package/dist/analysis/trade_profitability.js.map +1 -0
  137. package/dist/analysis/tradingview/analyze_tradingview.d.ts +31 -0
  138. package/dist/analysis/tradingview/analyze_tradingview.d.ts.map +1 -0
  139. package/dist/analysis/tradingview/analyze_tradingview.js +146 -0
  140. package/dist/analysis/tradingview/analyze_tradingview.js.map +1 -0
  141. package/dist/analysis/tradingview/tradingview_uplot_chart_generator.d.ts +5 -0
  142. package/dist/analysis/tradingview/tradingview_uplot_chart_generator.d.ts.map +1 -0
  143. package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js +1714 -0
  144. package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js.map +1 -0
  145. package/dist/analysis/trend_detection/derivative_analyzer.d.ts +247 -0
  146. package/dist/analysis/trend_detection/derivative_analyzer.d.ts.map +1 -0
  147. package/dist/analysis/trend_detection/derivative_analyzer.js +901 -0
  148. package/dist/analysis/trend_detection/derivative_analyzer.js.map +1 -0
  149. package/dist/analysis/trend_detection/dynamic_weight_chart_generator.d.ts +3 -0
  150. package/dist/analysis/trend_detection/dynamic_weight_chart_generator.d.ts.map +1 -0
  151. package/dist/analysis/trend_detection/dynamic_weight_chart_generator.js +1361 -0
  152. package/dist/analysis/trend_detection/dynamic_weight_chart_generator.js.map +1 -0
  153. package/dist/analysis/trend_detection/hurst_analyzer.d.ts +6 -0
  154. package/dist/analysis/trend_detection/hurst_analyzer.d.ts.map +1 -0
  155. package/dist/analysis/trend_detection/hurst_analyzer.js +7 -0
  156. package/dist/analysis/trend_detection/hurst_analyzer.js.map +1 -0
  157. package/dist/analysis/trend_detection/kalman_chart_generator.d.ts +3 -0
  158. package/dist/analysis/trend_detection/kalman_chart_generator.d.ts.map +1 -0
  159. package/dist/analysis/trend_detection/kalman_chart_generator.js +360 -0
  160. package/dist/analysis/trend_detection/kalman_chart_generator.js.map +1 -0
  161. package/dist/analysis/trend_detection/kalman_trend_analyzer.d.ts +8 -0
  162. package/dist/analysis/trend_detection/kalman_trend_analyzer.d.ts.map +1 -0
  163. package/dist/analysis/trend_detection/kalman_trend_analyzer.js +8 -0
  164. package/dist/analysis/trend_detection/kalman_trend_analyzer.js.map +1 -0
  165. package/dist/analysis/trend_detection/kalman_velocity_smoothing.d.ts +6 -0
  166. package/dist/analysis/trend_detection/kalman_velocity_smoothing.d.ts.map +1 -0
  167. package/dist/analysis/trend_detection/kalman_velocity_smoothing.js +7 -0
  168. package/dist/analysis/trend_detection/kalman_velocity_smoothing.js.map +1 -0
  169. package/dist/analysis/trend_detection/permutation_entropy_analyzer.d.ts +6 -0
  170. package/dist/analysis/trend_detection/permutation_entropy_analyzer.d.ts.map +1 -0
  171. package/dist/analysis/trend_detection/permutation_entropy_analyzer.js +7 -0
  172. package/dist/analysis/trend_detection/permutation_entropy_analyzer.js.map +1 -0
  173. package/dist/analysis/trend_detection/regime_chart_generator.d.ts +3 -0
  174. package/dist/analysis/trend_detection/regime_chart_generator.d.ts.map +1 -0
  175. package/dist/analysis/trend_detection/regime_chart_generator.js +310 -0
  176. package/dist/analysis/trend_detection/regime_chart_generator.js.map +1 -0
  177. package/dist/analysis/trend_detection/tests/test_kalman_trend.d.ts +2 -0
  178. package/dist/analysis/trend_detection/tests/test_kalman_trend.d.ts.map +1 -0
  179. package/dist/analysis/trend_detection/tests/test_kalman_trend.js +128 -0
  180. package/dist/analysis/trend_detection/tests/test_kalman_trend.js.map +1 -0
  181. package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.d.ts +2 -0
  182. package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.d.ts.map +1 -0
  183. package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.js +37 -0
  184. package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.js.map +1 -0
  185. package/dist/analysis/trend_detection/volatility_chart_generator.d.ts +3 -0
  186. package/dist/analysis/trend_detection/volatility_chart_generator.d.ts.map +1 -0
  187. package/dist/analysis/trend_detection/volatility_chart_generator.js +646 -0
  188. package/dist/analysis/trend_detection/volatility_chart_generator.js.map +1 -0
  189. package/dist/bot.js +1 -1
  190. package/dist/bot.js.map +1 -1
  191. package/dist/market_adapter/ama_signal_runner.js +1 -1
  192. package/dist/market_adapter/ama_signal_runner.js.map +1 -1
  193. package/dist/market_adapter/inputs/fetch_cex_synthetic_data.js +1 -1
  194. package/dist/modules/account_bots.d.ts +1 -0
  195. package/dist/modules/account_bots.d.ts.map +1 -1
  196. package/dist/modules/account_bots.js +27 -5
  197. package/dist/modules/account_bots.js.map +1 -1
  198. package/dist/modules/constants.d.ts +1 -0
  199. package/dist/modules/constants.d.ts.map +1 -1
  200. package/dist/modules/constants.js +12 -3
  201. package/dist/modules/constants.js.map +1 -1
  202. package/dist/modules/dexbot_class.d.ts +22 -0
  203. package/dist/modules/dexbot_class.d.ts.map +1 -1
  204. package/dist/modules/dexbot_class.js +27 -1
  205. package/dist/modules/dexbot_class.js.map +1 -1
  206. package/dist/modules/dexbot_cow_runtime.d.ts +48 -1
  207. package/dist/modules/dexbot_cow_runtime.d.ts.map +1 -1
  208. package/dist/modules/dexbot_cow_runtime.js +168 -4
  209. package/dist/modules/dexbot_cow_runtime.js.map +1 -1
  210. package/dist/modules/order/grid_reconcile_internal.d.ts.map +1 -1
  211. package/dist/modules/order/grid_reconcile_internal.js +6 -27
  212. package/dist/modules/order/grid_reconcile_internal.js.map +1 -1
  213. package/dist/modules/order/strategy.d.ts.map +1 -1
  214. package/dist/modules/order/strategy.js +6 -15
  215. package/dist/modules/order/strategy.js.map +1 -1
  216. package/dist/modules/order/utils/math.d.ts +29 -1
  217. package/dist/modules/order/utils/math.d.ts.map +1 -1
  218. package/dist/modules/order/utils/math.js +46 -1
  219. package/dist/modules/order/utils/math.js.map +1 -1
  220. package/dist/modules/order/utils/system.d.ts +2 -0
  221. package/dist/modules/order/utils/system.d.ts.map +1 -1
  222. package/dist/modules/order/utils/system.js +30 -2
  223. package/dist/modules/order/utils/system.js.map +1 -1
  224. package/dist/modules/runtime_settings.d.ts +1 -0
  225. package/dist/modules/runtime_settings.d.ts.map +1 -1
  226. package/dist/modules/runtime_settings.js +13 -2
  227. package/dist/modules/runtime_settings.js.map +1 -1
  228. package/dist/scripts/generate_lp_chart.js +1 -1
  229. package/dist/scripts/test-credit-renewal.js +1 -1
  230. package/docs/DEXBOT_COMPARISON.md +3 -3
  231. package/docs/EVOLUTION.md +26 -95
  232. package/docs/FUND_MOVEMENT_AND_ACCOUNTING.md +1 -1
  233. package/docs/GRID_RECALCULATION.md +2 -2
  234. package/docs/LIFECYCLE.md +207 -0
  235. package/docs/README.md +9 -1
  236. package/docs/developer_guide.md +4 -3
  237. package/market_adapter/README.md +23 -23
  238. package/package.json +18 -21
  239. package/scripts/README.md +12 -12
  240. package/scripts/bots +5 -7
  241. package/scripts/clear-market-adapter.sh +1 -1
  242. package/scripts/dexbot +5 -7
  243. package/scripts/keys +5 -7
  244. package/scripts/pm2 +5 -7
  245. package/scripts/unlock +5 -7
  246. package/scripts/update.js +6 -7
  247. package/scripts/repo-stats.html +0 -480
package/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.4.19] - 2026-08-21 - COW Broadcast Op Cap, Grid Divergence Rail Fix, UI Price Feedback
6
+
7
+ ### 2026-08-21
8
+
9
+ - **Feat(cow)**: enforce a per-broadcast operation cap — a single COW rebalance can expand one fill batch into many more order operations (4 fills → 12 creates + 4 updates = 16 ops), so `FILL_PROCESSING.MAX_FILL_BATCH_SIZE` is a weak proxy for on-chain transaction size. `COW_PERFORMANCE.MAX_OPS_PER_BROADCAST` (default 4) now caps operations per broadcast; oversized batches are split into sequential transactions via `executeChunkedWithRetryOnUncertain`, restoring the original "N fills per broadcast" intent at the op level. An uncertain chunk failure continues broadcasting the remaining chunks (no order dropped); a definitively rejected chunk aborts the rest; the first failure is rethrown enriched with `partialOnChainState`, `chunksTotal`/`chunksFailed`/`chunksAborted`, and `broadcastedOperationCount`. Configurable via the runtime settings override chain (`runtimeCowPerformance`/`marketCowPerformance`/`botCowPerformance`). Covered by the new 463-line `test_cow_ops_per_broadcast.ts` (`modules/dexbot_cow_runtime.ts`, `modules/constants.ts`, `modules/dexbot_class.ts`, `modules/runtime_settings.ts`).
10
+ - **Fix(grid)**: exclude gap-band strays from divergence desired-window selection — a fund-driven boundary shift during `applyGridDivergenceCorrections` re-types the working grid, but the SPREAD GUARD keeps live on-chain orders inside the new spread band typed BUY/SELL, so the Phase-2 window selected "closest to market" slots purely by stored type+price and a stray SELL inside the new gap looked like the bottom of the sell rail and was never relocated, collapsing the real spread (boundary 107→110 left sells at 111–113 inside the new gap, real spread 0.5% vs the 2.0% target). New shared `MathUtils.isSlotInRail` (pure geometric rail-membership test) now filters desired-window candidates using the working boundary; the strategy window and virtual-slot selection delegate to the same helper, and gap-band strays become surplus → cancelled and relocated back onto the rail (`modules/order/utils/math.ts`, `modules/order/utils/system.ts`, `modules/order/strategy.ts`, `modules/order/grid_reconcile_internal.ts`, `tests/test_is_slot_in_rail.ts`, `tests/test_cow_divergence_correction.ts`, `tests/test_lp_chart.ts`).
11
+ - **Tune**: lower the AMA slope grid-reset threshold from 10 to 8 — the AMA slope delta trigger resets the grid when the slope swing exceeds (`AMA_SLOPE_DELTA_THRESHOLD_PERCENT`/100) × maxSlopePct. At 10 the XRP-BTS trend reversal (DOWN baseline → UP current, delta 0.0074%/bar) stayed below the 0.0085 threshold, leaving the grid scaled for the wrong direction. Lowering to 8 (threshold 0.0068%/bar) reacts to the reversal while still ignoring small slope noise (`modules/constants.ts`).
12
+ - **Feat(ui)**: green/red relative-scaling feedback for price inputs — the bot editor's Price Range displayed min/max as plain white, hiding whether relative scaling (x multipliers) is active. Range values now render green for "1.55x" multipliers and red for fixed prices, and `readInput` gains a colorize option so the typed input switches red → green live the moment the "x" is entered (`modules/account_bots.ts`, `modules/order/utils/system.ts`).
13
+ - **Fix(ui)**: clarify the GridPrice label in the bot editor — the Price section displayed the gridPrice reference as bare "Grid:", which was ambiguous next to "Start:"/"Pool:" and collided with the section "4) Grid". Renamed to "GridPrice:" (one word, matching the `gridPrice` config field name) to reflect the values it accepts (pool/book/ama/number/none) (`modules/account_bots.ts`).
14
+ - **Docs**: add an end-to-end lifecycle walkthrough — new `docs/LIFECYCLE.md` consolidates the startup, fill-driven (reactive), and maintenance/AMA-driven (periodic) flows into one newcomer-facing map with mermaid system-context and sequence diagrams (fill → `_incomingFillQueue` → `processFilledOrders` → Accounting SSOT → WorkingGrid COW → single atomic broadcast → persist; `_performPeriodicGridChecks` → `performPeriodicGridChecks` → `runGridMaintenance` → `executeMaintenanceLogic`), plus a cross-cutting invariants table and file map. Surfaced as the first read from README and the docs index, and added to the npm `files` array (`docs/LIFECYCLE.md`, `docs/developer_guide.md`, `docs/README.md`, `README.md`, `package.json`).
15
+
16
+ ## [1.4.18] - 2026-08-19 - Compile-First Runtime Migration (tsx to dist)
17
+
18
+ ### 2026-08-19
19
+
20
+ - **Refactor(build)**: drop the tsx runtime dependency and run compiled `dist/` everywhere — `tsx` moves from `dependencies` to `devDependencies`; the root shims (`bot.js`, `dexbot.js`, `pm2.js`, `unlock.js`, `credential-daemon.js`, `scripts/update.js`) and launcher wrappers (`scripts/{bots,dexbot,keys,pm2,unlock}`) now hard-error on a missing `dist/` build instead of falling back to tsx. The published npm package never shipped the root `.ts` entrypoints, so the tsx fallback was dead for consumers while forcing tsx into production installs. The research toolset now compiles into the shipped tarball (`analysis/` is added to the tsconfig build and `.npmignore` no longer excludes `dist/analysis`); npm scripts (`lp:chart`, `market-adapter:*`, `analysis:*`, `ama:chart:lp-local`, `native:*`, `test:credit-renewal`, `version:sync`, `verify:browser-bundle`, and all `claw/*` commands) run the compiled `node dist/...` output. Every doc, skill file, and in-tool usage string is converted from `tsx <file>.ts` to the compiled form or the matching `npm run *` shortcut. Tests are intentionally untouched — they still run via tsx (`node --import tsx` / `npx tsx tests/...`) since `tests/` is not compiled (`package.json`, `claw/package.json`, `tsconfig.json`, `.npmignore`, `scripts/README.md`, `market_adapter/README.md`, all analysis READMEs, `claw/README.md`, `claw/docs/*`, `claw/skills/*`, `docs/GRID_RECALCULATION.md`, `bot.ts`, `claw/scripts/claw_bridge.ts`, `claw/scripts/claw_skill_md.ts`, `claw/examples/short_mpa_bts_strategy.ts`, `market_adapter/ama_signal_runner.ts`, `market_adapter/inputs/fetch_cex_synthetic_data.ts`, `scripts/test-credit-renewal.ts`, `scripts/generate_lp_chart.ts`, `scripts/clear-market-adapter.sh`, `analysis/bot_usage/discover_bot_accounts.ts`, `analysis/bot_fitting/backtest_ama_sweep.ts`).
21
+
5
22
  ## [1.4.17] - 2026-08-19 - Duplicate-Code Consolidation, Dead Export Purge, Analysis Source Centralization
6
23
 
7
24
  ### 2026-08-19
package/README.md CHANGED
@@ -293,6 +293,7 @@ Logs are written to `logs/` in the profiles directory in all modes: the monolith
293
293
  - **[Docs Index](docs/README.md)** - Main documentation hub
294
294
  - **[Claw API Boundary](claw/docs/AI_BOT_LIBRARY_API.md)** - Responsibility split between the AI layer and the DEXBot2 execution layer
295
295
  - **[Architecture](docs/architecture.md)** - System design, fill processing pipeline, and testing strategy
296
+ - **[Lifecycle](docs/LIFECYCLE.md)** - End-to-end walkthrough: startup, fill-driven, and AMA-driven flows with diagrams
296
297
  - **[Developer Guide](docs/developer_guide.md)** - Development guide, environment variables, examples, and glossary
297
298
  - **[Copy-on-Write Plan](docs/COPY_ON_WRITE_MASTER_PLAN.md)** - Copy-on-Write grid architecture
298
299
  - **[Fund Movement & Accounting](docs/FUND_MOVEMENT_AND_ACCOUNTING.md)** - Fund accounting, grid topology, and rotation mechanics
@@ -21,15 +21,15 @@ Tools that inspect DEXBot trading behavior and the market data it operates on. O
21
21
  | Tool | Ask this when… | One-line command |
22
22
  |------|----------------|------------------|
23
23
  | [`trade_profitability.ts`](#trade-profitability-analyzer-trade_profitabilityts) | "Is my bot making money?" — PnL, R-multiples, drawdown | `npm run analysis:trade-pnl -- <account-id>` |
24
- | [`analyze_risk_profile.ts`](#risk-profile-analyzer-analyze_risk_profilets) | "How wide should my Safe Range clamps be?" | `tsx analysis/analyze_risk_profile.ts --bot-key <bot-key>` |
25
- | [`analyze_trade_heatmap.ts`](#trade-heatmap-analyze_trade_heatmapts) | "Where did trade volume cluster vs the AMA?" | `tsx analysis/analyze_trade_heatmap.ts --bot-key <bot-key>` |
24
+ | [`analyze_risk_profile.ts`](#risk-profile-analyzer-analyze_risk_profilets) | "How wide should my Safe Range clamps be?" | `node dist/analysis/analyze_risk_profile.js --bot-key <bot-key>` |
25
+ | [`analyze_trade_heatmap.ts`](#trade-heatmap-analyze_trade_heatmapts) | "Where did trade volume cluster vs the AMA?" | `node dist/analysis/analyze_trade_heatmap.js --bot-key <bot-key>` |
26
26
  | [`tradingview/analyze_tradingview.ts`](#tradingview-chart-tradingviewanalyze_tradingviewts) | "Just give me a candle chart" | `npm run analysis:tradingview -- --source market_adapter --bot-key <bot-key>` |
27
- | [`analyze_dynamic_weight.ts`](#dynamic-weight-research-analyze_dynamic_weightts) | "Are buy/sell weights tuned for this regime?" | `tsx analysis/analyze_dynamic_weight.ts --bot-key <bot-key>` |
28
- | [`analyze_volatility.ts`](#volatility-analyze_volatilityts) | "Both weights clipped too hard / not enough?" | `tsx analysis/analyze_volatility.ts --bot-key <bot-key>` |
29
- | [`analyze_regime.ts`](#supporting-sub-signals) | "Is the trend/chaos gate too aggressive?" | `tsx analysis/analyze_regime.ts --bot-key <bot-key>` |
30
- | [`analyze_kalman.ts`](#supporting-sub-signals) | "Is Kalman's contribution to the blend right?" | `tsx analysis/analyze_kalman.ts --bot-key <bot-key>` |
31
- | [`ama_fitting/`](#ama-fitting) | "Which AMA preset fits this market?" | `tsx analysis/ama_fitting/optimizer_high_resolution.ts --data <lp-file>` |
32
- | [`bot_fitting/`](#bot-fitting) | "What spread / increment / ratio for my grid?" | `tsx analysis/bot_fitting/backtest_ama_sweep.ts --data <lp-file>` |
27
+ | [`analyze_dynamic_weight.ts`](#dynamic-weight-research-analyze_dynamic_weightts) | "Are buy/sell weights tuned for this regime?" | `node dist/analysis/analyze_dynamic_weight.js --bot-key <bot-key>` |
28
+ | [`analyze_volatility.ts`](#volatility-analyze_volatilityts) | "Both weights clipped too hard / not enough?" | `node dist/analysis/analyze_volatility.js --bot-key <bot-key>` |
29
+ | [`analyze_regime.ts`](#supporting-sub-signals) | "Is the trend/chaos gate too aggressive?" | `node dist/analysis/analyze_regime.js --bot-key <bot-key>` |
30
+ | [`analyze_kalman.ts`](#supporting-sub-signals) | "Is Kalman's contribution to the blend right?" | `node dist/analysis/analyze_kalman.js --bot-key <bot-key>` |
31
+ | [`ama_fitting/`](#ama-fitting) | "Which AMA preset fits this market?" | `node dist/analysis/ama_fitting/optimizer_high_resolution.js --data <lp-file>` |
32
+ | [`bot_fitting/`](#bot-fitting) | "What spread / increment / ratio for my grid?" | `node dist/analysis/bot_fitting/backtest_ama_sweep.js --data <lp-file>` |
33
33
 
34
34
  > `analyze_derivatives.ts` (SMA / MACD / RSI derivative layer, uses `derivative_chart_generator.ts`) is a legacy tool surfaced via `npm run analysis:derivatives` — kept for reference.
35
35
 
@@ -67,7 +67,7 @@ Two entry points, depending on what you're asking:
67
67
 
68
68
  ```bash
69
69
  npm run analysis:tradingview -- --source market_adapter --bot-key <bot-key>
70
- tsx analysis/analyze_dynamic_weight.ts --bot-key <bot-key>
70
+ node dist/analysis/analyze_dynamic_weight.js --bot-key <bot-key>
71
71
  ```
72
72
 
73
73
  **"How much money did my bot make?"** — pass a BitShares account ID or name:
@@ -77,7 +77,7 @@ npm run analysis:trade-pnl -- 1.2.123456 --hours 168
77
77
  ```
78
78
 
79
79
  > The market adapter source reads from `market_adapter/state/market_adapter_centers.json` — run the bot first to populate state.
80
- > Prefer the `npm run analysis:*` shortcuts; they wrap the `tsx ...` runners with the same flags (see [npm Script Shortcuts](#npm-script-shortcuts) for the full mapping).
80
+ > Prefer the `npm run analysis:*` shortcuts; they wrap the compiled runners with the same flags (see [npm Script Shortcuts](#npm-script-shortcuts) for the full mapping).
81
81
 
82
82
  ## Data Prerequisites
83
83
 
@@ -89,10 +89,10 @@ Most runners expect candle data. Two paths to get it:
89
89
 
90
90
  ```bash
91
91
  # Via the market adapter LP exporter (recommended for blockchain-backed candles)
92
- tsx market_adapter/inputs/fetch_lp_data.ts --pool 133 --precA 4 --precB 5 --interval 1h --lookback 26280h
92
+ node dist/market_adapter/inputs/fetch_lp_data.js --pool 133 --precA 4 --precB 5 --interval 1h --lookback 26280h
93
93
 
94
94
  # Via the analysis fetcher (uses Kibana source directly)
95
- tsx analysis/ama_fitting/fetch_lp_candles.ts --pool 1.19.133 \
95
+ node dist/analysis/ama_fitting/fetch_lp_candles.js --pool 1.19.133 \
96
96
  --assetA <ASSET_A> --assetAId <asset_a_id> --assetAPrecision <n> \
97
97
  --assetB <ASSET_B> --assetBId <asset_b_id> --assetBPrecision <n>
98
98
  ```
@@ -113,10 +113,10 @@ See [ama_fitting/README.md](ama_fitting/README.md) for full fetch options and da
113
113
  Measures inventory risk by calculating empirical divergence quantiles (based on price-to-AMA deviation). Use this to calibrate 'Safe Range' clamping tiers for your liquidity strategy.
114
114
 
115
115
  ```bash
116
- tsx analysis/analyze_risk_profile.ts --bot-key <bot-key>
116
+ node dist/analysis/analyze_risk_profile.js --bot-key <bot-key>
117
117
 
118
118
  # From explicit LP candle file
119
- tsx analysis/analyze_risk_profile.ts \
119
+ node dist/analysis/analyze_risk_profile.js \
120
120
  --file market_adapter/data/lp/<pair>/lp_pool_<id>_1h.json \
121
121
  --ama AMA3 \
122
122
  --output analysis/charts/risk_report.html
@@ -135,21 +135,21 @@ Fetches `fill_order` operations for a BitShares account from Kibana within a spe
135
135
 
136
136
  ```bash
137
137
  # Account by ID, last 7 days (default)
138
- tsx analysis/trade_profitability.ts 1.2.123456
138
+ node dist/analysis/trade_profitability.js 1.2.123456
139
139
 
140
140
  # Account by name with on-chain resolution
141
- tsx analysis/trade_profitability.ts "my-account-name" --lookup --hours 720
141
+ node dist/analysis/trade_profitability.js "my-account-name" --lookup --hours 720
142
142
 
143
143
  # Absolute window with asset filter
144
- tsx analysis/trade_profitability.ts 1.2.123456 \
144
+ node dist/analysis/trade_profitability.js 1.2.123456 \
145
145
  --start 2026-07-01 --end 2026-07-07 --asset 1.3.3291
146
146
 
147
147
  # Export trade log and full analysis
148
- tsx analysis/trade_profitability.ts 1.2.123456 \
148
+ node dist/analysis/trade_profitability.js 1.2.123456 \
149
149
  --hours 168 --csv trades.csv --json results.json
150
150
 
151
151
  # Conservative accounting (FIFO)
152
- tsx analysis/trade_profitability.ts 1.2.123456 \
152
+ node dist/analysis/trade_profitability.js 1.2.123456 \
153
153
  --hours 168 --match-mode fifo
154
154
  ```
155
155
 
@@ -226,10 +226,10 @@ tsx analysis/trade_profitability.ts 1.2.123456 \
226
226
  Generates a 2D heatmap + summed histogram showing where trade volume concentrates relative to AMA deviation. Time-slice rows show how the distribution evolved; the bottom histogram shows the aggregate bell-curve shape with threshold annotations.
227
227
 
228
228
  ```bash
229
- tsx analysis/analyze_trade_heatmap.ts --bot-key <bot-key>
229
+ node dist/analysis/analyze_trade_heatmap.js --bot-key <bot-key>
230
230
 
231
231
  # From explicit LP candle file
232
- tsx analysis/analyze_trade_heatmap.ts \
232
+ node dist/analysis/analyze_trade_heatmap.js \
233
233
  --file market_adapter/data/lp/<pair>/lp_pool_<id>_<interval>.json \
234
234
  --ama AMA3 \
235
235
  --output analysis/charts/trade_heatmap.html \
@@ -269,7 +269,7 @@ Generates a standalone TradingView-style HTML chart with candle OHLC, SMA, AMA,
269
269
  npm run analysis:tradingview -- --source market_adapter --bot-key <bot-key>
270
270
 
271
271
  # From an explicit candle file
272
- tsx analysis/tradingview/analyze_tradingview.ts \
272
+ node dist/analysis/tradingview/analyze_tradingview.js \
273
273
  --file market_adapter/data/market_adapter_<bot-key>_1h.json \
274
274
  --chart analysis/charts/<pair>_tradingview.html
275
275
  ```
@@ -286,10 +286,10 @@ Two weight-tuning paths feed into the market adapter:
286
286
  Interactive 4-panel chart for the asymmetric path: AMA slope plus Kalman confirmation, gated by Hurst Exponent and Permutation Entropy. Use this when tuning buy/sell weight bias, AMA slope offset behavior, and regime damping.
287
287
 
288
288
  ```bash
289
- tsx analysis/analyze_dynamic_weight.ts --bot-key <bot-key>
289
+ node dist/analysis/analyze_dynamic_weight.js --bot-key <bot-key>
290
290
 
291
291
  # From LP candle file with custom parameters
292
- tsx analysis/analyze_dynamic_weight.ts \
292
+ node dist/analysis/analyze_dynamic_weight.js \
293
293
  --file market_adapter/data/lp/<pair>/lp_pool_<id>_<interval>.json \
294
294
  --alpha 0.6 --gain 0.25 --clip 20
295
295
  ```
@@ -301,7 +301,7 @@ Full research docs: [DYNAMIC_WEIGHT_RESEARCH.md](trend_detection/DYNAMIC_WEIGHT_
301
301
  ATR-based symmetric volatility penalty. Use when both buy and sell weights are being reduced too much or too little.
302
302
 
303
303
  ```bash
304
- tsx analysis/analyze_volatility.ts --bot-key <bot-key>
304
+ node dist/analysis/analyze_volatility.js --bot-key <bot-key>
305
305
  ```
306
306
 
307
307
  ### Supporting sub-signals
@@ -315,16 +315,16 @@ The asymmetric path depends on three more filters; each ships as a standalone an
315
315
  | `analyze_kalman.ts` | Kalman velocity / displacement | Isolating the Kalman side of the AMA / Kalman blend |
316
316
 
317
317
  ```bash
318
- tsx analysis/analyze_regime.ts --bot-key <bot-key>
319
- tsx analysis/analyze_regime_windows.ts --bot-key <bot-key>
320
- tsx analysis/analyze_kalman.ts --bot-key <bot-key>
318
+ node dist/analysis/analyze_regime.js --bot-key <bot-key>
319
+ node dist/analysis/analyze_regime_windows.js --bot-key <bot-key>
320
+ node dist/analysis/analyze_kalman.js --bot-key <bot-key>
321
321
 
322
322
  # All also accept explicit LP candle files
323
- tsx analysis/analyze_volatility.ts \
323
+ node dist/analysis/analyze_volatility.js \
324
324
  --file market_adapter/data/lp/<pair>/lp_pool_<id>_<interval>.json
325
- tsx analysis/analyze_regime.ts \
325
+ node dist/analysis/analyze_regime.js \
326
326
  --file market_adapter/data/lp/<pair>/lp_pool_<id>_<interval>.json
327
- tsx analysis/analyze_kalman.ts \
327
+ node dist/analysis/analyze_kalman.js \
328
328
  --file market_adapter/data/lp/<pair>/lp_pool_<id>_<interval>.json
329
329
  ```
330
330
 
@@ -357,11 +357,11 @@ Shared analyzers and chart renderers for the dynamic-weight signal path. Core en
357
357
  **Tests:**
358
358
 
359
359
  ```bash
360
- tsx analysis/trend_detection/tests/test_kalman_trend.ts
361
- tsx analysis/trend_detection/tests/test_kalman_velocity_smoothing.ts
360
+ node dist/analysis/trend_detection/tests/test_kalman_trend.js
361
+ node dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.js
362
362
  ```
363
363
 
364
- **Note:** `trend_detection/` has no external dependencies — runs directly with `tsx`.
364
+ **Note:** `trend_detection/` has no external dependencies — runs directly from the compiled build (`node dist/...`).
365
365
 
366
366
  ### `ama_fitting/`
367
367
 
@@ -387,15 +387,15 @@ The current fetched 3-year pool 133 1h dataset calibrates `AMA_CONVERGENCE_ER_AV
387
387
 
388
388
  ```bash
389
389
  # Default data file (pool 133 1h)
390
- tsx analysis/ama_fitting/calibrate_convergence_er.ts
390
+ node dist/analysis/ama_fitting/calibrate_convergence_er.js
391
391
 
392
392
  # Custom data, specific AMAs
393
- tsx analysis/ama_fitting/calibrate_convergence_er.ts \
393
+ node dist/analysis/ama_fitting/calibrate_convergence_er.js \
394
394
  --data market_adapter/data/lp/<path>/<file>.json \
395
395
  --amas AMA1,AMA3
396
396
  ```
397
397
 
398
- **Note:** `ama_fitting/` has no external dependencies — runs directly via `tsx`.
398
+ **Note:** `ama_fitting/` has no external dependencies — runs directly from the compiled build (`node dist/...`).
399
399
 
400
400
  ### `bot_fitting/`
401
401
 
@@ -408,12 +408,12 @@ Parameter sweep backtests that simulate grid fills for the AMA winners from `ama
408
408
  | `shared_utils.ts` | Candle normalization and shared backtest utilities |
409
409
 
410
410
  ```bash
411
- tsx analysis/bot_fitting/backtest_bot_fitting.ts \
411
+ node dist/analysis/bot_fitting/backtest_bot_fitting.js \
412
412
  --data market_adapter/data/lp/<pair>/lp_pool_<id>_<interval>.json
413
413
  ```
414
414
 
415
415
  ```bash
416
- tsx analysis/bot_fitting/backtest_ama_sweep.ts \
416
+ node dist/analysis/bot_fitting/backtest_ama_sweep.js \
417
417
  --data market_adapter/data/lp/<pair>/lp_pool_<id>_<interval>.json \
418
418
  --spread 4:16:1 --increment 0.5:4:0.25
419
419
  ```
@@ -443,10 +443,10 @@ These npm scripts wrap common analysis runners:
443
443
 
444
444
  | Script | Command |
445
445
  |--------|---------|
446
- | `npm run analysis:tradingview` | `tsx analysis/tradingview/analyze_tradingview.ts` |
447
- | `npm run analysis:trade-pnl` | `tsx analysis/trade_profitability.ts` |
448
- | `npm run analysis:derivatives` | `tsx analysis/analyze_derivatives.ts` (legacy SMA/MACD/RSI layer, reference only) |
449
- | `npm run ama:chart:lp-local` | `tsx analysis/ama_fitting/generate_unified_comparison_chart.ts` (chart also auto-generated by optimizer) |
446
+ | `npm run analysis:tradingview` | `node dist/analysis/tradingview/analyze_tradingview.js` |
447
+ | `npm run analysis:trade-pnl` | `node dist/analysis/trade_profitability.js` |
448
+ | `npm run analysis:derivatives` | `node dist/analysis/analyze_derivatives.js` (legacy SMA/MACD/RSI layer, reference only) |
449
+ | `npm run ama:chart:lp-local` | `node dist/analysis/ama_fitting/generate_unified_comparison_chart.js` (chart also auto-generated by optimizer) |
450
450
 
451
451
  All accept `--` forwarded flags.
452
452
 
@@ -34,7 +34,7 @@ bootstrap (gaps filled via `candle_utils.fillCandleGaps`), but without pruning.
34
34
 
35
35
  **`<ASSET_A>`/`<ASSET_B>` pool (3 years):**
36
36
  ```bash
37
- tsx analysis/ama_fitting/fetch_lp_candles.ts \
37
+ node dist/analysis/ama_fitting/fetch_lp_candles.js \
38
38
  --pool 1.19.133 \
39
39
  --assetA <ASSET_A> --assetAId <asset_a_id> --assetAPrecision <n> \
40
40
  --assetB <ASSET_B> --assetBId <asset_b_id> --assetBPrecision <n> \
@@ -73,20 +73,20 @@ to `profiles/market_profiles.json`.
73
73
 
74
74
  **Run on the fetched LP data:**
75
75
  ```bash
76
- tsx analysis/ama_fitting/optimizer_high_resolution.ts \
76
+ node dist/analysis/ama_fitting/optimizer_high_resolution.js \
77
77
  --data market_adapter/data/lp/<pair>/lp_pool_<id>_<interval>.json
78
78
  ```
79
79
 
80
80
  **Export winners to the market adapter profile file:**
81
81
  ```bash
82
- tsx analysis/ama_fitting/optimizer_high_resolution.ts \
82
+ node dist/analysis/ama_fitting/optimizer_high_resolution.js \
83
83
  --data market_adapter/data/lp/<pair>/lp_pool_<id>_<interval>.json \
84
84
  --write-profiles
85
85
  ```
86
86
 
87
87
  Override ranges via CLI:
88
88
  ```bash
89
- tsx analysis/ama_fitting/optimizer_high_resolution.ts \
89
+ node dist/analysis/ama_fitting/optimizer_high_resolution.js \
90
90
  --data market_adapter/data/lp/<pair>/lp_pool_<id>_<interval>.json \
91
91
  --erMin 100 --erMax 600 \
92
92
  --slowMin 800 --slowMax 6000
@@ -118,7 +118,7 @@ override any individually:
118
118
  --ama1Weight 0.0031 --ama2Weight 0.0025 --ama3Weight 0.00185 --ama4Weight 0.0013
119
119
 
120
120
  # Override only AMA1 and AMA4, keeping AMA2/AMA3 defaults
121
- tsx analysis/ama_fitting/optimizer_high_resolution.ts \
121
+ node dist/analysis/ama_fitting/optimizer_high_resolution.js \
122
122
  --data market_adapter/data/lp/<pair>/lp_pool_<id>_<interval>.json \
123
123
  --ama1Weight 0.003 --ama4Weight 0.002
124
124
  ```
@@ -206,7 +206,7 @@ real LP candle data. Accounts for Jensen's inequality: the average smoothing
206
206
  constant is not the smoothing constant of the average ER.
207
207
 
208
208
  ```bash
209
- tsx analysis/ama_fitting/calibrate_convergence_er.ts --data <lp-file.json> --amas AMA3
209
+ node dist/analysis/ama_fitting/calibrate_convergence_er.js --data <lp-file.json> --amas AMA3
210
210
  ```
211
211
 
212
212
  ### `analyze_lambda_vs_slow.ts`
@@ -221,7 +221,7 @@ values land on the curve — differences of ±1–2 slow units vs the 3-D optimi
221
221
  are expected since the optimizer also tunes ER and Fast simultaneously.
222
222
 
223
223
  ```bash
224
- tsx analysis/ama_fitting/analyze_lambda_vs_slow.ts \
224
+ node dist/analysis/ama_fitting/analyze_lambda_vs_slow.js \
225
225
  --data <lp-file.json> --maxSlow 250 --lambdaEnd 0.0045 --lambdaSteps 50
226
226
  ```
227
227
 
@@ -232,7 +232,7 @@ AMA series on LP candle data. Reports reposition counts and inter-reposition
232
232
  step distributions.
233
233
 
234
234
  ```bash
235
- tsx analysis/ama_fitting/analyze_ama_price_changes.ts \
235
+ node dist/analysis/ama_fitting/analyze_ama_price_changes.js \
236
236
  --data <lp-file.json> --results <optimization-results.json>
237
237
  ```
238
238
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ama_fitting",
3
- "version": "1.4.17",
3
+ "version": "1.4.19",
4
4
  "description": "Tools for fitting AMA parameters to market data",
5
5
  "main": "../../dist/analysis/ama_fitting/optimizer_high_resolution.js",
6
6
  "scripts": {
@@ -27,11 +27,11 @@ Both scripts require:
27
27
 
28
28
  ```bash
29
29
  # Lightweight sweep
30
- tsx analysis/bot_fitting/backtest_bot_fitting.ts \
30
+ node dist/analysis/bot_fitting/backtest_bot_fitting.js \
31
31
  --data <path-to-lp-candles.json>
32
32
 
33
33
  # Persistent grid simulation with AMA winners
34
- tsx analysis/bot_fitting/backtest_ama_sweep.ts \
34
+ node dist/analysis/bot_fitting/backtest_ama_sweep.js \
35
35
  --data <path-to-lp-candles.json> \
36
36
  --results <path-to-optimization-results.json>
37
37
  ```
@@ -45,7 +45,7 @@ tsx analysis/bot_fitting/backtest_ama_sweep.ts \
45
45
  Optional tuning (values shown are examples, not defaults):
46
46
 
47
47
  ```bash
48
- tsx analysis/bot_fitting/backtest_bot_fitting.ts \
48
+ node dist/analysis/bot_fitting/backtest_bot_fitting.js \
49
49
  --data <path-to-lp-candles.json> \
50
50
  --spread 0.4:1.6:0.1 \
51
51
  --increment 0.2:0.8:0.1 \
@@ -117,7 +117,7 @@ All parameters above are tunable via CLI flags. Additional tuning flags:
117
117
  The sweep parallelizes across combos using worker threads (one per CPU core). Use `--help` for the complete option list.
118
118
 
119
119
  ```bash
120
- tsx analysis/bot_fitting/backtest_ama_sweep.ts \
120
+ node dist/analysis/bot_fitting/backtest_ama_sweep.js \
121
121
  --data <path-to-lp-candles.json> \
122
122
  --results <path-to-optimization-results.json> \
123
123
  --spread 4:16:1 --increment 0.5:4:0.25
@@ -127,7 +127,7 @@ function printHelp() {
127
127
  console.log('AMA Sweep Backtest — persistent grid simulation with weight profiles');
128
128
  console.log('');
129
129
  console.log('Usage:');
130
- console.log(' tsx analysis/bot_fitting/backtest_ama_sweep.ts [options]');
130
+ console.log(' node dist/analysis/bot_fitting/backtest_ama_sweep.js [options]');
131
131
  console.log('');
132
132
  console.log('Options:');
133
133
  console.log(' --data <path> LP candle JSON');
@@ -26,12 +26,12 @@ const { writeJSON } = getStorage();
26
26
  * 5. Rank by DEX score and print table
27
27
  *
28
28
  * Usage:
29
- * tsx analysis/bot_usage/discover_bot_accounts.ts
30
- * tsx analysis/bot_usage/discover_bot_accounts.ts --days 14
31
- * tsx analysis/bot_usage/discover_bot_accounts.ts --days 7 --min-creates 10 --top 50
32
- * tsx analysis/bot_usage/discover_bot_accounts.ts --no-grid (fast: counts only)
33
- * tsx analysis/bot_usage/discover_bot_accounts.ts --output-json results.json
34
- * tsx analysis/bot_usage/discover_bot_accounts.ts --cv-threshold 0.25
29
+ * node dist/analysis/bot_usage/discover_bot_accounts.js
30
+ * node dist/analysis/bot_usage/discover_bot_accounts.js --days 14
31
+ * node dist/analysis/bot_usage/discover_bot_accounts.js --days 7 --min-creates 10 --top 50
32
+ * node dist/analysis/bot_usage/discover_bot_accounts.js --no-grid (fast: counts only)
33
+ * node dist/analysis/bot_usage/discover_bot_accounts.js --output-json results.json
34
+ * node dist/analysis/bot_usage/discover_bot_accounts.js --cv-threshold 0.25
35
35
  *
36
36
  * Options:
37
37
  * --days <n> Lookback window in days (default: 14)
@@ -122,7 +122,7 @@ function parseArgs() {
122
122
 
123
123
  function printHelpAndExit() {
124
124
  console.log(`\
125
- Usage: tsx analysis/bot_usage/discover_bot_accounts.ts [options]
125
+ Usage: node dist/analysis/bot_usage/discover_bot_accounts.js [options]
126
126
 
127
127
  Scans BitShares chain activity via Kibana to identify likely DEXBot/DEXBot2
128
128
  staggered-orders strategy accounts. Works in phases: discovery queries ->
@@ -141,10 +141,10 @@ Options:
141
141
  --help, -h Show this help
142
142
 
143
143
  Examples:
144
- tsx analysis/bot_usage/discover_bot_accounts.ts
145
- tsx analysis/bot_usage/discover_bot_accounts.ts --days 30 --top 50
146
- tsx analysis/bot_usage/discover_bot_accounts.ts --no-grid
147
- tsx analysis/bot_usage/discover_bot_accounts.ts --output-json results.json`);
144
+ node dist/analysis/bot_usage/discover_bot_accounts.js
145
+ node dist/analysis/bot_usage/discover_bot_accounts.js --days 30 --top 50
146
+ node dist/analysis/bot_usage/discover_bot_accounts.js --no-grid
147
+ node dist/analysis/bot_usage/discover_bot_accounts.js --output-json results.json`);
148
148
  process.exit(0);
149
149
  }
150
150
 
@@ -64,7 +64,7 @@ npm run analysis:tradingview -- \
64
64
  CLI direct equivalent:
65
65
 
66
66
  ```bash
67
- tsx analysis/tradingview/analyze_tradingview.ts \
67
+ node dist/analysis/tradingview/analyze_tradingview.js \
68
68
  --source market_adapter \
69
69
  --bot-key <bot-key>
70
70
  ```
@@ -81,7 +81,7 @@ tsx analysis/tradingview/analyze_tradingview.ts \
81
81
  ## From an Explicit Candle File
82
82
 
83
83
  ```bash
84
- tsx analysis/tradingview/analyze_tradingview.ts \
84
+ node dist/analysis/tradingview/analyze_tradingview.js \
85
85
  --file market_adapter/data/market_adapter_<bot-key>_1h.json \
86
86
  --chart analysis/charts/<pair>_tradingview.html
87
87
  ```
@@ -89,7 +89,7 @@ tsx analysis/tradingview/analyze_tradingview.ts \
89
89
  Using LP candle files directly:
90
90
 
91
91
  ```bash
92
- tsx analysis/tradingview/analyze_tradingview.ts \
92
+ node dist/analysis/tradingview/analyze_tradingview.js \
93
93
  --file market_adapter/data/lp/<pair-folder>/lp_pool_<id>_<interval>.json \
94
94
  --chart analysis/charts/tradingview_chart.html
95
95
  ```
@@ -108,7 +108,7 @@ If you pass a raw JSON file, the runner normalizes the candles before rendering.
108
108
  Use the market adapter LP exporter to pull blockchain-backed candles before generating the HTML:
109
109
 
110
110
  ```bash
111
- tsx market_adapter/inputs/fetch_lp_data.ts --pool 133 --precA 4 --precB 5 --interval 1h --lookback 26280h
111
+ node dist/market_adapter/inputs/fetch_lp_data.js --pool 133 --precA 4 --precB 5 --interval 1h --lookback 26280h
112
112
  ```
113
113
 
114
114
  For date range fetching, use `--start` and `--end` (e.g. `--start 2024-03-06 --end 2025-03-06`).
@@ -64,11 +64,11 @@ On top of this blend, **Hurst Exponent** and **Permutation Entropy** act as a re
64
64
 
65
65
  ```bash
66
66
  # From JSON candle file
67
- tsx analysis/analyze_dynamic_weight.ts \
67
+ node dist/analysis/analyze_dynamic_weight.js \
68
68
  --file market_adapter/data/lp/<pair>/lp_pool_<id>_<interval>.json
69
69
 
70
70
  # With custom initial parameters
71
- tsx analysis/analyze_dynamic_weight.ts \
71
+ node dist/analysis/analyze_dynamic_weight.js \
72
72
  --file market_adapter/data/lp/<pair>/lp_pool_<id>_<interval>.json \
73
73
  --alpha 0.6 \
74
74
  --gain 0.25 \
@@ -388,7 +388,7 @@ that only need adjustment when you want to change how strict the signal is.
388
388
  ## Recommended 1h Setup
389
389
 
390
390
  ```bash
391
- tsx analysis/analyze_derivatives.ts \
391
+ node dist/analysis/analyze_derivatives.js \
392
392
  --source json \
393
393
  --file market_adapter/data/lp/<pair>/lp_pool_<id>_<interval>.json \
394
394
  --sma 500 --fast-sma 100 \
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trend-detection",
3
- "version": "1.4.17",
3
+ "version": "1.4.19",
4
4
  "description": "Kalman filter trend detection with tactical/modal state tracking",
5
5
  "main": "../../dist/analysis/trend_detection/kalman_trend_analyzer.js",
6
6
  "scripts": {