dexbot 1.4.21 → 1.4.23

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 (601) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/README.md +8 -5
  3. package/analysis/ama_fitting/analyze_ama_price_changes.ts +7 -3
  4. package/analysis/ama_fitting/analyze_lambda_vs_slow.ts +6 -6
  5. package/analysis/ama_fitting/calibrate_convergence_er.ts +7 -5
  6. package/analysis/ama_fitting/fetch_lp_candles.ts +8 -3
  7. package/analysis/ama_fitting/generate_unified_comparison_chart.ts +30 -67
  8. package/analysis/ama_fitting/optimizer_high_resolution.ts +26 -17
  9. package/analysis/ama_fitting/package.json +1 -1
  10. package/analysis/analyze_derivatives.ts +4 -4
  11. package/analysis/analyze_dynamic_weight.ts +21 -5
  12. package/analysis/analyze_kalman.ts +54 -25
  13. package/analysis/analyze_regime.ts +2 -2
  14. package/analysis/analyze_regime_windows.ts +27 -19
  15. package/analysis/analyze_risk_profile.ts +3 -3
  16. package/analysis/analyze_trade_heatmap.ts +3 -3
  17. package/analysis/analyze_volatility.ts +2 -2
  18. package/analysis/bot_fitting/README.md +93 -19
  19. package/analysis/bot_fitting/backtest_ama_sweep.ts +316 -199
  20. package/analysis/bot_fitting/backtest_bot_fitting.ts +520 -85
  21. package/analysis/bot_fitting/shared_utils.ts +15 -9
  22. package/analysis/bot_key_utils.ts +13 -6
  23. package/analysis/bot_usage/discover_bot_accounts.ts +5 -3
  24. package/analysis/bot_usage/kibana_bot_queries.ts +1 -1
  25. package/analysis/chart_css.ts +6 -4
  26. package/analysis/chart_ui.ts +0 -1
  27. package/analysis/chart_utils.ts +11 -2
  28. package/analysis/derivative_chart_generator.ts +2 -2
  29. package/analysis/price_sources.ts +8 -2
  30. package/analysis/resolve_source.ts +1 -1
  31. package/analysis/trade_profitability.ts +61 -28
  32. package/analysis/tradingview/README.md +24 -4
  33. package/analysis/tradingview/analyze_tradingview.ts +1 -1
  34. package/analysis/tradingview/tradingview_uplot_chart_generator.ts +356 -86
  35. package/analysis/trend_detection/DYNAMIC_WEIGHT_RESEARCH.md +1 -1
  36. package/analysis/trend_detection/derivative_analyzer.ts +12 -3
  37. package/analysis/trend_detection/dynamic_weight_chart_generator.ts +25 -27
  38. package/analysis/trend_detection/hurst_analyzer.ts +1 -1
  39. package/analysis/trend_detection/kalman_chart_generator.ts +42 -14
  40. package/analysis/trend_detection/package.json +1 -1
  41. package/analysis/trend_detection/regime_chart_generator.ts +39 -19
  42. package/analysis/trend_detection/tests/test_kalman_trend.ts +1 -1
  43. package/analysis/trend_detection/tests/test_kalman_velocity_smoothing.ts +1 -1
  44. package/analysis/trend_detection/volatility_chart_generator.ts +1 -1
  45. package/claw/index.ts +1 -1
  46. package/claw/modules/claw_bridge.ts +3 -3
  47. package/claw/modules/claw_catalog.ts +1 -1
  48. package/claw/modules/claw_launcher.ts +1 -1
  49. package/claw/modules/claw_skill_md.ts +7 -10
  50. package/claw/modules/credit_runtime_adapter.ts +1 -1
  51. package/claw/modules/decision_loop.ts +5 -9
  52. package/claw/modules/dexbot_bridge.ts +7 -7
  53. package/claw/modules/feed_price_source.ts +1 -1
  54. package/claw/modules/kibana_price_source.ts +1 -1
  55. package/claw/modules/launcher_mode_detector.ts +1 -1
  56. package/claw/modules/launcher_paths.ts +1 -1
  57. package/claw/modules/position_discovery.ts +1 -1
  58. package/claw/modules/position_health.ts +1 -1
  59. package/claw/package.json +3 -3
  60. package/claw/runtimes/openclaw-plugin/openclaw.plugin.json +1 -1
  61. package/claw/runtimes/openclaw-plugin/package.json +1 -1
  62. package/claw/skills/launcher-ops/references/launcher-workflow.md +2 -2
  63. package/claw/tests/package.json +1 -1
  64. package/claw/tests/test_claw_bridge.ts +45 -21
  65. package/claw/tests/test_claw_catalog_and_credentials.ts +8 -4
  66. package/claw/tests/test_claw_chain_layer.ts +39 -19
  67. package/claw/tests/test_claw_data_flow.ts +28 -20
  68. package/claw/tests/test_claw_domain_logic.ts +25 -19
  69. package/claw/tests/test_claw_manifest_and_matrix.ts +23 -3
  70. package/claw/tests/test_claw_mcp_transport.ts +13 -8
  71. package/claw/tests/test_claw_regressions.ts +254 -128
  72. package/claw/tests/test_claw_skill_generation.ts +1 -1
  73. package/claw/tests/test_nullclaw_tmp_integration.ts +2 -3
  74. package/claw/tests/test_position_health.ts +1 -77
  75. package/claw/tests/test_position_manager.ts +20 -18
  76. package/claw/tests/test_position_manager_watch_health.ts +39 -43
  77. package/claw/tests/test_short_mpa_strategy.ts +20 -17
  78. package/claw/tsconfig.json +4 -3
  79. package/dist/analysis/ama_fitting/analyze_ama_price_changes.js +7 -3
  80. package/dist/analysis/ama_fitting/analyze_ama_price_changes.js.map +1 -1
  81. package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.js +6 -6
  82. package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.js.map +1 -1
  83. package/dist/analysis/ama_fitting/calibrate_convergence_er.js +7 -5
  84. package/dist/analysis/ama_fitting/calibrate_convergence_er.js.map +1 -1
  85. package/dist/analysis/ama_fitting/fetch_lp_candles.js +8 -3
  86. package/dist/analysis/ama_fitting/fetch_lp_candles.js.map +1 -1
  87. package/dist/analysis/ama_fitting/generate_unified_comparison_chart.d.ts +2 -2
  88. package/dist/analysis/ama_fitting/generate_unified_comparison_chart.d.ts.map +1 -1
  89. package/dist/analysis/ama_fitting/generate_unified_comparison_chart.js +31 -75
  90. package/dist/analysis/ama_fitting/generate_unified_comparison_chart.js.map +1 -1
  91. package/dist/analysis/ama_fitting/optimizer_high_resolution.d.ts.map +1 -1
  92. package/dist/analysis/ama_fitting/optimizer_high_resolution.js +25 -17
  93. package/dist/analysis/ama_fitting/optimizer_high_resolution.js.map +1 -1
  94. package/dist/analysis/analyze_derivatives.d.ts +0 -18
  95. package/dist/analysis/analyze_derivatives.d.ts.map +1 -1
  96. package/dist/analysis/analyze_derivatives.js +4 -4
  97. package/dist/analysis/analyze_derivatives.js.map +1 -1
  98. package/dist/analysis/analyze_dynamic_weight.d.ts +0 -11
  99. package/dist/analysis/analyze_dynamic_weight.d.ts.map +1 -1
  100. package/dist/analysis/analyze_dynamic_weight.js +19 -5
  101. package/dist/analysis/analyze_dynamic_weight.js.map +1 -1
  102. package/dist/analysis/analyze_kalman.d.ts +0 -10
  103. package/dist/analysis/analyze_kalman.d.ts.map +1 -1
  104. package/dist/analysis/analyze_kalman.js +51 -26
  105. package/dist/analysis/analyze_kalman.js.map +1 -1
  106. package/dist/analysis/analyze_regime.d.ts +0 -17
  107. package/dist/analysis/analyze_regime.d.ts.map +1 -1
  108. package/dist/analysis/analyze_regime.js +2 -2
  109. package/dist/analysis/analyze_regime.js.map +1 -1
  110. package/dist/analysis/analyze_regime_windows.d.ts +0 -16
  111. package/dist/analysis/analyze_regime_windows.d.ts.map +1 -1
  112. package/dist/analysis/analyze_regime_windows.js +28 -21
  113. package/dist/analysis/analyze_regime_windows.js.map +1 -1
  114. package/dist/analysis/analyze_risk_profile.js +3 -3
  115. package/dist/analysis/analyze_risk_profile.js.map +1 -1
  116. package/dist/analysis/analyze_trade_heatmap.js +3 -3
  117. package/dist/analysis/analyze_trade_heatmap.js.map +1 -1
  118. package/dist/analysis/analyze_volatility.d.ts +0 -19
  119. package/dist/analysis/analyze_volatility.d.ts.map +1 -1
  120. package/dist/analysis/analyze_volatility.js +2 -2
  121. package/dist/analysis/analyze_volatility.js.map +1 -1
  122. package/dist/analysis/bot_fitting/backtest_ama_sweep.d.ts +30 -14
  123. package/dist/analysis/bot_fitting/backtest_ama_sweep.d.ts.map +1 -1
  124. package/dist/analysis/bot_fitting/backtest_ama_sweep.js +330 -193
  125. package/dist/analysis/bot_fitting/backtest_ama_sweep.js.map +1 -1
  126. package/dist/analysis/bot_fitting/backtest_bot_fitting.d.ts +136 -1
  127. package/dist/analysis/bot_fitting/backtest_bot_fitting.d.ts.map +1 -1
  128. package/dist/analysis/bot_fitting/backtest_bot_fitting.js +527 -83
  129. package/dist/analysis/bot_fitting/backtest_bot_fitting.js.map +1 -1
  130. package/dist/analysis/bot_fitting/shared_utils.d.ts +1 -1
  131. package/dist/analysis/bot_fitting/shared_utils.d.ts.map +1 -1
  132. package/dist/analysis/bot_fitting/shared_utils.js +14 -8
  133. package/dist/analysis/bot_fitting/shared_utils.js.map +1 -1
  134. package/dist/analysis/bot_key_utils.d.ts.map +1 -1
  135. package/dist/analysis/bot_key_utils.js +13 -6
  136. package/dist/analysis/bot_key_utils.js.map +1 -1
  137. package/dist/analysis/bot_usage/discover_bot_accounts.js +5 -3
  138. package/dist/analysis/bot_usage/discover_bot_accounts.js.map +1 -1
  139. package/dist/analysis/bot_usage/kibana_bot_queries.d.ts.map +1 -1
  140. package/dist/analysis/bot_usage/kibana_bot_queries.js +1 -1
  141. package/dist/analysis/bot_usage/kibana_bot_queries.js.map +1 -1
  142. package/dist/analysis/chart_css.d.ts +3 -1
  143. package/dist/analysis/chart_css.d.ts.map +1 -1
  144. package/dist/analysis/chart_css.js +6 -3
  145. package/dist/analysis/chart_css.js.map +1 -1
  146. package/dist/analysis/chart_ui.d.ts.map +1 -1
  147. package/dist/analysis/chart_ui.js.map +1 -1
  148. package/dist/analysis/chart_utils.d.ts.map +1 -1
  149. package/dist/analysis/chart_utils.js +15 -2
  150. package/dist/analysis/chart_utils.js.map +1 -1
  151. package/dist/analysis/derivative_chart_generator.js +2 -2
  152. package/dist/analysis/derivative_chart_generator.js.map +1 -1
  153. package/dist/analysis/price_sources.d.ts +1 -0
  154. package/dist/analysis/price_sources.d.ts.map +1 -1
  155. package/dist/analysis/price_sources.js +8 -2
  156. package/dist/analysis/price_sources.js.map +1 -1
  157. package/dist/analysis/resolve_source.d.ts.map +1 -1
  158. package/dist/analysis/resolve_source.js +1 -1
  159. package/dist/analysis/resolve_source.js.map +1 -1
  160. package/dist/analysis/trade_profitability.d.ts.map +1 -1
  161. package/dist/analysis/trade_profitability.js +58 -29
  162. package/dist/analysis/trade_profitability.js.map +1 -1
  163. package/dist/analysis/tradingview/analyze_tradingview.js +1 -1
  164. package/dist/analysis/tradingview/analyze_tradingview.js.map +1 -1
  165. package/dist/analysis/tradingview/tradingview_uplot_chart_generator.d.ts.map +1 -1
  166. package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js +356 -86
  167. package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js.map +1 -1
  168. package/dist/analysis/trend_detection/derivative_analyzer.d.ts +1 -0
  169. package/dist/analysis/trend_detection/derivative_analyzer.d.ts.map +1 -1
  170. package/dist/analysis/trend_detection/derivative_analyzer.js +12 -3
  171. package/dist/analysis/trend_detection/derivative_analyzer.js.map +1 -1
  172. package/dist/analysis/trend_detection/dynamic_weight_chart_generator.d.ts.map +1 -1
  173. package/dist/analysis/trend_detection/dynamic_weight_chart_generator.js +26 -27
  174. package/dist/analysis/trend_detection/dynamic_weight_chart_generator.js.map +1 -1
  175. package/dist/analysis/trend_detection/hurst_analyzer.d.ts +1 -1
  176. package/dist/analysis/trend_detection/hurst_analyzer.d.ts.map +1 -1
  177. package/dist/analysis/trend_detection/hurst_analyzer.js +1 -1
  178. package/dist/analysis/trend_detection/hurst_analyzer.js.map +1 -1
  179. package/dist/analysis/trend_detection/kalman_chart_generator.d.ts.map +1 -1
  180. package/dist/analysis/trend_detection/kalman_chart_generator.js +41 -13
  181. package/dist/analysis/trend_detection/kalman_chart_generator.js.map +1 -1
  182. package/dist/analysis/trend_detection/regime_chart_generator.d.ts.map +1 -1
  183. package/dist/analysis/trend_detection/regime_chart_generator.js +38 -19
  184. package/dist/analysis/trend_detection/regime_chart_generator.js.map +1 -1
  185. package/dist/analysis/trend_detection/tests/test_kalman_trend.js +1 -1
  186. package/dist/analysis/trend_detection/tests/test_kalman_trend.js.map +1 -1
  187. package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.js +1 -1
  188. package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.js.map +1 -1
  189. package/dist/analysis/trend_detection/volatility_chart_generator.js +1 -1
  190. package/dist/analysis/trend_detection/volatility_chart_generator.js.map +1 -1
  191. package/dist/bot.js +1 -1
  192. package/dist/bot.js.map +1 -1
  193. package/dist/credential-daemon.d.ts +1 -1
  194. package/dist/credential-daemon.js +1 -1
  195. package/dist/dexbot.d.ts.map +1 -1
  196. package/dist/dexbot.js +7 -8
  197. package/dist/dexbot.js.map +1 -1
  198. package/dist/market_adapter/ama_signal_runner.js +3 -1
  199. package/dist/market_adapter/ama_signal_runner.js.map +1 -1
  200. package/dist/market_adapter/candle_utils.d.ts +1 -3
  201. package/dist/market_adapter/candle_utils.d.ts.map +1 -1
  202. package/dist/market_adapter/candle_utils.js +1 -11
  203. package/dist/market_adapter/candle_utils.js.map +1 -1
  204. package/dist/market_adapter/core/asymmetric_bounds.d.ts.map +1 -1
  205. package/dist/market_adapter/core/asymmetric_bounds.js +33 -30
  206. package/dist/market_adapter/core/asymmetric_bounds.js.map +1 -1
  207. package/dist/market_adapter/core/config_normalizers.d.ts.map +1 -1
  208. package/dist/market_adapter/core/config_normalizers.js +10 -1
  209. package/dist/market_adapter/core/config_normalizers.js.map +1 -1
  210. package/dist/market_adapter/core/kibana_candles.d.ts +18 -42
  211. package/dist/market_adapter/core/kibana_candles.d.ts.map +1 -1
  212. package/dist/market_adapter/core/kibana_candles.js +101 -7
  213. package/dist/market_adapter/core/kibana_candles.js.map +1 -1
  214. package/dist/market_adapter/core/kibana_client.d.ts +0 -14
  215. package/dist/market_adapter/core/kibana_client.d.ts.map +1 -1
  216. package/dist/market_adapter/core/kibana_client.js +39 -6
  217. package/dist/market_adapter/core/kibana_client.js.map +1 -1
  218. package/dist/market_adapter/core/kibana_market_candles.d.ts +0 -27
  219. package/dist/market_adapter/core/kibana_market_candles.d.ts.map +1 -1
  220. package/dist/market_adapter/core/kibana_market_candles.js +1 -1
  221. package/dist/market_adapter/core/kibana_market_candles.js.map +1 -1
  222. package/dist/market_adapter/core/market_adapter_service.d.ts +21 -11
  223. package/dist/market_adapter/core/market_adapter_service.d.ts.map +1 -1
  224. package/dist/market_adapter/core/market_adapter_service.js +95 -37
  225. package/dist/market_adapter/core/market_adapter_service.js.map +1 -1
  226. package/dist/market_adapter/core/signals/hurst_analyzer.d.ts +10 -1
  227. package/dist/market_adapter/core/signals/hurst_analyzer.d.ts.map +1 -1
  228. package/dist/market_adapter/core/signals/hurst_analyzer.js +28 -17
  229. package/dist/market_adapter/core/signals/hurst_analyzer.js.map +1 -1
  230. package/dist/market_adapter/core/signals/kalman_trend_analyzer.d.ts +5 -0
  231. package/dist/market_adapter/core/signals/kalman_trend_analyzer.d.ts.map +1 -1
  232. package/dist/market_adapter/core/signals/kalman_trend_analyzer.js +24 -24
  233. package/dist/market_adapter/core/signals/kalman_trend_analyzer.js.map +1 -1
  234. package/dist/market_adapter/core/signals/kalman_velocity_smoothing.d.ts.map +1 -1
  235. package/dist/market_adapter/core/signals/kalman_velocity_smoothing.js +5 -1
  236. package/dist/market_adapter/core/signals/kalman_velocity_smoothing.js.map +1 -1
  237. package/dist/market_adapter/core/signals/permutation_entropy_analyzer.d.ts.map +1 -1
  238. package/dist/market_adapter/core/signals/permutation_entropy_analyzer.js +20 -3
  239. package/dist/market_adapter/core/signals/permutation_entropy_analyzer.js.map +1 -1
  240. package/dist/market_adapter/core/strategies/ama.js +1 -1
  241. package/dist/market_adapter/core/strategies/ama.js.map +1 -1
  242. package/dist/market_adapter/core/strategies/ama_slope_model.d.ts +2 -2
  243. package/dist/market_adapter/core/strategies/ama_slope_model.d.ts.map +1 -1
  244. package/dist/market_adapter/core/strategies/ama_slope_model.js +16 -4
  245. package/dist/market_adapter/core/strategies/ama_slope_model.js.map +1 -1
  246. package/dist/market_adapter/core/strategies/atr/calculator.d.ts +4 -3
  247. package/dist/market_adapter/core/strategies/atr/calculator.d.ts.map +1 -1
  248. package/dist/market_adapter/core/strategies/atr/calculator.js +16 -8
  249. package/dist/market_adapter/core/strategies/atr/calculator.js.map +1 -1
  250. package/dist/market_adapter/core/strategies/collateral_manager.d.ts.map +1 -1
  251. package/dist/market_adapter/core/strategies/collateral_manager.js +8 -3
  252. package/dist/market_adapter/core/strategies/collateral_manager.js.map +1 -1
  253. package/dist/market_adapter/core/strategies/dynamic_weight_series.d.ts +40 -1
  254. package/dist/market_adapter/core/strategies/dynamic_weight_series.d.ts.map +1 -1
  255. package/dist/market_adapter/core/strategies/dynamic_weight_series.js +116 -2
  256. package/dist/market_adapter/core/strategies/dynamic_weight_series.js.map +1 -1
  257. package/dist/market_adapter/core/strategies/regime_gate.d.ts.map +1 -1
  258. package/dist/market_adapter/core/strategies/regime_gate.js +26 -20
  259. package/dist/market_adapter/core/strategies/regime_gate.js.map +1 -1
  260. package/dist/market_adapter/core/strategies/volatility_shift.d.ts.map +1 -1
  261. package/dist/market_adapter/core/strategies/volatility_shift.js +3 -0
  262. package/dist/market_adapter/core/strategies/volatility_shift.js.map +1 -1
  263. package/dist/market_adapter/inputs/fetch_cex_synthetic_data.js +69 -55
  264. package/dist/market_adapter/inputs/fetch_cex_synthetic_data.js.map +1 -1
  265. package/dist/market_adapter/inputs/fetch_lp_data.d.ts +0 -26
  266. package/dist/market_adapter/inputs/fetch_lp_data.d.ts.map +1 -1
  267. package/dist/market_adapter/inputs/fetch_lp_data.js +67 -14
  268. package/dist/market_adapter/inputs/fetch_lp_data.js.map +1 -1
  269. package/dist/market_adapter/inputs/kibana_source.d.ts +4 -28
  270. package/dist/market_adapter/inputs/kibana_source.d.ts.map +1 -1
  271. package/dist/market_adapter/inputs/kibana_source.js +5 -2
  272. package/dist/market_adapter/inputs/kibana_source.js.map +1 -1
  273. package/dist/market_adapter/lp_chart_core.js +1 -1
  274. package/dist/market_adapter/lp_chart_core.js.map +1 -1
  275. package/dist/market_adapter/lp_chart_runner.d.ts +10 -1
  276. package/dist/market_adapter/lp_chart_runner.d.ts.map +1 -1
  277. package/dist/market_adapter/lp_chart_runner.js +2 -2
  278. package/dist/market_adapter/lp_chart_runner.js.map +1 -1
  279. package/dist/market_adapter/lp_chart_strategy_loader.js +1 -1
  280. package/dist/market_adapter/lp_chart_strategy_loader.js.map +1 -1
  281. package/dist/market_adapter/market_adapter.d.ts +1 -2
  282. package/dist/market_adapter/market_adapter.d.ts.map +1 -1
  283. package/dist/market_adapter/market_adapter.js +9 -8
  284. package/dist/market_adapter/market_adapter.js.map +1 -1
  285. package/dist/market_adapter/test_helpers.d.ts +3 -3
  286. package/dist/market_adapter/test_helpers.d.ts.map +1 -1
  287. package/dist/market_adapter/test_helpers.js +3 -3
  288. package/dist/market_adapter/test_helpers.js.map +1 -1
  289. package/dist/market_adapter/utils/adapter_client.js +1 -1
  290. package/dist/market_adapter/utils/adapter_client.js.map +1 -1
  291. package/dist/market_adapter/utils/atomic_write.js +1 -1
  292. package/dist/market_adapter/utils/atomic_write.js.map +1 -1
  293. package/dist/market_adapter/utils/chain.d.ts +0 -2
  294. package/dist/market_adapter/utils/chain.d.ts.map +1 -1
  295. package/dist/market_adapter/utils/chain.js +2 -3
  296. package/dist/market_adapter/utils/chain.js.map +1 -1
  297. package/dist/market_adapter/utils/data_discovery.d.ts.map +1 -1
  298. package/dist/market_adapter/utils/data_discovery.js +24 -8
  299. package/dist/market_adapter/utils/data_discovery.js.map +1 -1
  300. package/dist/market_adapter/utils/dynamic_grid_snapshot.d.ts.map +1 -1
  301. package/dist/market_adapter/utils/dynamic_grid_snapshot.js +2 -5
  302. package/dist/market_adapter/utils/dynamic_grid_snapshot.js.map +1 -1
  303. package/dist/market_adapter/utils/file_lock.d.ts +4 -1
  304. package/dist/market_adapter/utils/file_lock.d.ts.map +1 -1
  305. package/dist/market_adapter/utils/file_lock.js +89 -25
  306. package/dist/market_adapter/utils/file_lock.js.map +1 -1
  307. package/dist/market_adapter/utils/native_history.d.ts.map +1 -1
  308. package/dist/market_adapter/utils/native_history.js +5 -1
  309. package/dist/market_adapter/utils/native_history.js.map +1 -1
  310. package/dist/modules/account_bots.d.ts.map +1 -1
  311. package/dist/modules/account_bots.js +47 -12
  312. package/dist/modules/account_bots.js.map +1 -1
  313. package/dist/modules/authority_resolver.js +1 -1
  314. package/dist/modules/authority_resolver.js.map +1 -1
  315. package/dist/modules/bitshares-native/chain_client.js +1 -1
  316. package/dist/modules/bitshares-native/chain_client.js.map +1 -1
  317. package/dist/modules/bitshares-native/crypto/ecc.browser.d.ts +0 -12
  318. package/dist/modules/bitshares-native/crypto/ecc.browser.d.ts.map +1 -1
  319. package/dist/modules/bitshares-native/crypto/ecc.browser.js +1 -1
  320. package/dist/modules/bitshares-native/crypto/ecc.browser.js.map +1 -1
  321. package/dist/modules/bitshares-native/crypto/ecc_selector.js +1 -1
  322. package/dist/modules/bitshares-native/crypto/ecc_selector.js.map +1 -1
  323. package/dist/modules/bitshares-native/index.d.ts.map +1 -1
  324. package/dist/modules/bitshares-native/index.js +1 -1
  325. package/dist/modules/bitshares-native/index.js.map +1 -1
  326. package/dist/modules/bitshares-native/lru_cache.js +1 -1
  327. package/dist/modules/bitshares-native/lru_cache.js.map +1 -1
  328. package/dist/modules/bitshares-native/resolvers.d.ts +0 -2
  329. package/dist/modules/bitshares-native/resolvers.d.ts.map +1 -1
  330. package/dist/modules/bitshares-native/resolvers.js +18 -4
  331. package/dist/modules/bitshares-native/resolvers.js.map +1 -1
  332. package/dist/modules/bitshares-native/serial/chain_constants.js +1 -1
  333. package/dist/modules/bitshares-native/serial/chain_constants.js.map +1 -1
  334. package/dist/modules/bitshares-native/serial/index.d.ts.map +1 -1
  335. package/dist/modules/bitshares-native/serial/index.js +1 -1
  336. package/dist/modules/bitshares-native/serial/index.js.map +1 -1
  337. package/dist/modules/bitshares-native/serial/operations.js +1 -1
  338. package/dist/modules/bitshares-native/serial/operations.js.map +1 -1
  339. package/dist/modules/bitshares-native/serial/serializer.js +1 -1
  340. package/dist/modules/bitshares-native/serial/serializer.js.map +1 -1
  341. package/dist/modules/bitshares-native/serial/types.js +1 -1
  342. package/dist/modules/bitshares-native/serial/types.js.map +1 -1
  343. package/dist/modules/bitshares-native/signing_client.js +2 -2
  344. package/dist/modules/bitshares-native/signing_client.js.map +1 -1
  345. package/dist/modules/bitshares-native/subscriptions.d.ts.map +1 -1
  346. package/dist/modules/bitshares-native/subscriptions.js +5 -14
  347. package/dist/modules/bitshares-native/subscriptions.js.map +1 -1
  348. package/dist/modules/bitshares-native/transport.js +1 -1
  349. package/dist/modules/bitshares-native/transport.js.map +1 -1
  350. package/dist/modules/bitshares-native/tx/builder.js +1 -1
  351. package/dist/modules/bitshares-native/tx/builder.js.map +1 -1
  352. package/dist/modules/bitshares-native/tx/tx_cache.d.ts +3 -2
  353. package/dist/modules/bitshares-native/tx/tx_cache.d.ts.map +1 -1
  354. package/dist/modules/bitshares-native/tx/tx_cache.js +7 -4
  355. package/dist/modules/bitshares-native/tx/tx_cache.js.map +1 -1
  356. package/dist/modules/bitshares_client.js +10 -10
  357. package/dist/modules/bitshares_client.js.map +1 -1
  358. package/dist/modules/bot_settings.d.ts.map +1 -1
  359. package/dist/modules/bot_settings.js +11 -18
  360. package/dist/modules/bot_settings.js.map +1 -1
  361. package/dist/modules/bots_file_lock.d.ts +1 -1
  362. package/dist/modules/bots_file_lock.js +1 -1
  363. package/dist/modules/broadcast_failure.d.ts +13 -0
  364. package/dist/modules/broadcast_failure.d.ts.map +1 -1
  365. package/dist/modules/broadcast_failure.js +0 -13
  366. package/dist/modules/broadcast_failure.js.map +1 -1
  367. package/dist/modules/chain_orders.d.ts.map +1 -1
  368. package/dist/modules/chain_orders.js +15 -17
  369. package/dist/modules/chain_orders.js.map +1 -1
  370. package/dist/modules/config.js +1 -1
  371. package/dist/modules/config.js.map +1 -1
  372. package/dist/modules/constants.d.ts +21 -20
  373. package/dist/modules/constants.d.ts.map +1 -1
  374. package/dist/modules/constants.js +60 -63
  375. package/dist/modules/constants.js.map +1 -1
  376. package/dist/modules/cr_planner.d.ts +1 -7
  377. package/dist/modules/cr_planner.d.ts.map +1 -1
  378. package/dist/modules/cr_planner.js +3 -77
  379. package/dist/modules/cr_planner.js.map +1 -1
  380. package/dist/modules/credential_policy.d.ts +0 -4
  381. package/dist/modules/credential_policy.d.ts.map +1 -1
  382. package/dist/modules/credential_policy.js +17 -2
  383. package/dist/modules/credential_policy.js.map +1 -1
  384. package/dist/modules/credit_runtime.d.ts +0 -7
  385. package/dist/modules/credit_runtime.d.ts.map +1 -1
  386. package/dist/modules/credit_runtime.js +21 -60
  387. package/dist/modules/credit_runtime.js.map +1 -1
  388. package/dist/modules/crypto/index.d.ts +0 -2
  389. package/dist/modules/crypto/index.d.ts.map +1 -1
  390. package/dist/modules/crypto/index.js +0 -2
  391. package/dist/modules/crypto/index.js.map +1 -1
  392. package/dist/modules/crypto/sync.js.map +1 -1
  393. package/dist/modules/daemon_node_health.js +1 -1
  394. package/dist/modules/daemon_node_health.js.map +1 -1
  395. package/dist/modules/dexbot_class.d.ts +8 -134
  396. package/dist/modules/dexbot_class.d.ts.map +1 -1
  397. package/dist/modules/dexbot_class.js +36 -197
  398. package/dist/modules/dexbot_class.js.map +1 -1
  399. package/dist/modules/dexbot_credential_client.js +1 -1
  400. package/dist/modules/dexbot_credential_client.js.map +1 -1
  401. package/dist/modules/dexbot_fill_runtime.d.ts.map +1 -1
  402. package/dist/modules/dexbot_fill_runtime.js +3 -6
  403. package/dist/modules/dexbot_fill_runtime.js.map +1 -1
  404. package/dist/modules/dexbot_maintenance_runtime.d.ts +6 -34
  405. package/dist/modules/dexbot_maintenance_runtime.d.ts.map +1 -1
  406. package/dist/modules/dexbot_maintenance_runtime.js +27 -19
  407. package/dist/modules/dexbot_maintenance_runtime.js.map +1 -1
  408. package/dist/modules/dexbot_startup_runtime.d.ts.map +1 -1
  409. package/dist/modules/dexbot_startup_runtime.js +31 -15
  410. package/dist/modules/dexbot_startup_runtime.js.map +1 -1
  411. package/dist/modules/dexbot_state_recovery.d.ts +2 -2
  412. package/dist/modules/dexbot_state_recovery.d.ts.map +1 -1
  413. package/dist/modules/dexbot_state_recovery.js +9 -6
  414. package/dist/modules/dexbot_state_recovery.js.map +1 -1
  415. package/dist/modules/fund_registry.d.ts.map +1 -1
  416. package/dist/modules/fund_registry.js +19 -4
  417. package/dist/modules/fund_registry.js.map +1 -1
  418. package/dist/modules/general_settings.d.ts +1 -2
  419. package/dist/modules/general_settings.d.ts.map +1 -1
  420. package/dist/modules/general_settings.js +1 -2
  421. package/dist/modules/general_settings.js.map +1 -1
  422. package/dist/modules/graceful_shutdown.d.ts.map +1 -1
  423. package/dist/modules/graceful_shutdown.js +10 -1
  424. package/dist/modules/graceful_shutdown.js.map +1 -1
  425. package/dist/modules/grid_price_source.d.ts +19 -0
  426. package/dist/modules/grid_price_source.d.ts.map +1 -0
  427. package/dist/modules/grid_price_source.js +23 -0
  428. package/dist/modules/grid_price_source.js.map +1 -0
  429. package/dist/modules/key_store.d.ts +0 -5
  430. package/dist/modules/key_store.d.ts.map +1 -1
  431. package/dist/modules/key_store.js +1 -14
  432. package/dist/modules/key_store.js.map +1 -1
  433. package/dist/modules/launcher/bot_supervisor.d.ts.map +1 -1
  434. package/dist/modules/launcher/bot_supervisor.js +9 -19
  435. package/dist/modules/launcher/bot_supervisor.js.map +1 -1
  436. package/dist/modules/launcher/child_env.d.ts +1 -2
  437. package/dist/modules/launcher/child_env.d.ts.map +1 -1
  438. package/dist/modules/launcher/child_env.js +1 -1
  439. package/dist/modules/launcher/child_env.js.map +1 -1
  440. package/dist/modules/launcher/foreign_cred_daemon.d.ts.map +1 -1
  441. package/dist/modules/launcher/foreign_cred_daemon.js +2 -14
  442. package/dist/modules/launcher/foreign_cred_daemon.js.map +1 -1
  443. package/dist/modules/launcher/market_adapter_runtime.d.ts +1 -1
  444. package/dist/modules/launcher/market_adapter_runtime.d.ts.map +1 -1
  445. package/dist/modules/launcher/market_adapter_runtime.js +3 -14
  446. package/dist/modules/launcher/market_adapter_runtime.js.map +1 -1
  447. package/dist/modules/launcher/market_adapter_watchdog.d.ts.map +1 -1
  448. package/dist/modules/launcher/market_adapter_watchdog.js +3 -2
  449. package/dist/modules/launcher/market_adapter_watchdog.js.map +1 -1
  450. package/dist/modules/launcher/monolithic_runtime.d.ts +0 -1
  451. package/dist/modules/launcher/monolithic_runtime.d.ts.map +1 -1
  452. package/dist/modules/launcher/monolithic_runtime.js +3 -18
  453. package/dist/modules/launcher/monolithic_runtime.js.map +1 -1
  454. package/dist/modules/launcher/runtime_entry.d.ts.map +1 -1
  455. package/dist/modules/launcher/runtime_entry.js +4 -5
  456. package/dist/modules/launcher/runtime_entry.js.map +1 -1
  457. package/dist/modules/launcher/status_reporting.js +1 -1
  458. package/dist/modules/launcher/status_reporting.js.map +1 -1
  459. package/dist/modules/launcher/supervisor_control.js +1 -1
  460. package/dist/modules/launcher/supervisor_control.js.map +1 -1
  461. package/dist/modules/market_adapter_whitelist.d.ts +2 -2
  462. package/dist/modules/market_adapter_whitelist.d.ts.map +1 -1
  463. package/dist/modules/market_adapter_whitelist.js +12 -6
  464. package/dist/modules/market_adapter_whitelist.js.map +1 -1
  465. package/dist/modules/node_failure_ledger.d.ts +23 -0
  466. package/dist/modules/node_failure_ledger.d.ts.map +1 -1
  467. package/dist/modules/node_failure_ledger.js +0 -23
  468. package/dist/modules/node_failure_ledger.js.map +1 -1
  469. package/dist/modules/node_manager.d.ts.map +1 -1
  470. package/dist/modules/node_manager.js +3 -3
  471. package/dist/modules/node_manager.js.map +1 -1
  472. package/dist/modules/order/accounting.js +1 -1
  473. package/dist/modules/order/accounting.js.map +1 -1
  474. package/dist/modules/order/async_lock.d.ts +6 -0
  475. package/dist/modules/order/async_lock.d.ts.map +1 -1
  476. package/dist/modules/order/async_lock.js +11 -0
  477. package/dist/modules/order/async_lock.js.map +1 -1
  478. package/dist/modules/order/export.d.ts +1 -1
  479. package/dist/modules/order/export.js +10 -10
  480. package/dist/modules/order/export.js.map +1 -1
  481. package/dist/modules/order/format.d.ts +1 -0
  482. package/dist/modules/order/format.d.ts.map +1 -1
  483. package/dist/modules/order/format.js +0 -6
  484. package/dist/modules/order/format.js.map +1 -1
  485. package/dist/modules/order/grid.d.ts +2 -12
  486. package/dist/modules/order/grid.d.ts.map +1 -1
  487. package/dist/modules/order/grid.js +40 -27
  488. package/dist/modules/order/grid.js.map +1 -1
  489. package/dist/modules/order/grid_reconcile.d.ts +1 -1
  490. package/dist/modules/order/grid_reconcile.js +1 -1
  491. package/dist/modules/order/grid_reconcile_internal.js +1 -1
  492. package/dist/modules/order/grid_reconcile_internal.js.map +1 -1
  493. package/dist/modules/order/logger.d.ts +3 -0
  494. package/dist/modules/order/logger.d.ts.map +1 -1
  495. package/dist/modules/order/logger.js +22 -13
  496. package/dist/modules/order/logger.js.map +1 -1
  497. package/dist/modules/order/logger_state.d.ts +4 -9
  498. package/dist/modules/order/logger_state.d.ts.map +1 -1
  499. package/dist/modules/order/logger_state.js +5 -14
  500. package/dist/modules/order/logger_state.js.map +1 -1
  501. package/dist/modules/order/manager.d.ts +1 -4
  502. package/dist/modules/order/manager.d.ts.map +1 -1
  503. package/dist/modules/order/manager.js +34 -33
  504. package/dist/modules/order/manager.js.map +1 -1
  505. package/dist/modules/order/processed_fill_store.d.ts.map +1 -1
  506. package/dist/modules/order/processed_fill_store.js +9 -3
  507. package/dist/modules/order/processed_fill_store.js.map +1 -1
  508. package/dist/modules/order/strategy.d.ts +6 -4
  509. package/dist/modules/order/strategy.d.ts.map +1 -1
  510. package/dist/modules/order/strategy.js +6 -4
  511. package/dist/modules/order/strategy.js.map +1 -1
  512. package/dist/modules/order/sync_engine.js +7 -7
  513. package/dist/modules/order/sync_engine.js.map +1 -1
  514. package/dist/modules/order/utils/math.d.ts +29 -3
  515. package/dist/modules/order/utils/math.d.ts.map +1 -1
  516. package/dist/modules/order/utils/math.js +54 -10
  517. package/dist/modules/order/utils/math.js.map +1 -1
  518. package/dist/modules/order/utils/order.d.ts.map +1 -1
  519. package/dist/modules/order/utils/order.js +14 -2
  520. package/dist/modules/order/utils/order.js.map +1 -1
  521. package/dist/modules/order/utils/system.d.ts +3 -8
  522. package/dist/modules/order/utils/system.d.ts.map +1 -1
  523. package/dist/modules/order/utils/system.js +14 -4
  524. package/dist/modules/order/utils/system.js.map +1 -1
  525. package/dist/modules/order/utils/validate.js +1 -1
  526. package/dist/modules/order/utils/validate.js.map +1 -1
  527. package/dist/modules/path_api.js +1 -1
  528. package/dist/modules/path_api.js.map +1 -1
  529. package/dist/modules/paths.d.ts +1 -7
  530. package/dist/modules/paths.d.ts.map +1 -1
  531. package/dist/modules/paths.js +1 -1
  532. package/dist/modules/paths.js.map +1 -1
  533. package/dist/modules/process_discovery.d.ts +3 -0
  534. package/dist/modules/process_discovery.d.ts.map +1 -1
  535. package/dist/modules/process_discovery.js +15 -1
  536. package/dist/modules/process_discovery.js.map +1 -1
  537. package/dist/modules/runtime_settings.js +1 -1
  538. package/dist/modules/runtime_settings.js.map +1 -1
  539. package/dist/modules/settings_merge.d.ts +5 -1
  540. package/dist/modules/settings_merge.d.ts.map +1 -1
  541. package/dist/modules/settings_merge.js +14 -3
  542. package/dist/modules/settings_merge.js.map +1 -1
  543. package/dist/modules/socket_json_client.d.ts.map +1 -1
  544. package/dist/modules/socket_json_client.js +12 -2
  545. package/dist/modules/socket_json_client.js.map +1 -1
  546. package/dist/modules/storage/browser_adapter.d.ts.map +1 -1
  547. package/dist/modules/storage/browser_adapter.js +5 -3
  548. package/dist/modules/storage/browser_adapter.js.map +1 -1
  549. package/dist/modules/storage/index.d.ts +1 -1
  550. package/dist/modules/storage/index.js +1 -1
  551. package/dist/modules/types.d.ts +1 -1
  552. package/dist/modules/types.d.ts.map +1 -1
  553. package/dist/modules/validate_profiles.d.ts.map +1 -1
  554. package/dist/modules/validate_profiles.js +6 -8
  555. package/dist/modules/validate_profiles.js.map +1 -1
  556. package/dist/pm2.d.ts.map +1 -1
  557. package/dist/pm2.js +2 -3
  558. package/dist/pm2.js.map +1 -1
  559. package/dist/scripts/analyze-git.d.ts +1 -1
  560. package/dist/scripts/analyze-git.js +1 -1
  561. package/dist/scripts/analyze-orders.d.ts.map +1 -1
  562. package/dist/scripts/analyze-orders.js +61 -18
  563. package/dist/scripts/analyze-orders.js.map +1 -1
  564. package/dist/scripts/diagnose-pool-history.js +1 -1
  565. package/dist/scripts/divergence-calc.d.ts +1 -1
  566. package/dist/scripts/divergence-calc.js +3 -3
  567. package/dist/scripts/native_release_gates.js +4 -2
  568. package/dist/scripts/native_release_gates.js.map +1 -1
  569. package/dist/scripts/print_grid.d.ts +1 -1
  570. package/dist/scripts/print_grid.js +1 -1
  571. package/dist/scripts/run-tests.js +38 -19
  572. package/dist/scripts/run-tests.js.map +1 -1
  573. package/dist/scripts/runner.d.ts +3 -5
  574. package/dist/scripts/runner.d.ts.map +1 -1
  575. package/dist/scripts/runner.js +3 -5
  576. package/dist/scripts/runner.js.map +1 -1
  577. package/dist/scripts/sync-version.d.ts +2 -2
  578. package/dist/scripts/sync-version.js +7 -4
  579. package/dist/scripts/sync-version.js.map +1 -1
  580. package/dist/scripts/update.d.ts +1 -1
  581. package/dist/scripts/update.js +1 -1
  582. package/dist/scripts/validate_bots.d.ts +1 -1
  583. package/dist/scripts/validate_bots.js +1 -1
  584. package/dist/scripts/verify-browser-bundle.d.ts +1 -1
  585. package/dist/scripts/verify-browser-bundle.js +1 -1
  586. package/dist/unlock.js +4 -4
  587. package/dist/unlock.js.map +1 -1
  588. package/docs/BITSHARES_ONBOARDING.md +15 -10
  589. package/docs/COPY_ON_WRITE_MASTER_PLAN.md +9 -9
  590. package/docs/DEXBOT_COMPARISON.md +19 -19
  591. package/docs/EVOLUTION.md +18 -44
  592. package/docs/FUND_MOVEMENT_AND_ACCOUNTING.md +1 -1
  593. package/docs/GRID_RECALCULATION.md +1 -1
  594. package/docs/README.md +3 -3
  595. package/docs/architecture.md +5 -5
  596. package/docs/developer_guide.md +6 -6
  597. package/market_adapter/README.md +13 -8
  598. package/package.json +22 -14
  599. package/scripts/README.md +33 -7
  600. package/scripts/clean-dist.js +10 -2
  601. package/tests/README.md +4 -3
@@ -456,25 +456,30 @@ trading fees before going live (see [Fund the account](#22-fund-the-account)).
456
456
 
457
457
  ---
458
458
 
459
- ## Further reading
460
-
461
- - [Root README](../README.md#contents) — install, config, command reference
462
- - [Market Adapter](../market_adapter/README.md#quick-start) — AMA pricing and grid tuning
463
- - [MPA and Credit Usage](MPA_CREDIT_USAGE.md#which-section-do-i-need) — borrowing and credit offer workflows
464
-
465
- ---
466
-
467
459
  ## Interaction
468
460
 
469
461
  Different ways to interact with your BitShares account:
470
462
 
471
463
  - [bts.exchange](https://bts.exchange) — Hosted reference wallet
464
+ - [XBTS Exchange](https://trade.xbts.io/) — Hosted exchange and wallet
472
465
  - [Mobile App](https://github.com/bitshares/bitshares-mobile-app/releases) — Mobile Android app
473
466
  - [Astro UI](https://github.com/BTS-CM/astro-ui/releases) — Local UI
474
467
  - [BeetVault](https://github.com/beetapp/BeetVault) — Local Key Manager
475
468
  - [BitShares Wallet](https://pi314x.github.io/bitshares-wallet-browser-extension) — Browser Extension
476
469
  - [Paper Wallet](https://paperwallet.bitshares.eu/) — Print Wallet
477
470
 
478
- ## Full Link Collection
471
+ ---
472
+
473
+ ## Further reading
474
+
475
+ - [Documentation Index](README.md) — full docs hub: architecture, lifecycle, workflows, and reference docs
476
+ - [Market Adapter](../market_adapter/README.md#quick-start) — AMA pricing and grid tuning
477
+ - [MPA and Credit Usage](MPA_CREDIT_USAGE.md#which-section-do-i-need) — borrowing and credit offer workflows
478
+
479
+ ## Link Collection
479
480
 
480
- - [BitShares IS AWESOME](https://github.com/bitshares/awesome-bitshares)
481
+ - [![Telegram](https://img.shields.io/badge/Telegram-%40DEXBot__2-26A5E4?logo=telegram&logoColor=white)](https://t.me/DEXBot_2)
482
+ - [![Website](https://img.shields.io/badge/Website-dexbot.org-4FC08D?logo=internet-explorer&logoColor=white)](https://dexbot.org/)
483
+ - [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/froooze/DEXBot2)
484
+ - [![Awesome BitShares](https://camo.githubusercontent.com/9d49598b873146ec650fb3f275e8a532c765dabb1f61d5afa25be41e79891aa7/68747470733a2f2f617765736f6d652e72652f62616467652e737667)](https://github.com/bitshares/awesome-bitshares)
485
+ - [![Reddit](https://img.shields.io/badge/Reddit-r%2FBitShares-ff4500?logo=reddit&logoColor=white)](https://www.reddit.com/r/BitShares/)
@@ -494,12 +494,12 @@ Stale-Plan & Stack Discipline Tests (v1.4.8):
494
494
  ## Appendix D: Validation Gates
495
495
 
496
496
  Run these tests before promotion:
497
- - `tsx tests/test_engine_integration.ts`
498
- - `tsx tests/test_sequential_multi_fill.ts`
499
- - `tsx tests/test_sync_logic.ts`
500
- - `tsx tests/test_ghost_order_fix.ts`
501
- - `tsx tests/test_working_grid.ts`
502
- - `tsx tests/test_cow_master_plan.ts`
503
- - `tsx tests/test_cow_commit_guards.ts`
504
- - `tsx tests/test_cow_concurrent_fills.ts`
505
- - `tsx tests/test_cow_divergence_correction.ts`
497
+ - `node dist/tests/test_engine_integration.js`
498
+ - `node dist/tests/test_sequential_multi_fill.js`
499
+ - `node dist/tests/test_sync_logic.js`
500
+ - `node dist/tests/test_ghost_order_fix.js`
501
+ - `node dist/tests/test_working_grid.js`
502
+ - `node dist/tests/test_cow_master_plan.js`
503
+ - `node dist/tests/test_cow_commit_guards.js`
504
+ - `node dist/tests/test_cow_concurrent_fills.js`
505
+ - `node dist/tests/test_cow_divergence_correction.js`
@@ -1,7 +1,7 @@
1
1
  # DEXBot vs DEXBot2 — Detailed Comparison Report
2
2
 
3
- > **Date:** 2026-08-19 *(metrics refreshed against local source trees)*
4
- > **Scope:** Full architectural, functional, and operational comparison between the original [DEXBot](https://github.com/Codaone/DEXBot) (Python, v1.0.0) and DEXBot2 (TypeScript, v1.4.21).
3
+ > **Date:** 2026-08-28 *(metrics refreshed against local source trees)*
4
+ > **Scope:** Full architectural, functional, and operational comparison between the original [DEXBot](https://github.com/Codaone/DEXBot) (Python, v1.0.0) and DEXBot2 (TypeScript, v1.4.23).
5
5
  > **Audience:** Developers, contributors, and operators evaluating or migrating between the two projects.
6
6
 
7
7
  ---
@@ -36,17 +36,17 @@
36
36
 
37
37
  | Attribute | DEXBot (original) | DEXBot2 |
38
38
  |---|---|---|
39
- | **Release Track** | 1.0.0 | v1.4.21 |
39
+ | **Release Track** | 1.0.0 | v1.4.23 |
40
40
  | **Language** | Python 3.6+ | TypeScript 5.x |
41
41
  | **Status** | Released 1.0.0, unmaintained | Active development |
42
- | **Last Repo Activity** | May 23, 2020 | 2026-08-19 |
42
+ | **Last Repo Activity** | May 23, 2020 | 2026-08-28 |
43
43
  | **License** | MIT | MIT |
44
44
  | **Origin** | BitShares worker-proposal funded, Codaone Oy | Private rewrite by froooze |
45
45
  | **Primary Goal** | Multi-strategy, extensible trading framework | Hardened adaptive grid runtime with operator/AI tooling |
46
46
  | **Target Exchange** | BitShares DEX | BitShares DEX |
47
47
  | **Lines of Code** | ~10,846 Python LOC in `dexbot/` | Large TypeScript codebase; core runtime, adapter, analysis, Claw, and test modules |
48
- | **Source Files** | 72 Python files in `dexbot/` | ~527 TS files across the repo |
49
- | **Test Files** | 16 Python test files | 252 `test_*.ts` files (252 auto-discovered via `globSync`) |
48
+ | **Source Files** | 72 Python files in `dexbot/` | ~535 TS files across the repo |
49
+ | **Test Files** | 16 Python test files | 255 `test_*.ts` files (255 auto-discovered via `globSync`) |
50
50
 
51
51
  ### Summary
52
52
 
@@ -70,7 +70,7 @@ DEXBot2 is a ground-up rewrite in TypeScript that prioritizes production correct
70
70
  | **Process Manager** | Systemd service (Linux) | `dexbot start` (native monolithic launcher, default; `unlock` runtime) — PM2 optional |
71
71
  | **External APIs** | CoinGecko, CCXT, Waves | On-chain/pool/Kibana candle inputs; optional CEX synthetic seed generator (`fetch_cex_synthetic_data.ts`) for adapter bootstrap |
72
72
  | **Container** | Docker (Ubuntu 18.04) | Docker (multi-stage) |
73
- | **Testing** | pytest + Docker testnet | Native Node assert (252 `test_*.ts` files; auto-discovered via `globSync`) |
73
+ | **Testing** | pytest + Docker testnet | Native Node assert (255 `test_*.ts` files; auto-discovered via `globSync`) |
74
74
  | **CI/CD** | Travis CI, AppVeyor | GitHub Actions / local deterministic script suite |
75
75
  | **Packaging** | PyInstaller (Win/Mac/Linux binaries) | npm / `unlock` + optional PM2 ecosystem |
76
76
 
@@ -616,7 +616,7 @@ Where:
616
616
  ### DEXBot2
617
617
 
618
618
  - **Framework:** Native Node `assert` module (no external test framework)
619
- - **252 `test_*.ts` files** auto-discovered via `globSync` (`tests/test_*.ts` + `claw/tests/test_*.ts`), covering:
619
+ - **255 `test_*.ts` files** auto-discovered via `globSync` (`tests/test_*.ts` + `claw/tests/test_*.ts`), covering:
620
620
  - Unit tests: accounting, strategy, grid, manager logic
621
621
  - Copy-on-Write semantics: COW commits, guards, concurrent fills
622
622
  - Edge cases: authoritative full-fill resolution, partial fills, BTS fee accounting, precision
@@ -634,7 +634,7 @@ Where:
634
634
  | Feature | DEXBot | DEXBot2 |
635
635
  |---|---|---|
636
636
  | **Framework** | pytest | Native Node assert |
637
- | **Test Count** | 16 Python test files | 252 `test_*.ts` files; auto-discovered via `globSync` |
637
+ | **Test Count** | 16 Python test files | 255 `test_*.ts` files; auto-discovered via `globSync` |
638
638
  | **Test Types** | Unit + integration | Unit + integration + edge-case + runtime regression |
639
639
  | **Testnet Integration** | Yes (Docker) | No (mocks) |
640
640
  | **External Dependency** | pytest, Docker | None |
@@ -666,7 +666,7 @@ Where:
666
666
  | `docs/COPY_ON_WRITE_MASTER_PLAN.md` | Deep dive into COW implementation |
667
667
  | `docs/FUND_MOVEMENT_AND_ACCOUNTING.md` | Fund tracking model, invariants |
668
668
  | `docs/developer_guide.md` | Developer quick start, glossary, examples |
669
- | `docs/EVOLUTION.md` | Project history, 6-phase development |
669
+ | `docs/EVOLUTION.md` | Project history, 9-phase development |
670
670
  | `docs/LOGGING.md` | Logging categories and configuration |
671
671
  | `docs/WORKFLOW.md` | Branch strategy, commit standards |
672
672
  | `tests/README.md` | Test suite organization and categories |
@@ -731,7 +731,7 @@ Where:
731
731
  | Metric | DEXBot | DEXBot2 |
732
732
  |---|---|---|
733
733
  | **Production Packages** | ~15-20 | 0 |
734
- | **Dev Packages** | ~5-8 | 3 (TypeScript, tsx, @types/node) |
734
+ | **Dev Packages** | ~5-8 | 2 (TypeScript, @types/node) |
735
735
  | **GUI Framework** | PyQt5 (~80MB) | None |
736
736
  | **Database ORM** | SQLAlchemy | None |
737
737
  | **External Price APIs** | CoinGecko, CCXT, Waves | None (runtime dep); optional CEX seed generator for adapter bootstrap |
@@ -780,14 +780,14 @@ Where:
780
780
 
781
781
  | Metric | DEXBot | DEXBot2 |
782
782
  |---|---|---|
783
- | **Release Track** | 1.0.0 | v1.4.21 |
783
+ | **Release Track** | 1.0.0 | v1.4.23 |
784
784
  | **Active Since** | ~2018 | December 2025 |
785
- | **Last Commit** | May 23, 2020 | 2026-08-19 |
786
- | **Total Commits** | 2281 | 2,034 (v1.4.17) |
785
+ | **Last Commit** | May 23, 2020 | 2026-08-28 |
786
+ | **Total Commits** | 2281 | 2,097 (v1.4.23) |
787
787
  | **Lines of Code** | ~10,846 Python LOC in `dexbot/` | Large TypeScript runtime + adapter + Claw + analysis + tests |
788
- | **Source Files** | 72 Python files in `dexbot/` | ~527 TS files across the repo |
789
- | **Test Files** | 16 Python test files | 252 `test_*.ts` files (252 auto-discovered via `globSync`) |
790
- | **Documentation** | Sphinx docs + README | 50+ Markdown docs plus Claw skills/references |
788
+ | **Source Files** | 72 Python files in `dexbot/` | ~535 TS files across the repo |
789
+ | **Test Files** | 16 Python test files | 255 `test_*.ts` files (255 auto-discovered via `globSync`) |
790
+ | **Documentation** | Sphinx docs + README | 60+ Markdown docs plus Claw skills/references |
791
791
  | **Strategies** | 3 + plugins | 1 |
792
792
  | **Max Concurrent Bots** | Many (one process) | Many (one monolithic process by default; per-bot via `--isolated`/PM2) |
793
793
  | **Primary Developer** | Codaone Oy (team) | froooze (individual, 100% commits) |
@@ -886,7 +886,7 @@ The 500× figure is not theoretical: it materializes in production when higher o
886
886
  | **Security** | ★★★☆☆ | ★★★★★ (AES-256-GCM, credential daemon, authority resolution) | DEXBot2 |
887
887
  | **Ease of Setup** | ★★☆☆☆ (PyQt5/PyInstaller/Systemd dependency hell) | ★★★★★ (`npm i -g dexbot`, zero deps) | DEXBot2 |
888
888
  | **Accessibility** | ★★★★★ (GUI) | ★★☆☆☆ (CLI only) | DEXBot |
889
- | **Testing Depth** | ★★★☆☆ | ★★★★★ (252 test files; focused regressions) | DEXBot2 |
889
+ | **Testing Depth** | ★★★☆☆ | ★★★★★ (255 test files; focused regressions) | DEXBot2 |
890
890
  | **Documentation** | ★★★☆☆ | ★★★★★ (architecture/accounting/security/adapter docs) | DEXBot2 |
891
891
  | **Dependency Footprint** | ★★☆☆☆ (heavy) | ★★★★★ (0 runtime deps) | DEXBot2 |
892
892
  | **Extensibility** | ★★★★★ (plugins) | ★☆☆☆☆ | DEXBot |
@@ -919,4 +919,4 @@ The practical migration path is to treat DEXBot2 as a new runtime: recreate bot
919
919
 
920
920
  ---
921
921
 
922
- *Report generated 2026-08-19. Metrics refreshed 2026-08-19 from local DEXBot-master and DEXBot2 source trees.*
922
+ *Report generated 2026-08-28. Metrics refreshed 2026-08-28 from local DEXBot-master and DEXBot2 source trees.*
package/docs/EVOLUTION.md CHANGED
@@ -2,14 +2,14 @@
2
2
 
3
3
  ## Executive Summary
4
4
 
5
- DEXBot2 is a sophisticated decentralized exchange trading bot for the BitShares blockchain. This report documents the complete evolution of the project from its inception in December 2025 through the current 1.4.21 stable release.
5
+ DEXBot2 is a sophisticated decentralized exchange trading bot for the BitShares blockchain. This report documents the complete evolution of the project from its inception in December 2025 through the current 1.4.23 stable release.
6
6
 
7
7
  ### Key Milestones
8
8
  - **Project Inception**: December 2, 2025
9
- - **Growth Phase**: 2,068 commits over ~9 active months
10
- - **Code Maturity**: Evolution from basic utilities to a ~70,000+ LoC intelligent TypeScript system
11
- - **Stability**: Progression from manual testing to a suite of 252 automated test files
12
- - **Releases**: 98 release entries (v0.1.0 to v1.4.21)
9
+ - **Growth Phase**: 2,097 commits over ~9 active months
10
+ - **Code Maturity**: Evolution from basic utilities to a ~100,000+ LoC intelligent TypeScript system
11
+ - **Stability**: Progression from manual testing to a suite of 255 automated test files
12
+ - **Releases**: 99 release entries (v0.1.0 to v1.4.23)
13
13
 
14
14
  ---
15
15
 
@@ -45,7 +45,7 @@ Consolidated the market adapter with split data sources, AMA-derived grid center
45
45
 
46
46
  ### Phase 5: Signal Intelligence, Stable Release & Browser Compatibility (March – June 2026)
47
47
 
48
- The project entered its most transformative phase: a derivative signal engine (dynamic trend-weighting, volatility scaling, regime classification) and a credit/debt MPA runtime were added, the codebase shed all external runtime dependencies while migrating fully to TypeScript, and a security audit of the unlock/daemon stack culminated in the first stable release — v1.0.0 on Jun 16 (profile validation, shared-account fund registry, proportional collateral). A browser-compatibility pass (portable abstractions, pure-JS crypto, storage-adapter I/O) made 140+ files browser-safe. This produced the multi-layered runtime that still shapes the project: COW order core, signal pipeline, credit/debt MPA runtime, and a browser-compatible core.
48
+ The project entered its most transformative phase: a derivative signal engine (dynamic trend-weighting, volatility scaling, regime classification) and a credit/debt MPA runtime were added, the codebase shed all external runtime dependencies while migrating fully to TypeScript, and a security audit of the unlock/daemon stack culminated in the first stable release — v1.0.0 on Jun 16 (profile validation, shared-account fund registry, proportional collateral). A browser-compatibility pass (portable abstractions, pure-JS crypto, storage-adapter I/O) made 140+ files browser-safe.
49
49
 
50
50
  ### Phase 6: Production Hardening & Iterative Refinement (June – July 2026)
51
51
 
@@ -53,21 +53,15 @@ Post-stable work focused on reliability: subscription watchdogs, broadcast deadl
53
53
 
54
54
  ### Phase 7: COW Concurrency & Uncertain-Broadcast Hardening (Late July 2026)
55
55
 
56
- After the CJS→ESM migration and strict-mode zero-errors completed the module transition, the v1.4.x releases corrected the COW concurrency model — centralized `withBlockchainRetry` with node failover, a 4-layer duplicate CREATE guard, lock-hierarchy reorder, AsyncLock forceRelease safety, and fund-accounting race hardening — fixing stale COW fund snapshots, phantom-order inflation, and the create-cancel loop. v1.4.8 then closed the uncertain-broadcast and truncated-read ambiguity classes: broadcasts are never blindly re-signed (the credential daemon retries only provably-untransmitted failures), uncertain outcomes surface as typed errors so the COW runtime verifies chain inclusion before re-broadcasting, and truncate-ambiguous `get_full_accounts` reads defer cancel/discard decisions instead of freeing slots or capital for possibly-live orders.
56
+ After the CJS→ESM migration completed the module transition, the early v1.4.x releases corrected the COW concurrency model — centralized `withBlockchainRetry` with node failover, duplicate-CREATE guards, lock-hierarchy fixes, and fund-accounting race hardening — eliminating stale fund snapshots, phantom-order inflation, and the create-cancel loop. v1.4.8 then closed the uncertain-broadcast and truncated-read ambiguity classes: broadcasts are never blindly re-signed (retries only after verifying chain inclusion), and truncate-ambiguous reads defer cancel/discard decisions instead of freeing slots or capital for possibly-live orders.
57
57
 
58
58
  ### Phase 8: Native ESM Runtime, Broadcast Serialization & Onboarding (August 2026)
59
59
 
60
- v1.4.12 completed the module transition to native ES modules (root + claw `"type": "module"`, Node >= 22 native WebSocket, dist-first ESM entry shims), removed the remaining legacy-compat shims, and pruned dead code — followed by fixes for the migration's rough edges (Node 22.14 require-cycle boot deadlock, phantom residuals, stranded dust, duplicate-orphan double-cancel). v1.4.13 added a single-flight guard that serializes overlapping COW broadcasts (preventing orphan fills), closed fill-lock bypasses, hardened the no-ALS AsyncLock fallback and ESM packaging gaps, promoted `dexbot start` to the canonical launch command, and added a BitShares onboarding tutorial.
60
+ v1.4.12 completed the module transition to native ES modules (root + claw `"type": "module"`, Node >= 22 native WebSocket), removed the remaining legacy-compat shims, and pruned dead code. v1.4.13 followed with a single-flight guard that serializes overlapping COW broadcasts (preventing orphan fills), fill-lock bypass closures, `dexbot start` as the canonical launch command, and a BitShares onboarding tutorial.
61
61
 
62
62
  ### Phase 9: Post-ESM Cleanup, Consolidation & Hardening (August 2026)
63
63
 
64
- v1.4.16 centralized all user/runtime state onto a single resolver-derived profiles dir (`~/.config/dexbot2/profiles`) so it survives re-clones and npm updates and never lands in a read-only package dir, turned divergence surplus-cancel + hole-create pairs into in-place order rotations, and added an npm auto-update flow. v1.4.17 consolidated duplicate code (EC math, Base58Check, settings merge, asset resolution), trimmed `modules/types.ts` from 875 lines to the Order union, purged dead exports, and centralized the analysis tooling under strict TypeScript. v1.4.19 capped COW broadcasts at `MAX_OPS_PER_BROADCAST` (4) with chunked retry-on-uncertain broadcasting, fixed a spread-collapse regression via the shared `isSlotInRail` helper, lowered the AMA slope grid-reset threshold to 8, and added editor price feedback plus a `docs/LIFECYCLE.md` onboarding walkthrough. v1.4.20 hardened spread-correction boundary promotion with a MIN_SPREAD_ORDERS reserve floor and commit-time validation, gated persisted-boundary restore against self-legalizing overrun poison, aligned dynamic-weight clip parity between the live service and the research chart, centralized chart slider ranges, and moved all analysis outputs onto the central path resolver. v1.4.21 fixed silent-failure runtime defects surfaced by a modules-wide audit (NaN fund-invariant tolerance, always-flush fill store, double-decremented fill guard, config num() defaults), aligned the two boundary writers on a shared sell-rail ceiling enforced at commit and restore time, deduplicated claw shared logic while hardening error paths (secret redaction, EPIPE guards, spawn-error surfacing), corrected launcher supervisor/runtime lifecycle bugs, made the browser storage adapter persist deletions and flush debounced, extended editor green/red live color feedback to funds and price inputs, stopped docs/error messages from hardcoding repo-relative profile paths, and pruned dead code across analysis/market_adapter/claw/logging.
65
-
66
- ---
67
-
68
- ## Development Statistics
69
-
70
- The project has accumulated 252 automated test files across 98 release entries. See the **Version History** below for a per-release commit breakdown.
64
+ The post-ESM releases consolidated state, code, and tooling while hardening the grid engine. **State & packaging** (v1.4.14–v1.4.17): all user/runtime state centralized on a resolver-derived profiles dir (`~/.config/dexbot2/profiles`) safe from re-clones, read-only prefixes, and npm wipes; divergence surplus/hole pairs became in-place order rotations; npm auto-update shipped; duplicated EC-crypto/settings/asset-resolution code collapsed; dead exports purged; analysis tooling moved under strict TypeScript. **Grid hardening** (v1.4.19–v1.4.21): COW broadcasts capped at `MAX_OPS_PER_BROADCAST` (4) with chunked retry-on-uncertain; boundary promotion and persisted-boundary restore gated against gap-floor overrun poison behind a shared sell-rail ceiling enforced at commit and restore time; spread-collapse fixed via the shared `isSlotInRail` filter; silent-failure runtime defects from a modules-wide audit fixed (NaN fund-invariant tolerance, always-flush fill store, double-decremented fill guard). **Tooling & UX** (v1.4.20–v1.4.22): live/research clip parity with centralized chart sliders and analysis outputs on the central path resolver; claw logic deduplicated with hardened error paths; browser storage adapter persists deletions; editor green/red input feedback extended to funds and prices; compile-first runtime completed — tsx removed entirely, every entry point and the test suite running compiled dist under plain node through frozen-ESM-safe seams, plus exact AMA cold-start bootstrap sizing and research tools unified onto production slope/bounds math. Post-v1.4.22 work followed the same themes: bot-fitting backtests re-modeled on the production grid lifecycle (slot rotation with realized-only scoring), analysis tooling consolidated onto market_adapter sources with folder-audit bug fixes, a Kibana client hardened against proxy connection resets, and TradingView-style price-axis interaction added to the chart exporter.
71
65
 
72
66
  ---
73
67
 
@@ -86,37 +80,15 @@ The project has accumulated 252 automated test files across 98 release entries.
86
80
 
87
81
  ## Documentation & Testing
88
82
 
89
- Evolved from a basic README to a comprehensive framework (50+ docs entries, 80%+ JSDoc coverage, AGENTS.md). Testing matured from manual blockchain trials → Jest → lightweight Node.js assert across a 252-file suite covering unit, integration, simulation, and COW architectural guard tests.
83
+ Evolved from a basic README to a comprehensive framework (50+ docs entries, 80%+ JSDoc coverage, AGENTS.md). Testing matured from manual blockchain trials → Jest → lightweight Node.js assert across the current suite covering unit, integration, simulation, and COW architectural guard tests.
90
84
 
91
85
  ---
92
86
 
93
- ## Conclusion
94
-
95
- DEXBot2 has matured from a basic grid bot into a signal-intelligent, production-ready trading system.
96
-
97
- ---
98
-
99
- ## Post-1.0.0: Completed
100
-
101
- - **Browser Compatibility**: Portable abstractions, pure-JS crypto, 140+ file refactor for browser-safe surface
102
- - **Credit/MPA Runtime**: Multi-asset collateral support, stale reborrow fixes, oversize deal splitting with per-operation caps
103
- - **I/O Centralization**: Full pipeline routed through storage adapter, shared atomic utilities across 20+ files
104
- - **Self-Healing**: Structural resync, subscription watchdog, broadcast deadlock recovery at both bot and daemon level
105
- - **Performance Analytics**: Kibana-driven FIFO/sequential trade PnL with 16 metrics
106
- - **AMA Refits**: Multi-round parameter optimization with per-market weights and distance scaling
107
- - **System Invariants**: Comprehensive documented invariants across all subsystems (COW, sync, grid, reconciliation)
108
- - **Bot Identity**: Unique name enforcement with migration support
109
- - **Credit-Only Mode**: Runtime-only operation for MPA/credit workflows without grid trading infrastructure
110
- - **Docker Support**: Container build, release images, and secure container startup guidance
111
- - **npm Package**: Published as npm package with versioned releases, lockfile sync, and dependency management
112
- - **Grid Order Engine Hardening**: COW pipeline, zero-amount order prevention, fill batching, dust detection, spread correction, and deadlock recovery
87
+ ## Post-1.0.0 Status
113
88
 
114
- ## Post-1.0.0: Planned
89
+ **Completed**: browser-safe core (140+ files, portable abstractions, pure-JS crypto); credit/MPA runtime (multi-asset collateral, oversize deal splitting); storage-adapter I/O centralization; self-healing (structural resync, subscription watchdog, bot/daemon broadcast-deadlock recovery); Kibana-driven trade PnL analytics; multi-round AMA refits; documented subsystem invariants; bot identity enforcement; credit-only mode; Docker support; npm package with lockfile sync; hardened grid order engine (COW pipeline, zero-amount prevention, fill batching, dust detection, spread correction).
115
90
 
116
- - **Backtesting Engine**: Historical candle replay through the trading engine via exchange abstraction
117
- - **Injectable Interfaces**: Dependency inversion at call boundaries for improved testability
118
- - **Database + Validation**: SQLite persistence with Zod schema validation at the blockchain boundary
119
- - **Telegram Bot**: planned but **not yet implemented** — owner-gated monitoring (`/status`, `/orders`, `/grid`, `/balance`) and opt-in+confirm gated control (`/start`, `/stop`, `/pause`); DEXBot is the only writer, private keys never reach the module. Config via a `TELEGRAM` block + `DEXBOT_TELEGRAM_TOKEN` env.
91
+ **Planned**: backtesting engine (historical candle replay via exchange abstraction); injectable interfaces at call boundaries; SQLite persistence + Zod validation at the blockchain boundary; Telegram bot (**not yet implemented**) — owner-gated monitoring (`/status`, `/orders`, `/grid`, `/balance`) and opt-in+confirm gated control (`/start`, `/stop`, `/pause`); DEXBot is the only writer, private keys never reach the module (`TELEGRAM` block + `DEXBOT_TELEGRAM_TOKEN` env).
120
92
 
121
93
  ## Version History
122
94
 
@@ -133,11 +105,13 @@ Compact, era-level view; per-release commit detail lives in [CHANGELOG.md](../CH
133
105
  | v1.4.13 → v1.4.19 | 36 | Profile-state centralization, code consolidation, per-broadcast op cap |
134
106
  | v1.4.19 → v1.4.20 | 5 | Grid boundary promotion hardening, recovery poison gate, analysis output centralization |
135
107
  | v1.4.20 → v1.4.21 | 15 | Runtime audit fixes, claw dedup hardening, boundary ceiling alignment, editor color feedback |
108
+ | v1.4.21 → v1.4.22 | 4 | tsx removal completion (dist-only runtime + tests), exact AMA bootstrap sizing, research-tool production parity |
109
+ | v1.4.22 → v1.4.23 | 12 | Even geometric AMA ladder, BTS fee-carve fix, sub-1x price-bound rejection, tradingview axis restore, doc realignment |
136
110
 
137
111
  ---
138
112
 
139
113
  **Report Originally Generated**: February 19, 2026
140
- **Last Updated**: August 24, 2026 (v1.4.21)
141
- **Total Commits**: 2,068
142
- **Date Range**: December 2, 2025 – August 24, 2026
114
+ **Last Updated**: August 28, 2026
115
+ **Total Commits**: 2,097
116
+ **Date Range**: December 2, 2025 – August 28, 2026
143
117
  **Repository**: DEXBot2 (BitShares DEX Trading Bot)
@@ -792,4 +792,4 @@ To prevent "Time-of-Check to Time-of-Use" errors:
792
792
  **TOCTOU protection in `processFillAccounting`.** `_buildBtsDeferredRefundAdjustment` reads `btsFeeState` from `mgr.orders` while the order lock is held — the lock is acquired before accounting runs, and the POST-RESET and BOOTSTRAP tracked-fill accounting paths follow the same locking pattern.
793
793
 
794
794
  ---
795
- *Technical Reference for DEXBot2 v1.4.21 release*
795
+ *Technical Reference for DEXBot2 v1.4.23 release*
@@ -194,7 +194,7 @@ The pool is fetched directly by ID, bypassing pool discovery. Useful when the tr
194
194
  - Built-in presets use `fastPeriod=5.2` (fitted)
195
195
  - `slowPeriod`: Smoothing constant for choppy/sideways markets
196
196
  - Higher = more lag, filters noise
197
- - Built-in presets range `slowPeriod=62.1` (AMA1) to `slowPeriod=95.5` (AMA4)
197
+ - Built-in presets range from `AMA1` (fastest) to `AMA4` (slowest) — see `MARKET_ADAPTER.AMAS` in `modules/constants.ts` for the exact `slowPeriod` values
198
198
  - `erSmoothPeriod`: Optional DEXBot2 extension that smooths Kaufman's raw Efficiency Ratio before the AMA smoothing constant is calculated
199
199
  - `0`: Disabled, raw Kaufman ER is used directly
200
200
  - `1`: Effectively no extra smoothing
package/docs/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  This directory contains the comprehensive technical documentation for the DEXBot2 trading bot. It is designed to guide developers from high-level architecture down to the nuances of fund accounting and state management.
4
4
 
5
- **Version context:** v1.4.21 (released).
5
+ **Version context:** v1.4.23 (released).
6
6
 
7
7
  ---
8
8
 
@@ -109,7 +109,7 @@ This directory contains the comprehensive technical documentation for the DEXBot
109
109
  - **Market Adapter Signal Pipeline**: AMA center, dynamic weights, regime detection, and collateral advisories
110
110
  - **Credit/Debt Runtime**: Native MPA and credit offer workflows with CR planning and grid reset coupling; `creditOnly` mode for runtime-only operation without grid trading
111
111
 
112
- ### 🔁 [Lifecycle](LIFECYCLE.md)
112
+ ### 🧬 [Lifecycle](LIFECYCLE.md)
113
113
  *The end-to-end walkthrough (start here for the big picture).*
114
114
  - **System Context**: What DEXBot2 talks to (chain, market data, storage, operator).
115
115
  - **Startup / Bootstrap**: Decrypt keys → load metadata → rebuild master grid → sync → runtime loops.
@@ -144,7 +144,7 @@ This directory contains the comprehensive technical documentation for the DEXBot
144
144
 
145
145
  ### 🧭 [Evolution Report](EVOLUTION.md)
146
146
  *Project timeline and major architecture phases.*
147
- - **Coverage**: Historical milestones from the initial December 2025 bootstrap through the v1.4.21 stable release (grid persistence safety, dust pipeline fix, net inventory lots); credit/debt runtime and maintenance hardening are covered under Phase 5 (Mar–Jun 2026)
147
+ - **Coverage**: Historical milestones from the initial December 2025 bootstrap through the v1.4.23 stable release (grid persistence safety, dust pipeline fix, net inventory lots); credit/debt runtime and maintenance hardening are covered under Phase 5 (Mar–Jun 2026)
148
148
  - **Focus**: Architecture evolution, release history, test growth, and documentation changes
149
149
 
150
150
  ### 🗒️ [Changelog](../CHANGELOG.md)
@@ -1239,15 +1239,15 @@ graph LR
1239
1239
  npm test
1240
1240
 
1241
1241
  # Specific logic area
1242
- tsx tests/test_accounting_logic.ts
1242
+ node dist/tests/test_accounting_logic.js
1243
1243
 
1244
1244
  # Signal tests
1245
- tsx tests/test_market_adapter_signal_gates.ts
1246
- tsx tests/test_dynamic_weight_override_wiring.ts
1245
+ node dist/tests/test_market_adapter_signal_gates.js
1246
+ node dist/tests/test_dynamic_weight_override_wiring.js
1247
1247
 
1248
1248
  # Credit/debt tests
1249
- tsx tests/test_cr_planner.ts
1250
- tsx tests/test_dexbot_credit_wiring.ts
1249
+ node dist/tests/test_cr_planner.js
1250
+ node dist/tests/test_dexbot_credit_wiring.js
1251
1251
  ```
1252
1252
 
1253
1253
  ### Test Quality Metrics
@@ -1627,10 +1627,10 @@ The test suite validates the following fund-related behaviors:
1627
1627
  npm test
1628
1628
 
1629
1629
  # Specific logic area
1630
- tsx tests/test_accounting_logic.ts
1630
+ node dist/tests/test_accounting_logic.js
1631
1631
 
1632
1632
  # Specific integration test
1633
- tsx tests/test_fills.ts
1633
+ node dist/tests/test_fills.js
1634
1634
  ```
1635
1635
 
1636
1636
  ### Understanding Test Structure
@@ -1797,13 +1797,13 @@ The test suite provides comprehensive coverage of fund calculations and rebalanc
1797
1797
  **Running Tests**:
1798
1798
  ```bash
1799
1799
  # Test strategy rebalancing
1800
- tsx tests/test_strategy_logic.ts
1800
+ node dist/tests/test_strategy_logic.js
1801
1801
 
1802
1802
  # Test grid divergence
1803
- tsx tests/test_grid_logic.ts
1803
+ node dist/tests/test_grid_logic.js
1804
1804
 
1805
1805
  # Test accounting precision
1806
- tsx tests/test_accounting_logic.ts
1806
+ node dist/tests/test_accounting_logic.js
1807
1807
 
1808
1808
  # Run full suite
1809
1809
  npm test
@@ -1858,7 +1858,7 @@ A: Check if it's locked (`isOrderLocked()`), in exclusion list, or below dust th
1858
1858
  A: Follow the "How to Add New Features" section above.
1859
1859
 
1860
1860
  **Q: Where are the tests?**
1861
- A: All tests are in the `tests/` directory. Run `npm test` for the full suite, or `tsx tests/<file>.ts` for individual test files.
1861
+ A: All tests are in the `tests/` directory. Run `npm test` for the full suite, or `npm run build:tests && node dist/tests/<file>.js` for individual test files.
1862
1862
 
1863
1863
  ---
1864
1864
 
@@ -936,19 +936,24 @@ the built-in presets is:
936
936
  |--------|---------|------|
937
937
  | `AMA1` | `1,602` | `66.8` |
938
938
  | `AMA2` | `1,677` | `69.9` |
939
- | `AMA3` | `1,758` | `73.3` |
940
- | `AMA4` | `1,839` | `76.6` |
939
+ | `AMA3` | `1,764` | `73.5` |
940
+ | `AMA4` | `1,844` | `76.8` |
941
941
 
942
942
  These totals include the ER buffer, the convergence window, and the default
943
943
  9-bar lookback used by the dynamic-weight logic. If the candle timeframe is
944
944
  not 1 hour, scale the total by the candle duration.
945
945
 
946
- **Why `slowPeriod` dominates:** `slowSC ≈ 2 / slowPeriod`, so `SC_avg` scales
947
- as `~ (2 / slowPeriod)² = 4 / slowPeriod²`. Since `convergenceBars` is
948
- proportional to `1 / SC_avg`, the required candle count scales as
949
- **O(slowPeriod²)**, not O(slowPeriod). For the AMA3 default (`slowPeriod = 82.7`)
950
- this is roughly 1130 convergence bars; doubling `slowPeriod` would quadruple
951
- that requirement.
946
+ **How `slowPeriod` affects the warm-up:** the estimate blends the smoothing
947
+ constant at a typical ER: `SC_avg = (ER_avg · fastSC + (1 − ER_avg) · slowSC)²`
948
+ with `slowSC ≈ 2 / slowPeriod` (see `getAmaWarmupBars` in
949
+ `market_adapter/core/strategies/ama.ts`). Since `convergenceBars` is
950
+ proportional to `1 / SC_avg`, a larger `slowPeriod` extends the warm-up, but
951
+ the `ER_avg · fastSC` term bounds `SC_avg` from below, so at the calibrated
952
+ average ER the growth is sub-quadratic: doubling `slowPeriod` (84 → 168)
953
+ raises the requirement only ~1.4×. The **O(slowPeriod²)** scaling (doubling
954
+ quadruples it) applies only in the pure-choppy limit (ER → 0), where
955
+ `SC = slowSC²`. For the `AMA3` default (see `MARKET_ADAPTER.AMAS` in
956
+ `modules/constants.ts`) the blended estimate is ~974 convergence bars.
952
957
 
953
958
  If the adapter has fewer candles than the warmup window, the AMA output is too
954
959
  biased for grid centering and the cycle skips with reason
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dexbot",
3
- "version": "1.4.21",
3
+ "version": "1.4.23",
4
4
  "description": "The first open source trading bot with zero runtime dependencies and a fully adaptive market making strategy.",
5
5
  "main": "dist/modules/dexbot_class.js",
6
6
  "exports": {
@@ -89,25 +89,27 @@
89
89
  "ama:chart:lp-local": "npm run build && node dist/analysis/ama_fitting/generate_unified_comparison_chart.js",
90
90
  "analysis:derivatives": "npm run build && node dist/analysis/analyze_derivatives.js",
91
91
  "analysis:trade-pnl": "npm run build && node dist/analysis/trade_profitability.js",
92
- "native:release-gates": "npm run build && node dist/scripts/native_release_gates.js",
93
- "native:serial-snapshots": "tsx tests/test_native_serial_ops.ts",
94
- "native:ecc-invariants": "tsx tests/test_native_ecc.ts",
92
+ "native:release-gates": "npm run build && npm run build:tests && node dist/scripts/native_release_gates.js",
93
+ "native:serial-snapshots": "npm run build && npm run build:tests && node dist/tests/test_native_serial_ops.js",
94
+ "native:ecc-invariants": "npm run build && npm run build:tests && node dist/tests/test_native_ecc.js",
95
95
  "native:corpus": "npm run build && node dist/scripts/generate_mainnet_corpus_report.js",
96
96
  "test:credit-renewal": "npm run build && node dist/scripts/test-credit-renewal.js",
97
97
  "version:sync": "npm run build && node dist/scripts/sync-version.js",
98
98
  "version:check": "npm run build && node dist/scripts/sync-version.js --check",
99
99
  "verify:browser-bundle": "npm run build && node dist/scripts/verify-browser-bundle.js",
100
- "pretest": "tsc --noEmit",
101
- "test": "node --import tsx scripts/run-tests.ts",
102
- "test:live": "RUN_LIVE_BITSHARES_TESTS=1 node --import tsx scripts/run-tests.ts",
100
+ "test": "npm run build && npm run build:tests && npm run build --prefix claw && node dist/scripts/run-tests.js",
101
+ "test:live": "RUN_LIVE_BITSHARES_TESTS=1 npm run build && npm run build:tests && npm run build --prefix claw && node dist/scripts/run-tests.js",
103
102
  "clean": "node scripts/clean-dist.js",
104
- "build": "npm run clean && tsc && chmod +x dist/dexbot.js dist/bot.js dist/unlock.js dist/pm2.js dist/credential-daemon.js",
103
+ "build": "tsc && chmod +x dist/dexbot.js dist/bot.js dist/unlock.js dist/pm2.js dist/credential-daemon.js",
104
+ "build:clean": "npm run clean && npm run build",
105
+ "build:tests": "tsc -p tsconfig.tests.json && cp tests/package.json dist/tests/package.json && cp tests/helpers/esm_mock_hooks.mjs tests/helpers/esm_mock_loader.mjs dist/tests/helpers/",
105
106
  "typecheck": "tsc --noEmit",
107
+ "typecheck:tests": "tsc -p tsconfig.tests.json --noEmit",
106
108
  "build:watch": "tsc --watch",
107
- "version": "npm run version:sync && npm run build",
108
- "postversion": "npm run build",
109
- "prepack": "npm run build",
110
- "prepare": "npm run build",
109
+ "version": "npm run version:sync && npm run build:clean",
110
+ "postversion": "npm run build:clean",
111
+ "prepack": "npm run build:clean",
112
+ "prepare": "npm run build:clean",
111
113
  "postinstall": "node scripts/postinstall.js"
112
114
  },
113
115
  "repository": {
@@ -168,7 +170,14 @@
168
170
  "./dist/modules/order/utils/system.js": false,
169
171
  "./dist/market_adapter/market_adapter.js": false,
170
172
  "./dist/market_adapter/lp_chart_runner.js": false,
171
- "./dist/market_adapter/ama_signal_runner.js": false
173
+ "./dist/market_adapter/ama_signal_runner.js": false,
174
+ "./dist/modules/runtime_settings.js": false,
175
+ "./dist/modules/bitshares-native/transport.js": false,
176
+ "./dist/modules/bitshares-native/signing_client.js": false,
177
+ "./dist/modules/bitshares-native/subscriptions.js": false,
178
+ "./dist/modules/bitshares-native/tx/builder.js": false,
179
+ "./dist/modules/bitshares-native/tx/tx_cache.js": false,
180
+ "./dist/market_adapter/utils/chain.js": false
172
181
  },
173
182
  "bugs": {
174
183
  "url": "https://github.com/froooze/DEXBot2/issues"
@@ -177,7 +186,6 @@
177
186
  "dependencies": {},
178
187
  "devDependencies": {
179
188
  "@types/node": "^25.9.1",
180
- "tsx": "^4.22.3",
181
189
  "typescript": "^6.0.3"
182
190
  }
183
191
  }
package/scripts/README.md CHANGED
@@ -7,7 +7,7 @@ This guide provides a terminal-focused reference for the maintenance and diagnos
7
7
  ## 🛠️ CORE MAINTENANCE
8
8
 
9
9
  ### Update DEXBot2
10
- **File:** `update.ts`
10
+ **File:** `update.ts` (shim: `update.js`)
11
11
  **Purpose:** Perform a safe, production-ready update.
12
12
  ```bash
13
13
  # Pull latest code, install deps, and restart PM2
@@ -174,6 +174,18 @@ LIVE_BOT_NAME=my-bot CALC_CYCLES=10 CALC_DELAY_MS=1000 node dist/scripts/runner.
174
174
  Useful for verifying config produces the expected grid, testing price derivation, and debugging fund allocation.
175
175
  Requires a live BitShares connection (asset metadata lookups and price derivation are on-chain).
176
176
 
177
+ ### Native Release Gates
178
+ **File:** `native_release_gates.ts` (+ `generate_mainnet_corpus_report.ts`)
179
+ **Purpose:** Prove the native serialization layer matches the chain byte-for-byte before release.
180
+ ```bash
181
+ # Generate the mainnet corpus report (needs a live node + 50+ blocks)
182
+ npm run native:corpus
183
+
184
+ # Run serializer snapshots + ECC invariants and assert the corpus report
185
+ npm run native:release-gates
186
+ ```
187
+ The corpus report lands in `<profiles>/native_validation/mainnet_corpus_report.json`. The gates fail unless the report has `passed=true` and `transactionCount>=50`.
188
+
177
189
  ---
178
190
 
179
191
  ## 🔍 GIT & DEVELOPMENT WORKFLOW
@@ -209,7 +221,10 @@ Inside file viewer: `f` full file, `d` diff view, `q` back to search, `b` main m
209
221
  ## 💻 DEVELOPMENT UTILITIES
210
222
 
211
223
  ### Test Suite Setup
212
- Tests run with native Node `assert` — no test framework needed. See [tests/README.md](../tests/README.md) for details.
224
+ Tests use native Node `assert` — no test framework needed. Sources compile to
225
+ `dist/tests/` via `npm run build:tests`, and `npm test` runs them sequentially
226
+ through `dist/scripts/run-tests.js` (with a per-test watchdog and diagnostics
227
+ summary). See [tests/README.md](../tests/README.md) for details.
213
228
 
214
229
  ### Repository Statistics Analyzer
215
230
  **File:** `analyze-git.ts`
@@ -298,8 +313,8 @@ The following scripts allow you to call `dexbot` commands directly from the `scr
298
313
  | `scripts/bots` | `dexbot bots` | `./scripts/bots` |
299
314
  | `scripts/keys` | `dexbot keys` | `./scripts/keys` |
300
315
  | `scripts/dexbot` | `dexbot` | `./scripts/dexbot <cmd>` |
301
- | `scripts/unlock` | `unlock.ts` / `dist/unlock.js` | `./scripts/unlock` |
302
- | `scripts/pm2` | `pm2.ts` / `dist/pm2.js` | `./scripts/pm2` |
316
+ | `scripts/unlock` | `dist/unlock.js` | `./scripts/unlock` |
317
+ | `scripts/pm2` | `dist/pm2.js` | `./scripts/pm2` |
303
318
 
304
319
  ---
305
320
 
@@ -308,12 +323,15 @@ The following scripts allow you to call `dexbot` commands directly from the `scr
308
323
  ### Build & Test
309
324
  | Command | Purpose |
310
325
  |:---|:---|
311
- | `npm run build` | Clean + compile TypeScript |
326
+ | `npm run build` | Compile TypeScript to `dist/` (plain node — no tsx) |
327
+ | `npm run build:clean` | Remove stale `dist/` + tsbuildinfo caches, then build |
328
+ | `npm run build:tests` | Compile `tests/` to `dist/tests/` (required by `npm test` and `native:*`) |
312
329
  | `npm run clean` | Remove compiled `dist/` output |
313
330
  | `npm run typecheck` | TypeScript type checking (`tsc --noEmit`) |
331
+ | `npm run typecheck:tests` | Type check the test suite (`tsc -p tsconfig.tests.json --noEmit`) |
314
332
  | `npm run build:watch` | TypeScript incremental build watcher |
315
- | `npm test` | Run full test suite (excludes live-chain tests) |
316
- | `npm run test:live` | Run full test suite including live-chain tests |
333
+ | `npm test` | Build + compile tests + run full suite (excludes live-chain tests) |
334
+ | `npm run test:live` | Build + compile tests + run full suite including live-chain tests |
317
335
 
318
336
  ### Runtime
319
337
  | Command | Purpose |
@@ -351,6 +369,14 @@ The following scripts allow you to call `dexbot` commands directly from the `scr
351
369
  | `npm run test:credit-renewal` | Test credit offer renewal for a specific bot |
352
370
  | `npm run verify:browser-bundle` | Verify browser-safe surface bundles correctly |
353
371
 
372
+ ### Native Release Gates
373
+ | Command | Purpose |
374
+ |:---|:---|
375
+ | `npm run native:corpus` | Build mainnet corpus report proving byte-for-byte native serialization parity |
376
+ | `npm run native:serial-snapshots` | Run native serializer snapshot tests |
377
+ | `npm run native:ecc-invariants` | Run native ECC key/sign/verify invariant tests |
378
+ | `npm run native:release-gates` | Run serial + ECC gates and assert a valid mainnet corpus report |
379
+
354
380
  ---
355
381
 
356
382
  ## 📈 CHART GENERATION
@@ -4,6 +4,14 @@ import { dirname, join } from 'path';
4
4
  import { fileURLToPath } from 'url';
5
5
 
6
6
  const __dirname = dirname(fileURLToPath(import.meta.url));
7
- const distDir = join(__dirname, '..', 'dist');
7
+ const rootDir = join(__dirname, '..');
8
+ const distDir = join(rootDir, 'dist');
9
+ const tscCacheDir = join(rootDir, 'node_modules', '.cache');
8
10
 
9
- rmSync(distDir, { recursive: true, force: true });
11
+ rmSync(distDir, { recursive: true, force: true });
12
+
13
+ // Incremental tsbuildinfo files live outside dist/, so a stale cache would
14
+ // make the next `tsc` believe everything is up to date and emit nothing.
15
+ for (const info of ['tsc-prod.tsbuildinfo', 'tsc-tests.tsbuildinfo', 'tsc-claw.tsbuildinfo']) {
16
+ rmSync(join(tscCacheDir, info), { force: true });
17
+ }