dexbot 1.6.7 → 1.6.9

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 (626) hide show
  1. package/CHANGELOG.md +73 -1
  2. package/README.md +3 -3
  3. package/analysis/README.md +2 -3
  4. package/analysis/tradingview/README.md +78 -1
  5. package/analysis/trend_detection/DYNAMIC_WEIGHT_RESEARCH.md +1 -1
  6. package/claw/package.json +1 -1
  7. package/claw/runtimes/openclaw-plugin/openclaw.plugin.json +1 -1
  8. package/claw/runtimes/openclaw-plugin/package.json +1 -1
  9. package/dist/analysis/tradingview/analyze_tradingview.d.ts +4 -0
  10. package/dist/analysis/tradingview/analyze_tradingview.js +55 -0
  11. package/dist/analysis/tradingview/grid_reset_config.d.ts +61 -0
  12. package/dist/analysis/tradingview/grid_reset_config.js +235 -0
  13. package/dist/analysis/tradingview/grid_reset_sim.d.ts +67 -0
  14. package/dist/analysis/tradingview/grid_reset_sim.js +307 -0
  15. package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js +419 -3
  16. package/dist/dexbot.js +55 -16
  17. package/dist/market_adapter/core/market_adapter_service.d.ts +81 -1
  18. package/dist/market_adapter/core/market_adapter_service.js +239 -20
  19. package/dist/market_adapter/core/signals/hurst_analyzer.d.ts +10 -1
  20. package/dist/market_adapter/core/signals/hurst_analyzer.js +40 -18
  21. package/dist/market_adapter/core/signals/permutation_entropy_analyzer.d.ts +26 -2
  22. package/dist/market_adapter/core/signals/permutation_entropy_analyzer.js +132 -29
  23. package/dist/market_adapter/core/strategies/dynamic_weight_series.d.ts +8 -1
  24. package/dist/market_adapter/core/strategies/dynamic_weight_series.js +5 -1
  25. package/dist/market_adapter/core/strategies/regime_gate.d.ts +61 -3
  26. package/dist/market_adapter/core/strategies/regime_gate.js +207 -7
  27. package/dist/market_adapter/inputs/window_cache.d.ts +97 -19
  28. package/dist/market_adapter/inputs/window_cache.js +302 -48
  29. package/dist/market_adapter/interval_utils.d.ts +18 -1
  30. package/dist/market_adapter/interval_utils.js +31 -1
  31. package/dist/market_adapter/market_adapter.d.ts +158 -2
  32. package/dist/market_adapter/market_adapter.js +399 -65
  33. package/dist/market_adapter/test_helpers.d.ts +2 -2
  34. package/dist/market_adapter/test_helpers.js +2 -2
  35. package/dist/market_adapter/utils/file_json_cache.d.ts +29 -0
  36. package/dist/market_adapter/utils/file_json_cache.js +106 -0
  37. package/dist/modules/account_bots.js +10 -0
  38. package/dist/modules/account_orders.d.ts +24 -2
  39. package/dist/modules/account_orders.js +41 -4
  40. package/dist/modules/bot_settings.js +10 -1
  41. package/dist/modules/config.d.ts +7 -0
  42. package/dist/modules/config.js +2 -0
  43. package/dist/modules/constants.d.ts +16 -4
  44. package/dist/modules/constants.js +144 -38
  45. package/dist/modules/dexbot_class.d.ts +6 -76
  46. package/dist/modules/dexbot_class.js +0 -32
  47. package/dist/modules/dexbot_cow_runtime.d.ts +3 -58
  48. package/dist/modules/dexbot_cow_runtime.js +4 -87
  49. package/dist/modules/dexbot_maintenance_runtime.d.ts +15 -1
  50. package/dist/modules/dexbot_maintenance_runtime.js +59 -11
  51. package/dist/modules/dexbot_startup_runtime.js +73 -20
  52. package/dist/modules/dexbot_state_recovery.d.ts +6 -0
  53. package/dist/modules/dexbot_state_recovery.js +21 -0
  54. package/dist/modules/order/async_lock.d.ts +8 -0
  55. package/dist/modules/order/async_lock.js +15 -0
  56. package/dist/modules/order/genesis_policy.d.ts +162 -0
  57. package/dist/modules/order/genesis_policy.js +267 -0
  58. package/dist/modules/order/grid.js +172 -160
  59. package/dist/modules/order/grid_reconcile.d.ts +9 -0
  60. package/dist/modules/order/grid_reconcile.js +13 -4
  61. package/dist/modules/order/grid_reconcile_internal.js +2 -2
  62. package/dist/modules/order/manager.d.ts +4 -0
  63. package/dist/modules/order/manager.js +14 -1
  64. package/dist/modules/order/sync_engine.d.ts +19 -0
  65. package/dist/modules/order/sync_engine.js +284 -344
  66. package/dist/modules/order/utils/math.d.ts +22 -1
  67. package/dist/modules/order/utils/math.js +64 -1
  68. package/dist/modules/order/utils/order.d.ts +43 -58
  69. package/dist/modules/order/utils/order.js +220 -197
  70. package/dist/modules/order/utils/system.js +8 -1
  71. package/dist/modules/paths.d.ts +1 -0
  72. package/dist/modules/paths.js +1 -0
  73. package/dist/modules/version_notice.d.ts +311 -0
  74. package/dist/modules/version_notice.js +709 -0
  75. package/dist/pm2.js +16 -0
  76. package/dist/unlock.js +28 -0
  77. package/docs/BITSHARES_ONBOARDING.md +8 -1
  78. package/docs/COW_INVARIANTS.md +3 -2
  79. package/docs/DEXBOT_COMPARISON.md +4 -4
  80. package/docs/EVOLUTION.md +22 -20
  81. package/docs/FUND_MOVEMENT_AND_ACCOUNTING.md +1 -1
  82. package/docs/GRID_PRICE_INVARIANT.md +149 -31
  83. package/docs/GRID_RECALCULATION.md +18 -2
  84. package/docs/README.md +3 -1
  85. package/docs/WORKFLOW.md +16 -5
  86. package/market_adapter/README.md +29 -1
  87. package/modules/README.md +18 -1
  88. package/package.json +13 -5
  89. package/scripts/README.md +28 -2
  90. package/scripts/clear-all.sh +13 -4
  91. package/scripts/clear-logs.sh +13 -4
  92. package/scripts/clear-market-adapter.sh +6 -0
  93. package/scripts/clear-orders.sh +5 -0
  94. package/scripts/lib/dexbot-paths.sh +108 -0
  95. package/tests/README.md +11 -3
  96. package/analysis/account_resolver.ts +0 -161
  97. package/analysis/ama_fitting/analyze_ama_price_changes.ts +0 -155
  98. package/analysis/ama_fitting/analyze_lambda_vs_slow.ts +0 -404
  99. package/analysis/ama_fitting/calibrate_convergence_er.ts +0 -201
  100. package/analysis/ama_fitting/fetch_lp_candles.ts +0 -184
  101. package/analysis/ama_fitting/generate_unified_comparison_chart.ts +0 -232
  102. package/analysis/ama_fitting/optimizer_high_resolution.ts +0 -802
  103. package/analysis/analyze_dynamic_weight.ts +0 -243
  104. package/analysis/analyze_kalman.ts +0 -157
  105. package/analysis/analyze_regime.ts +0 -158
  106. package/analysis/analyze_regime_windows.ts +0 -470
  107. package/analysis/analyze_risk_profile.ts +0 -199
  108. package/analysis/analyze_trade_heatmap.ts +0 -362
  109. package/analysis/analyze_volatility.ts +0 -182
  110. package/analysis/bot_fitting/backtest_ama_sweep.ts +0 -934
  111. package/analysis/bot_fitting/backtest_bot_fitting.ts +0 -861
  112. package/analysis/bot_fitting/shared_utils.ts +0 -52
  113. package/analysis/bot_key_utils.ts +0 -426
  114. package/analysis/bot_usage/discover_bot_accounts.ts +0 -635
  115. package/analysis/bot_usage/kibana_bot_queries.ts +0 -211
  116. package/analysis/chain_pool.ts +0 -47
  117. package/analysis/chart_css.ts +0 -62
  118. package/analysis/chart_ui.ts +0 -105
  119. package/analysis/chart_utils.ts +0 -210
  120. package/analysis/fills_source.ts +0 -228
  121. package/analysis/grid_correction_check.ts +0 -786
  122. package/analysis/math_utils.ts +0 -53
  123. package/analysis/price_sources.ts +0 -136
  124. package/analysis/resolve_bot_accounts.ts +0 -199
  125. package/analysis/resolve_source.ts +0 -99
  126. package/analysis/results/ama_sweep_results_lp_pool_133_1h.json +0 -2455
  127. package/analysis/results/bot_fitting_results_lp_pool_133_1h.json +0 -218
  128. package/analysis/trade_profitability.ts +0 -1335
  129. package/analysis/tradingview/analyze_tradingview.ts +0 -280
  130. package/analysis/tradingview/h-bts_tradingview.html +0 -1570
  131. package/analysis/tradingview/t-bts_tradingview.html +0 -1570
  132. package/analysis/tradingview/tradingview_uplot_chart_generator.ts +0 -3268
  133. package/analysis/trend_detection/dynamic_weight_chart_generator.ts +0 -1481
  134. package/analysis/trend_detection/hurst_analyzer.ts +0 -7
  135. package/analysis/trend_detection/kalman_chart_generator.ts +0 -398
  136. package/analysis/trend_detection/kalman_trend_analyzer.ts +0 -9
  137. package/analysis/trend_detection/kalman_velocity_smoothing.ts +0 -7
  138. package/analysis/trend_detection/package.json +0 -23
  139. package/analysis/trend_detection/permutation_entropy_analyzer.ts +0 -7
  140. package/analysis/trend_detection/regime_chart_generator.ts +0 -338
  141. package/analysis/trend_detection/tests/test_kalman_trend.ts +0 -153
  142. package/analysis/trend_detection/tests/test_kalman_velocity_smoothing.ts +0 -64
  143. package/analysis/trend_detection/volatility_chart_generator.ts +0 -654
  144. package/analysis/tsconfig.json +0 -29
  145. package/claw/tests/package.json +0 -3
  146. package/claw/tests/test_claw_bridge.ts +0 -570
  147. package/claw/tests/test_claw_catalog_and_credentials.ts +0 -156
  148. package/claw/tests/test_claw_chain_layer.ts +0 -739
  149. package/claw/tests/test_claw_data_flow.ts +0 -525
  150. package/claw/tests/test_claw_domain_logic.ts +0 -471
  151. package/claw/tests/test_claw_manifest_and_matrix.ts +0 -222
  152. package/claw/tests/test_claw_mcp_transport.ts +0 -243
  153. package/claw/tests/test_claw_regressions.ts +0 -711
  154. package/claw/tests/test_claw_skill_generation.ts +0 -103
  155. package/claw/tests/test_claw_state_store.ts +0 -44
  156. package/claw/tests/test_dexbot_profiles.ts +0 -654
  157. package/claw/tests/test_memu_bridge.ts +0 -189
  158. package/claw/tests/test_nullclaw_tmp_integration.ts +0 -57
  159. package/claw/tests/test_position_health.ts +0 -343
  160. package/claw/tests/test_position_manager.ts +0 -429
  161. package/claw/tests/test_position_manager_watch_health.ts +0 -100
  162. package/claw/tests/test_short_mpa_strategy.ts +0 -232
  163. package/dist/analysis/account_resolver.d.ts.map +0 -1
  164. package/dist/analysis/account_resolver.js.map +0 -1
  165. package/dist/analysis/ama_fitting/analyze_ama_price_changes.d.ts.map +0 -1
  166. package/dist/analysis/ama_fitting/analyze_ama_price_changes.js.map +0 -1
  167. package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.d.ts.map +0 -1
  168. package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.js.map +0 -1
  169. package/dist/analysis/ama_fitting/calibrate_convergence_er.d.ts.map +0 -1
  170. package/dist/analysis/ama_fitting/calibrate_convergence_er.js.map +0 -1
  171. package/dist/analysis/ama_fitting/fetch_lp_candles.d.ts.map +0 -1
  172. package/dist/analysis/ama_fitting/fetch_lp_candles.js.map +0 -1
  173. package/dist/analysis/ama_fitting/generate_unified_comparison_chart.d.ts.map +0 -1
  174. package/dist/analysis/ama_fitting/generate_unified_comparison_chart.js.map +0 -1
  175. package/dist/analysis/ama_fitting/optimizer_high_resolution.d.ts.map +0 -1
  176. package/dist/analysis/ama_fitting/optimizer_high_resolution.js.map +0 -1
  177. package/dist/analysis/analyze_dynamic_weight.d.ts.map +0 -1
  178. package/dist/analysis/analyze_dynamic_weight.js.map +0 -1
  179. package/dist/analysis/analyze_kalman.d.ts.map +0 -1
  180. package/dist/analysis/analyze_kalman.js.map +0 -1
  181. package/dist/analysis/analyze_regime.d.ts.map +0 -1
  182. package/dist/analysis/analyze_regime.js.map +0 -1
  183. package/dist/analysis/analyze_regime_windows.d.ts.map +0 -1
  184. package/dist/analysis/analyze_regime_windows.js.map +0 -1
  185. package/dist/analysis/analyze_risk_profile.d.ts.map +0 -1
  186. package/dist/analysis/analyze_risk_profile.js.map +0 -1
  187. package/dist/analysis/analyze_trade_heatmap.d.ts.map +0 -1
  188. package/dist/analysis/analyze_trade_heatmap.js.map +0 -1
  189. package/dist/analysis/analyze_volatility.d.ts.map +0 -1
  190. package/dist/analysis/analyze_volatility.js.map +0 -1
  191. package/dist/analysis/bot_fitting/backtest_ama_sweep.d.ts.map +0 -1
  192. package/dist/analysis/bot_fitting/backtest_ama_sweep.js.map +0 -1
  193. package/dist/analysis/bot_fitting/backtest_bot_fitting.d.ts.map +0 -1
  194. package/dist/analysis/bot_fitting/backtest_bot_fitting.js.map +0 -1
  195. package/dist/analysis/bot_fitting/shared_utils.d.ts.map +0 -1
  196. package/dist/analysis/bot_fitting/shared_utils.js.map +0 -1
  197. package/dist/analysis/bot_key_utils.d.ts.map +0 -1
  198. package/dist/analysis/bot_key_utils.js.map +0 -1
  199. package/dist/analysis/bot_usage/discover_bot_accounts.d.ts.map +0 -1
  200. package/dist/analysis/bot_usage/discover_bot_accounts.js.map +0 -1
  201. package/dist/analysis/bot_usage/kibana_bot_queries.d.ts.map +0 -1
  202. package/dist/analysis/bot_usage/kibana_bot_queries.js.map +0 -1
  203. package/dist/analysis/chain_pool.d.ts.map +0 -1
  204. package/dist/analysis/chain_pool.js.map +0 -1
  205. package/dist/analysis/chart_css.d.ts.map +0 -1
  206. package/dist/analysis/chart_css.js.map +0 -1
  207. package/dist/analysis/chart_ui.d.ts.map +0 -1
  208. package/dist/analysis/chart_ui.js.map +0 -1
  209. package/dist/analysis/chart_utils.d.ts.map +0 -1
  210. package/dist/analysis/chart_utils.js.map +0 -1
  211. package/dist/analysis/fills_source.d.ts.map +0 -1
  212. package/dist/analysis/fills_source.js.map +0 -1
  213. package/dist/analysis/grid_correction_check.d.ts.map +0 -1
  214. package/dist/analysis/grid_correction_check.js.map +0 -1
  215. package/dist/analysis/math_utils.d.ts.map +0 -1
  216. package/dist/analysis/math_utils.js.map +0 -1
  217. package/dist/analysis/price_sources.d.ts.map +0 -1
  218. package/dist/analysis/price_sources.js.map +0 -1
  219. package/dist/analysis/resolve_bot_accounts.d.ts.map +0 -1
  220. package/dist/analysis/resolve_bot_accounts.js.map +0 -1
  221. package/dist/analysis/resolve_source.d.ts.map +0 -1
  222. package/dist/analysis/resolve_source.js.map +0 -1
  223. package/dist/analysis/trade_profitability.d.ts.map +0 -1
  224. package/dist/analysis/trade_profitability.js.map +0 -1
  225. package/dist/analysis/tradingview/analyze_tradingview.d.ts.map +0 -1
  226. package/dist/analysis/tradingview/analyze_tradingview.js.map +0 -1
  227. package/dist/analysis/tradingview/tradingview_uplot_chart_generator.d.ts.map +0 -1
  228. package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js.map +0 -1
  229. package/dist/analysis/trend_detection/dynamic_weight_chart_generator.d.ts.map +0 -1
  230. package/dist/analysis/trend_detection/dynamic_weight_chart_generator.js.map +0 -1
  231. package/dist/analysis/trend_detection/hurst_analyzer.d.ts.map +0 -1
  232. package/dist/analysis/trend_detection/hurst_analyzer.js.map +0 -1
  233. package/dist/analysis/trend_detection/kalman_chart_generator.d.ts.map +0 -1
  234. package/dist/analysis/trend_detection/kalman_chart_generator.js.map +0 -1
  235. package/dist/analysis/trend_detection/kalman_trend_analyzer.d.ts.map +0 -1
  236. package/dist/analysis/trend_detection/kalman_trend_analyzer.js.map +0 -1
  237. package/dist/analysis/trend_detection/kalman_velocity_smoothing.d.ts.map +0 -1
  238. package/dist/analysis/trend_detection/kalman_velocity_smoothing.js.map +0 -1
  239. package/dist/analysis/trend_detection/permutation_entropy_analyzer.d.ts.map +0 -1
  240. package/dist/analysis/trend_detection/permutation_entropy_analyzer.js.map +0 -1
  241. package/dist/analysis/trend_detection/regime_chart_generator.d.ts.map +0 -1
  242. package/dist/analysis/trend_detection/regime_chart_generator.js.map +0 -1
  243. package/dist/analysis/trend_detection/tests/test_kalman_trend.d.ts +0 -2
  244. package/dist/analysis/trend_detection/tests/test_kalman_trend.d.ts.map +0 -1
  245. package/dist/analysis/trend_detection/tests/test_kalman_trend.js +0 -128
  246. package/dist/analysis/trend_detection/tests/test_kalman_trend.js.map +0 -1
  247. package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.d.ts +0 -2
  248. package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.d.ts.map +0 -1
  249. package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.js +0 -37
  250. package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.js.map +0 -1
  251. package/dist/analysis/trend_detection/volatility_chart_generator.d.ts.map +0 -1
  252. package/dist/analysis/trend_detection/volatility_chart_generator.js.map +0 -1
  253. package/dist/bot.d.ts.map +0 -1
  254. package/dist/bot.js.map +0 -1
  255. package/dist/credential-daemon.d.ts.map +0 -1
  256. package/dist/credential-daemon.js.map +0 -1
  257. package/dist/dexbot.d.ts.map +0 -1
  258. package/dist/dexbot.js.map +0 -1
  259. package/dist/market_adapter/ama_signal_runner.d.ts.map +0 -1
  260. package/dist/market_adapter/ama_signal_runner.js.map +0 -1
  261. package/dist/market_adapter/candle_utils.d.ts.map +0 -1
  262. package/dist/market_adapter/candle_utils.js.map +0 -1
  263. package/dist/market_adapter/core/asymmetric_bounds.d.ts.map +0 -1
  264. package/dist/market_adapter/core/asymmetric_bounds.js.map +0 -1
  265. package/dist/market_adapter/core/config_normalizers.d.ts.map +0 -1
  266. package/dist/market_adapter/core/config_normalizers.js.map +0 -1
  267. package/dist/market_adapter/core/kibana_candles.d.ts.map +0 -1
  268. package/dist/market_adapter/core/kibana_candles.js.map +0 -1
  269. package/dist/market_adapter/core/kibana_client.d.ts.map +0 -1
  270. package/dist/market_adapter/core/kibana_client.js.map +0 -1
  271. package/dist/market_adapter/core/kibana_market_candles.d.ts.map +0 -1
  272. package/dist/market_adapter/core/kibana_market_candles.js.map +0 -1
  273. package/dist/market_adapter/core/market_adapter_service.d.ts.map +0 -1
  274. package/dist/market_adapter/core/market_adapter_service.js.map +0 -1
  275. package/dist/market_adapter/core/signals/hurst_analyzer.d.ts.map +0 -1
  276. package/dist/market_adapter/core/signals/hurst_analyzer.js.map +0 -1
  277. package/dist/market_adapter/core/signals/kalman_trend_analyzer.d.ts.map +0 -1
  278. package/dist/market_adapter/core/signals/kalman_trend_analyzer.js.map +0 -1
  279. package/dist/market_adapter/core/signals/kalman_velocity_smoothing.d.ts.map +0 -1
  280. package/dist/market_adapter/core/signals/kalman_velocity_smoothing.js.map +0 -1
  281. package/dist/market_adapter/core/signals/permutation_entropy_analyzer.d.ts.map +0 -1
  282. package/dist/market_adapter/core/signals/permutation_entropy_analyzer.js.map +0 -1
  283. package/dist/market_adapter/core/strategies/ama.d.ts.map +0 -1
  284. package/dist/market_adapter/core/strategies/ama.js.map +0 -1
  285. package/dist/market_adapter/core/strategies/ama_slope_model.d.ts.map +0 -1
  286. package/dist/market_adapter/core/strategies/ama_slope_model.js.map +0 -1
  287. package/dist/market_adapter/core/strategies/atr/calculator.d.ts.map +0 -1
  288. package/dist/market_adapter/core/strategies/atr/calculator.js.map +0 -1
  289. package/dist/market_adapter/core/strategies/collateral_manager.d.ts.map +0 -1
  290. package/dist/market_adapter/core/strategies/collateral_manager.js.map +0 -1
  291. package/dist/market_adapter/core/strategies/dynamic_weight_series.d.ts.map +0 -1
  292. package/dist/market_adapter/core/strategies/dynamic_weight_series.js.map +0 -1
  293. package/dist/market_adapter/core/strategies/regime_gate.d.ts.map +0 -1
  294. package/dist/market_adapter/core/strategies/regime_gate.js.map +0 -1
  295. package/dist/market_adapter/core/strategies/regime_interp.d.ts.map +0 -1
  296. package/dist/market_adapter/core/strategies/regime_interp.js.map +0 -1
  297. package/dist/market_adapter/core/strategies/volatility_shift.d.ts.map +0 -1
  298. package/dist/market_adapter/core/strategies/volatility_shift.js.map +0 -1
  299. package/dist/market_adapter/inputs/fetch_book_data.d.ts.map +0 -1
  300. package/dist/market_adapter/inputs/fetch_book_data.js.map +0 -1
  301. package/dist/market_adapter/inputs/fetch_cex_synthetic_data.d.ts.map +0 -1
  302. package/dist/market_adapter/inputs/fetch_cex_synthetic_data.js.map +0 -1
  303. package/dist/market_adapter/inputs/fetch_lp_data.d.ts.map +0 -1
  304. package/dist/market_adapter/inputs/fetch_lp_data.js.map +0 -1
  305. package/dist/market_adapter/inputs/kibana_feed_source.d.ts.map +0 -1
  306. package/dist/market_adapter/inputs/kibana_feed_source.js.map +0 -1
  307. package/dist/market_adapter/inputs/kibana_source.d.ts.map +0 -1
  308. package/dist/market_adapter/inputs/kibana_source.js.map +0 -1
  309. package/dist/market_adapter/inputs/window_cache.d.ts.map +0 -1
  310. package/dist/market_adapter/inputs/window_cache.js.map +0 -1
  311. package/dist/market_adapter/interval_utils.d.ts.map +0 -1
  312. package/dist/market_adapter/interval_utils.js.map +0 -1
  313. package/dist/market_adapter/log_format.d.ts.map +0 -1
  314. package/dist/market_adapter/log_format.js.map +0 -1
  315. package/dist/market_adapter/lp_chart_core.d.ts.map +0 -1
  316. package/dist/market_adapter/lp_chart_core.js.map +0 -1
  317. package/dist/market_adapter/lp_chart_runner.d.ts.map +0 -1
  318. package/dist/market_adapter/lp_chart_runner.js.map +0 -1
  319. package/dist/market_adapter/lp_chart_strategy_loader.d.ts.map +0 -1
  320. package/dist/market_adapter/lp_chart_strategy_loader.js.map +0 -1
  321. package/dist/market_adapter/market_adapter.d.ts.map +0 -1
  322. package/dist/market_adapter/market_adapter.js.map +0 -1
  323. package/dist/market_adapter/test_helpers.d.ts.map +0 -1
  324. package/dist/market_adapter/test_helpers.js.map +0 -1
  325. package/dist/market_adapter/utils/adapter_client.d.ts.map +0 -1
  326. package/dist/market_adapter/utils/adapter_client.js.map +0 -1
  327. package/dist/market_adapter/utils/atomic_write.d.ts.map +0 -1
  328. package/dist/market_adapter/utils/atomic_write.js.map +0 -1
  329. package/dist/market_adapter/utils/chain.d.ts.map +0 -1
  330. package/dist/market_adapter/utils/chain.js.map +0 -1
  331. package/dist/market_adapter/utils/data_discovery.d.ts.map +0 -1
  332. package/dist/market_adapter/utils/data_discovery.js.map +0 -1
  333. package/dist/market_adapter/utils/dynamic_grid_snapshot.d.ts.map +0 -1
  334. package/dist/market_adapter/utils/dynamic_grid_snapshot.js.map +0 -1
  335. package/dist/market_adapter/utils/file_lock.d.ts.map +0 -1
  336. package/dist/market_adapter/utils/file_lock.js.map +0 -1
  337. package/dist/market_adapter/utils/native_history.d.ts.map +0 -1
  338. package/dist/market_adapter/utils/native_history.js.map +0 -1
  339. package/dist/modules/account_bots.d.ts.map +0 -1
  340. package/dist/modules/account_bots.js.map +0 -1
  341. package/dist/modules/account_orders.d.ts.map +0 -1
  342. package/dist/modules/account_orders.js.map +0 -1
  343. package/dist/modules/authority_resolver.d.ts.map +0 -1
  344. package/dist/modules/authority_resolver.js.map +0 -1
  345. package/dist/modules/bitshares-native/chain_client.d.ts.map +0 -1
  346. package/dist/modules/bitshares-native/chain_client.js.map +0 -1
  347. package/dist/modules/bitshares-native/crypto/ecc.browser.d.ts.map +0 -1
  348. package/dist/modules/bitshares-native/crypto/ecc.browser.js.map +0 -1
  349. package/dist/modules/bitshares-native/crypto/ecc.d.ts.map +0 -1
  350. package/dist/modules/bitshares-native/crypto/ecc.js.map +0 -1
  351. package/dist/modules/bitshares-native/crypto/ecc_selector.d.ts.map +0 -1
  352. package/dist/modules/bitshares-native/crypto/ecc_selector.js.map +0 -1
  353. package/dist/modules/bitshares-native/index.d.ts.map +0 -1
  354. package/dist/modules/bitshares-native/index.js.map +0 -1
  355. package/dist/modules/bitshares-native/lru_cache.d.ts.map +0 -1
  356. package/dist/modules/bitshares-native/lru_cache.js.map +0 -1
  357. package/dist/modules/bitshares-native/resolvers.d.ts.map +0 -1
  358. package/dist/modules/bitshares-native/resolvers.js.map +0 -1
  359. package/dist/modules/bitshares-native/serial/chain_constants.d.ts.map +0 -1
  360. package/dist/modules/bitshares-native/serial/chain_constants.js.map +0 -1
  361. package/dist/modules/bitshares-native/serial/index.d.ts.map +0 -1
  362. package/dist/modules/bitshares-native/serial/index.js.map +0 -1
  363. package/dist/modules/bitshares-native/serial/operations.d.ts.map +0 -1
  364. package/dist/modules/bitshares-native/serial/operations.js.map +0 -1
  365. package/dist/modules/bitshares-native/serial/serializer.d.ts.map +0 -1
  366. package/dist/modules/bitshares-native/serial/serializer.js.map +0 -1
  367. package/dist/modules/bitshares-native/serial/types.d.ts.map +0 -1
  368. package/dist/modules/bitshares-native/serial/types.js.map +0 -1
  369. package/dist/modules/bitshares-native/signing_client.d.ts.map +0 -1
  370. package/dist/modules/bitshares-native/signing_client.js.map +0 -1
  371. package/dist/modules/bitshares-native/subscriptions.d.ts.map +0 -1
  372. package/dist/modules/bitshares-native/subscriptions.js.map +0 -1
  373. package/dist/modules/bitshares-native/transport.d.ts.map +0 -1
  374. package/dist/modules/bitshares-native/transport.js.map +0 -1
  375. package/dist/modules/bitshares-native/tx/builder.d.ts.map +0 -1
  376. package/dist/modules/bitshares-native/tx/builder.js.map +0 -1
  377. package/dist/modules/bitshares-native/tx/tx_cache.d.ts.map +0 -1
  378. package/dist/modules/bitshares-native/tx/tx_cache.js.map +0 -1
  379. package/dist/modules/bitshares_client.d.ts.map +0 -1
  380. package/dist/modules/bitshares_client.js.map +0 -1
  381. package/dist/modules/bot_defaults.d.ts.map +0 -1
  382. package/dist/modules/bot_defaults.js.map +0 -1
  383. package/dist/modules/bot_settings.d.ts.map +0 -1
  384. package/dist/modules/bot_settings.js.map +0 -1
  385. package/dist/modules/bots_file_lock.d.ts.map +0 -1
  386. package/dist/modules/bots_file_lock.js.map +0 -1
  387. package/dist/modules/broadcast_failure.d.ts.map +0 -1
  388. package/dist/modules/broadcast_failure.js.map +0 -1
  389. package/dist/modules/chain_keys.d.ts.map +0 -1
  390. package/dist/modules/chain_keys.js.map +0 -1
  391. package/dist/modules/chain_orders.d.ts.map +0 -1
  392. package/dist/modules/chain_orders.js.map +0 -1
  393. package/dist/modules/cli_colors.d.ts.map +0 -1
  394. package/dist/modules/cli_colors.js.map +0 -1
  395. package/dist/modules/cli_start_onboarding.d.ts.map +0 -1
  396. package/dist/modules/cli_start_onboarding.js.map +0 -1
  397. package/dist/modules/cli_start_output.d.ts.map +0 -1
  398. package/dist/modules/cli_start_output.js.map +0 -1
  399. package/dist/modules/config.d.ts.map +0 -1
  400. package/dist/modules/config.js.map +0 -1
  401. package/dist/modules/constants.d.ts.map +0 -1
  402. package/dist/modules/constants.js.map +0 -1
  403. package/dist/modules/cr_planner.d.ts.map +0 -1
  404. package/dist/modules/cr_planner.js.map +0 -1
  405. package/dist/modules/credential_policy.d.ts.map +0 -1
  406. package/dist/modules/credential_policy.js.map +0 -1
  407. package/dist/modules/credential_runtime.d.ts.map +0 -1
  408. package/dist/modules/credential_runtime.js.map +0 -1
  409. package/dist/modules/credential_session_cache.d.ts.map +0 -1
  410. package/dist/modules/credential_session_cache.js.map +0 -1
  411. package/dist/modules/credit_pricing.d.ts.map +0 -1
  412. package/dist/modules/credit_pricing.js.map +0 -1
  413. package/dist/modules/credit_runtime.d.ts.map +0 -1
  414. package/dist/modules/credit_runtime.js.map +0 -1
  415. package/dist/modules/crypto/browser_provider.d.ts.map +0 -1
  416. package/dist/modules/crypto/browser_provider.js.map +0 -1
  417. package/dist/modules/crypto/index.d.ts.map +0 -1
  418. package/dist/modules/crypto/index.js.map +0 -1
  419. package/dist/modules/crypto/node_provider.d.ts.map +0 -1
  420. package/dist/modules/crypto/node_provider.js.map +0 -1
  421. package/dist/modules/crypto/provider.d.ts.map +0 -1
  422. package/dist/modules/crypto/provider.js.map +0 -1
  423. package/dist/modules/crypto/pure_ripemd160.d.ts.map +0 -1
  424. package/dist/modules/crypto/pure_ripemd160.js.map +0 -1
  425. package/dist/modules/crypto/pure_scrypt.d.ts.map +0 -1
  426. package/dist/modules/crypto/pure_scrypt.js.map +0 -1
  427. package/dist/modules/crypto/pure_secp256k1.d.ts.map +0 -1
  428. package/dist/modules/crypto/pure_secp256k1.js.map +0 -1
  429. package/dist/modules/crypto/sync.d.ts.map +0 -1
  430. package/dist/modules/crypto/sync.js.map +0 -1
  431. package/dist/modules/daemon_node_health.d.ts.map +0 -1
  432. package/dist/modules/daemon_node_health.js.map +0 -1
  433. package/dist/modules/dexbot_class.d.ts.map +0 -1
  434. package/dist/modules/dexbot_class.js.map +0 -1
  435. package/dist/modules/dexbot_cow_runtime.d.ts.map +0 -1
  436. package/dist/modules/dexbot_cow_runtime.js.map +0 -1
  437. package/dist/modules/dexbot_credential_client.d.ts.map +0 -1
  438. package/dist/modules/dexbot_credential_client.js.map +0 -1
  439. package/dist/modules/dexbot_fill_runtime.d.ts.map +0 -1
  440. package/dist/modules/dexbot_fill_runtime.js.map +0 -1
  441. package/dist/modules/dexbot_maintenance_runtime.d.ts.map +0 -1
  442. package/dist/modules/dexbot_maintenance_runtime.js.map +0 -1
  443. package/dist/modules/dexbot_startup_runtime.d.ts.map +0 -1
  444. package/dist/modules/dexbot_startup_runtime.js.map +0 -1
  445. package/dist/modules/dexbot_state_recovery.d.ts.map +0 -1
  446. package/dist/modules/dexbot_state_recovery.js.map +0 -1
  447. package/dist/modules/env.d.ts.map +0 -1
  448. package/dist/modules/env.js.map +0 -1
  449. package/dist/modules/fund_registry.d.ts.map +0 -1
  450. package/dist/modules/fund_registry.js.map +0 -1
  451. package/dist/modules/general_settings.d.ts.map +0 -1
  452. package/dist/modules/general_settings.js.map +0 -1
  453. package/dist/modules/graceful_shutdown.d.ts.map +0 -1
  454. package/dist/modules/graceful_shutdown.js.map +0 -1
  455. package/dist/modules/grid_price_source.d.ts.map +0 -1
  456. package/dist/modules/grid_price_source.js.map +0 -1
  457. package/dist/modules/key_store.d.ts.map +0 -1
  458. package/dist/modules/key_store.js.map +0 -1
  459. package/dist/modules/launcher/adapter_requirement.d.ts.map +0 -1
  460. package/dist/modules/launcher/adapter_requirement.js.map +0 -1
  461. package/dist/modules/launcher/bot_supervisor.d.ts.map +0 -1
  462. package/dist/modules/launcher/bot_supervisor.js.map +0 -1
  463. package/dist/modules/launcher/child_env.d.ts.map +0 -1
  464. package/dist/modules/launcher/child_env.js.map +0 -1
  465. package/dist/modules/launcher/credential_bootstrap.d.ts.map +0 -1
  466. package/dist/modules/launcher/credential_bootstrap.js.map +0 -1
  467. package/dist/modules/launcher/credential_daemon.d.ts.map +0 -1
  468. package/dist/modules/launcher/credential_daemon.js.map +0 -1
  469. package/dist/modules/launcher/credential_secret.d.ts.map +0 -1
  470. package/dist/modules/launcher/credential_secret.js.map +0 -1
  471. package/dist/modules/launcher/foreign_cred_daemon.d.ts.map +0 -1
  472. package/dist/modules/launcher/foreign_cred_daemon.js.map +0 -1
  473. package/dist/modules/launcher/headless_password.d.ts.map +0 -1
  474. package/dist/modules/launcher/headless_password.js.map +0 -1
  475. package/dist/modules/launcher/launch_modes.d.ts.map +0 -1
  476. package/dist/modules/launcher/launch_modes.js.map +0 -1
  477. package/dist/modules/launcher/market_adapter_runtime.d.ts.map +0 -1
  478. package/dist/modules/launcher/market_adapter_runtime.js.map +0 -1
  479. package/dist/modules/launcher/market_adapter_watchdog.d.ts.map +0 -1
  480. package/dist/modules/launcher/market_adapter_watchdog.js.map +0 -1
  481. package/dist/modules/launcher/monolithic_runtime.d.ts.map +0 -1
  482. package/dist/modules/launcher/monolithic_runtime.js.map +0 -1
  483. package/dist/modules/launcher/runtime_entry.d.ts.map +0 -1
  484. package/dist/modules/launcher/runtime_entry.js.map +0 -1
  485. package/dist/modules/launcher/status_reporting.d.ts.map +0 -1
  486. package/dist/modules/launcher/status_reporting.js.map +0 -1
  487. package/dist/modules/launcher/supervisor_control.d.ts.map +0 -1
  488. package/dist/modules/launcher/supervisor_control.js.map +0 -1
  489. package/dist/modules/market_adapter_whitelist.d.ts.map +0 -1
  490. package/dist/modules/market_adapter_whitelist.js.map +0 -1
  491. package/dist/modules/node_connect_policy.d.ts.map +0 -1
  492. package/dist/modules/node_connect_policy.js.map +0 -1
  493. package/dist/modules/node_failure_ledger.d.ts.map +0 -1
  494. package/dist/modules/node_failure_ledger.js.map +0 -1
  495. package/dist/modules/node_health_cache.d.ts.map +0 -1
  496. package/dist/modules/node_health_cache.js.map +0 -1
  497. package/dist/modules/node_manager.d.ts.map +0 -1
  498. package/dist/modules/node_manager.js.map +0 -1
  499. package/dist/modules/order/accounting.d.ts.map +0 -1
  500. package/dist/modules/order/accounting.js.map +0 -1
  501. package/dist/modules/order/async_lock.d.ts.map +0 -1
  502. package/dist/modules/order/async_lock.js.map +0 -1
  503. package/dist/modules/order/export.d.ts.map +0 -1
  504. package/dist/modules/order/export.js.map +0 -1
  505. package/dist/modules/order/format.d.ts.map +0 -1
  506. package/dist/modules/order/format.js.map +0 -1
  507. package/dist/modules/order/grid.d.ts.map +0 -1
  508. package/dist/modules/order/grid.js.map +0 -1
  509. package/dist/modules/order/grid_reconcile.d.ts.map +0 -1
  510. package/dist/modules/order/grid_reconcile.js.map +0 -1
  511. package/dist/modules/order/grid_reconcile_internal.d.ts.map +0 -1
  512. package/dist/modules/order/grid_reconcile_internal.js.map +0 -1
  513. package/dist/modules/order/index.d.ts.map +0 -1
  514. package/dist/modules/order/index.js.map +0 -1
  515. package/dist/modules/order/logger.d.ts.map +0 -1
  516. package/dist/modules/order/logger.js.map +0 -1
  517. package/dist/modules/order/logger_state.d.ts.map +0 -1
  518. package/dist/modules/order/logger_state.js.map +0 -1
  519. package/dist/modules/order/manager.d.ts.map +0 -1
  520. package/dist/modules/order/manager.js.map +0 -1
  521. package/dist/modules/order/processed_fill_store.d.ts.map +0 -1
  522. package/dist/modules/order/processed_fill_store.js.map +0 -1
  523. package/dist/modules/order/strategy.d.ts.map +0 -1
  524. package/dist/modules/order/strategy.js.map +0 -1
  525. package/dist/modules/order/sync_engine.d.ts.map +0 -1
  526. package/dist/modules/order/sync_engine.js.map +0 -1
  527. package/dist/modules/order/utils/math.d.ts.map +0 -1
  528. package/dist/modules/order/utils/math.js.map +0 -1
  529. package/dist/modules/order/utils/order.d.ts.map +0 -1
  530. package/dist/modules/order/utils/order.js.map +0 -1
  531. package/dist/modules/order/utils/slot.d.ts.map +0 -1
  532. package/dist/modules/order/utils/slot.js.map +0 -1
  533. package/dist/modules/order/utils/system.d.ts.map +0 -1
  534. package/dist/modules/order/utils/system.js.map +0 -1
  535. package/dist/modules/order/utils/timeout.d.ts.map +0 -1
  536. package/dist/modules/order/utils/timeout.js.map +0 -1
  537. package/dist/modules/order/utils/validate.d.ts.map +0 -1
  538. package/dist/modules/order/utils/validate.js.map +0 -1
  539. package/dist/modules/order/utils/withPoolRef.d.ts.map +0 -1
  540. package/dist/modules/order/utils/withPoolRef.js.map +0 -1
  541. package/dist/modules/order/working_grid.d.ts.map +0 -1
  542. package/dist/modules/order/working_grid.js.map +0 -1
  543. package/dist/modules/path_api.d.ts.map +0 -1
  544. package/dist/modules/path_api.js.map +0 -1
  545. package/dist/modules/paths.d.ts.map +0 -1
  546. package/dist/modules/paths.js.map +0 -1
  547. package/dist/modules/process_discovery.d.ts.map +0 -1
  548. package/dist/modules/process_discovery.js.map +0 -1
  549. package/dist/modules/runtime.d.ts.map +0 -1
  550. package/dist/modules/runtime.js.map +0 -1
  551. package/dist/modules/runtime_settings.d.ts.map +0 -1
  552. package/dist/modules/runtime_settings.js.map +0 -1
  553. package/dist/modules/settings_merge.d.ts.map +0 -1
  554. package/dist/modules/settings_merge.js.map +0 -1
  555. package/dist/modules/socket_json_client.d.ts.map +0 -1
  556. package/dist/modules/socket_json_client.js.map +0 -1
  557. package/dist/modules/storage/browser_adapter.d.ts.map +0 -1
  558. package/dist/modules/storage/browser_adapter.js.map +0 -1
  559. package/dist/modules/storage/index.d.ts.map +0 -1
  560. package/dist/modules/storage/index.js.map +0 -1
  561. package/dist/modules/storage/node_adapter.d.ts.map +0 -1
  562. package/dist/modules/storage/node_adapter.js.map +0 -1
  563. package/dist/modules/storage/types.d.ts.map +0 -1
  564. package/dist/modules/storage/types.js.map +0 -1
  565. package/dist/modules/types.d.ts.map +0 -1
  566. package/dist/modules/types.js.map +0 -1
  567. package/dist/modules/utils/base58check.d.ts.map +0 -1
  568. package/dist/modules/utils/base58check.js.map +0 -1
  569. package/dist/modules/utils/build_dir.d.ts.map +0 -1
  570. package/dist/modules/utils/build_dir.js.map +0 -1
  571. package/dist/modules/utils/chain_logs.d.ts.map +0 -1
  572. package/dist/modules/utils/chain_logs.js.map +0 -1
  573. package/dist/modules/utils/errors.d.ts.map +0 -1
  574. package/dist/modules/utils/errors.js.map +0 -1
  575. package/dist/modules/utils/sanitize_key.d.ts.map +0 -1
  576. package/dist/modules/utils/sanitize_key.js.map +0 -1
  577. package/dist/modules/utils/text_width.d.ts.map +0 -1
  578. package/dist/modules/utils/text_width.js.map +0 -1
  579. package/dist/modules/validate_profiles.d.ts.map +0 -1
  580. package/dist/modules/validate_profiles.js.map +0 -1
  581. package/dist/pm2.d.ts.map +0 -1
  582. package/dist/pm2.js.map +0 -1
  583. package/dist/scripts/analyze-credit.d.ts.map +0 -1
  584. package/dist/scripts/analyze-credit.js.map +0 -1
  585. package/dist/scripts/analyze-git.d.ts.map +0 -1
  586. package/dist/scripts/analyze-git.js.map +0 -1
  587. package/dist/scripts/analyze-orders.d.ts.map +0 -1
  588. package/dist/scripts/analyze-orders.js.map +0 -1
  589. package/dist/scripts/chart_command.d.ts.map +0 -1
  590. package/dist/scripts/chart_command.js.map +0 -1
  591. package/dist/scripts/diagnose-kibana-candles.d.ts.map +0 -1
  592. package/dist/scripts/diagnose-kibana-candles.js.map +0 -1
  593. package/dist/scripts/diagnose-pool-history.d.ts.map +0 -1
  594. package/dist/scripts/diagnose-pool-history.js.map +0 -1
  595. package/dist/scripts/divergence-calc.d.ts.map +0 -1
  596. package/dist/scripts/divergence-calc.js.map +0 -1
  597. package/dist/scripts/dw.d.ts.map +0 -1
  598. package/dist/scripts/dw.js.map +0 -1
  599. package/dist/scripts/generate_lp_chart.d.ts.map +0 -1
  600. package/dist/scripts/generate_lp_chart.js.map +0 -1
  601. package/dist/scripts/generate_mainnet_corpus_report.d.ts.map +0 -1
  602. package/dist/scripts/generate_mainnet_corpus_report.js.map +0 -1
  603. package/dist/scripts/native_release_gates.d.ts.map +0 -1
  604. package/dist/scripts/native_release_gates.js.map +0 -1
  605. package/dist/scripts/print_grid.d.ts.map +0 -1
  606. package/dist/scripts/print_grid.js.map +0 -1
  607. package/dist/scripts/run-tests.d.ts.map +0 -1
  608. package/dist/scripts/run-tests.js.map +0 -1
  609. package/dist/scripts/runner.d.ts.map +0 -1
  610. package/dist/scripts/runner.js.map +0 -1
  611. package/dist/scripts/sync-version.d.ts.map +0 -1
  612. package/dist/scripts/sync-version.js.map +0 -1
  613. package/dist/scripts/test-credit-renewal.d.ts.map +0 -1
  614. package/dist/scripts/test-credit-renewal.js.map +0 -1
  615. package/dist/scripts/tv.d.ts.map +0 -1
  616. package/dist/scripts/tv.js.map +0 -1
  617. package/dist/scripts/update.d.ts.map +0 -1
  618. package/dist/scripts/update.js.map +0 -1
  619. package/dist/scripts/update_dist_freshness.d.ts.map +0 -1
  620. package/dist/scripts/update_dist_freshness.js.map +0 -1
  621. package/dist/scripts/validate_bots.d.ts.map +0 -1
  622. package/dist/scripts/validate_bots.js.map +0 -1
  623. package/dist/scripts/verify-browser-bundle.d.ts.map +0 -1
  624. package/dist/scripts/verify-browser-bundle.js.map +0 -1
  625. package/dist/unlock.d.ts.map +0 -1
  626. package/dist/unlock.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -2,16 +2,88 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
- ## [1.6.7] - 2026-09-26 - Native Session Recovery, Start Onboarding, Keys UX, Guard Pivot Persistence
5
+ ## [1.6.9] - 2026-09-30 - Market-Adapter Cycle CPU & Off-Hour Idle, Grid Spread-Tightening Correction
6
+
7
+ ### 2026-09-29
8
+
9
+ - **Perf(market-adapter)**: cut hourly cycle CPU via regime memo, incremental analyzers and a single AMA — the hourly cycle re-created both signal analyzers and replayed the whole candle history per bot per cycle (~99.8% identical numbers), re-ran `calculateAMA` four extra times per bot for an `AMA1..AMA4` preset sweep that only fed a log line, and re-parsed ~250 KiB of candle JSON per bot per cycle that the process had just serialized itself. Measured on the production shape (capped sliding window): regime gate ~3.7 ms cold → 0.05–0.24 ms resumed (median 0.088 ms), cycle CPU ~155 ms → ~103 ms. The cross-cycle regime memo is keyed by `<botKey>:<intervalSeconds>` and resumes only when the incoming window ADVANCES the cached one (k leading bars dropped, m appended) with a leading-drop tolerance for the capped sliding window (a strict prefix check missed every steady-state cycle); exactness rests on the analyzers being rolling — resume requires the shared region to cover `bufferBars` (read from the analyzer instances, fails closed), so any verified alignment is exact by construction, and ambiguous/related-window mismatches, parameter changes and history rewrites all fall back to a cold recompute. Permutation entropy now keeps an incremental count map with factorial-number-system integer pattern keys (`update()` allocates nothing, O(1) per bar); Hurst uses preallocated rolling buffers and `computeRS` takes a `[from, to)` range instead of slicing ~30 arrays per bar. `calcAmaComparison` becomes `buildAmaRecord`, so the cycle reports the ONE AMA the bot trades on (resolved preset name + the already-computed value) instead of a 4-preset sweep; the persisted `state.bots[key].amaComparison` field keeps its key but holds a single entry (was four) — its only repo reader, the cycle log formatter, tolerates both shapes, and the log label changes `AMA compare:` → `AMA active:`. Config: `market_adapter` no longer honours `ama.enabled`; `gridPrice` is the only switch that makes a bot AMA-driven (the resolver previously disagreed with itself depending on whether a market profile matched, so a bot with `ama.enabled: false` kept trading while its published center froze) — no shipped bot sets the flag, and `docs/GRID_RECALCULATION.md` documents the single-switch rule plus the profile/keyword/defaultAmaKey/bot-block precedence. A write-through candle-JSON read cache (`market_adapter/utils/file_json_cache.ts`) is mtime/size-validated, consumed on read, and fails closed to the loader whenever the file cannot be `stat`ed. Coverage: a new entropy-equivalence suite (bar-by-bar equivalence vs verbatim pre-optimization reference algorithms, incl. sliding-window, alignment and ambiguity cases, all shown non-vacuous by defect re-injection), a file-JSON-cache suite, and AMA layering/precedence tests. Risk: the `amaComparison` shape change from four entries to one is verified to have no other repo consumer. Validation: 302/302 tests, `tsc` src+tests clean, browser bundle 39 passed (`market_adapter/core/strategies/regime_gate.ts`, `market_adapter/core/signals/permutation_entropy_analyzer.ts`, `market_adapter/core/signals/hurst_analyzer.ts`, `market_adapter/market_adapter.ts`, `market_adapter/core/market_adapter_service.ts`, `market_adapter/utils/file_json_cache.ts`, `modules/constants.ts`, `docs/GRID_RECALCULATION.md`, `tests/test_market_adapter_entropy_equivalence.ts`, `tests/test_market_adapter_file_json_cache.ts`, `tests/test_market_adapter_logic.ts`, `tests/test_market_adapter_service.ts`).
10
+
11
+ - **Perf(market-adapter)**: skip off-hour work and sleep to the candle boundary — the adapter only has work once per closed candle, but a respawn ran a full cycle immediately and an extra cycle could re-fetch, re-parse and re-serialize the same ~250 KiB candle file for zero new information. A per-bot closed-candle gate now runs before the native overlap fetch, the Kibana stale-tail check and the re-serialize: when the persisted `lastClosedCandleTs` already equals the newest closed bucket and the candle file covers that bucket (source match, no unresolved gaps, AMA warmup target met), the cycle records `lastCycleSource=off-hour-skip` and returns. One-shot entry points (`--once`, `runOnceForAma` backing `ama_signal_runner`) are exempt so they always emit a computed AMA. Daemon startup now decides before connecting whether every active AMA bot is caught up, and if so sleeps to the same poll boundary the loop uses, otherwise runs a catch-up cycle; the verdict is per bot (never max-aggregated across bots), reports every veto reason with the offending bot keys, and treats a known warmup target with an unknown candle count as outstanding. Refactor with no behavior change: the candle-grid arithmetic is centralized as `bucketStartMs`/`latestClosedBucketStartMs` in `interval_utils.ts` (shared by `sleepUntilAlignedBoundary`, `selectClosedCandles` and the startup sleep), `isCandleSourceMismatch` is shared between the off-hour gate and the full-path cache reset, and `evaluateStateRepairVeto` is shared as the state-side mirror of `candleFileCoversClosedBucket`. The socket stays open only for a working cycle; between cycles the process holds just an unref'd lock heartbeat, and the startup wait is always shorter than one poll period so no candle is ever skipped. An off-hour-skip state record is a last-known snapshot: data fields keep the last full cycle's values, only `lastCycleSource`/`lastCycleAt`/`pendingClosedCandle`/`lastTriggerSuppressedReason` are refreshed. (`market_adapter/market_adapter.ts`, `market_adapter/core/market_adapter_service.ts`, `market_adapter/interval_utils.ts`, `market_adapter/test_helpers.ts`, `market_adapter/README.md`, `tests/test_market_adapter_service.ts`).
12
+
13
+ - **Fix(grid)**: make spread correction tighten the spread instead of walking to the rail edge — spread correction chose candidates via a two-branch comparator (`windowFirst` on a live rail, `edgeFirst` otherwise) written as exact opposites, so on a SELL rail with a live window the branch sorted descending and correction picked the grid ceiling (BUY mirrored it at the rail floor). Neither placement moves bestBuy/bestSell, so the measured spread was unchanged and the next resync cancelled the orders as surplus. Both branches are replaced with one market-nearest comparator, and a spread-tightening guard anchors the placement to the live book: a SELL candidate must sit below the lowest live sell and a BUY above the highest live buy, using the same on-chain order set `calculateCurrentSpread` measures from (an empty rail has no anchor and stays open). The guard is the fix — the orphan pool is rail-wide, so market-nearest alone still resolves to the first empty slot past the live window; with the guard that pool empties, the promotion gate opens and the gap band is asked. Gap-band promotion candidates are now placed ahead of the rail pools, and a promotion that yields nothing names its binding constraint (stranding cap, spread reserve, no contiguous run) instead of skipping silently. Coverage: `tests/test_spread_correction_market_nearest.ts` (6 cases; 5 fail against pre-fix code, 1 passes both ways by design) (`modules/order/grid.ts`, `tests/test_spread_correction_market_nearest.ts`).
14
+
15
+ - **Docs(agents)**: require an explicit user request before any version bump — an agent that treats "the work is done" as "ship a release" will bump `package.json`, retag and push on its own initiative, and worse will end every task by asking whether to bump; the ask is the failure mode, turning a finished change into a decision the operator has to make twice and training a reflex that fires whether or not a release is warranted. The rule is one line: never bump, never propose, never ask; the user alone decides. The existing three-step procedure stays, scoped to a turn where the bump was explicitly requested, and that request is also the authorization for the commits/tags it needs so a real release is not gated twice. Documentation only, no runtime change (`AGENTS.md`).
16
+
17
+ ### Version-notice hardening
18
+
19
+ The `fix(version-notice)` work committed after the 1.6.8 tag (real verdict from every entry point, staged `dexbot stat` status, npm-then-GitHub probe) is documented under [1.6.8]'s `2026-09-29` section above; no additional code change ships in 1.6.9.
20
+
21
+ ## [1.6.8] - 2026-09-28 - Correction-Drain Bounds, PM2 Log Capture, Version Notice, Genesis Refusal & Legacy Matcher Removal, TV Grid-Reset Replay & Packaging Trim
22
+
23
+ ### 2026-09-29
24
+
25
+ - **Fix(version-notice)**: one version check on every entry point, and never a silent one — the audit found the check was centralized but its *rendering* was not: `dexbot stat` fell back to a bare `DEXBot2 vX.Y.Z` header when the notice was switched off (`DEXBOT_SKIP_VERSION_NOTICE=1` / `UPDATER.NOTICE_ENABLED=false`) while `dexbot pm2` and `unlock` printed nothing at all, so on a node with the notice off the operator learned their build from one command and not the others; and `pm2.ts` exited 1 on a credential-daemon failure without awaiting the probe it had already started, discarding the answer it had paid for. The fallback is now the module's decision, not each entry point's: `printVersionStatusOrHeader` / `flushVersionStatusOrHeader` render the status line when there is one and the bare header when there is not, and `printVersionStatusWhenReady` (the non-awaited isolated-foreground path) uses the same contract, so `stat`, `pm2`, `start`, `restart`, `stop` and `reload` cannot disagree. `printVersionStatus(null)` stays a no-op for callers that only want the line. The `pm2` failure path now flushes before exiting. `maybePrintVersionStatus` (zero callers since `stat` went staged) is REMOVED rather than left as a second entry path, and the dead `intervalMs`-ignored option now actually drives the success window. Behavioral impact: with the notice disabled, `dexbot pm2`/`start`/`restart` now name the running build where they previously printed nothing; no wording, colour or network behaviour changes when the notice is on (`modules/version_notice.ts`, `dexbot.ts`, `pm2.ts`, `unlock.ts`, `tests/test_version_notice.ts`).
26
+
27
+ - **Feat(version-notice)**: stage the version verdict around the `dexbot stat` report, and say "no current version information" when the answer never arrives — a status command that shows a process table is the wrong place to block on the network, but printing the verdict inline under a short cap made a reachable registry read as "unknown", while deferring it unconditionally left a MISSING line that an operator can easily read as "you are up to date". `startStagedVersionStatus` now owns the escalation as two promises: a 1s grace (`UPDATER.NOTICE_STAGE_GRACE_MS`) at the top of the report, which a valid cache or a quick answer satisfies without the command ever noticing the wait; and a `settled` promise for the end, which gives the still-in-flight probe 1s more, then ASKS AGAIN with a forced, full-budget probe (`UPDATER.NOTICE_STATUS_TIMEOUT_MS`, 3s) — the first attempt may have failed fast or spent its share of the budget on a blocked source, and `force` matters because a cached FAILURE would otherwise be re-reported for the whole 15min backoff without a single request being made. When even that answers nothing, the verdict is the explicit `? No current version information (npm / github did not answer within 3000ms).` — a distinct `exhausted` state, not a failed check: the inline launcher path (`start`/`pm2`, which never escalates) keeps the more specific "could not check (reason)" wording, and neither path may ever render an unknown answer as green. The total wait is ~4s, all of it at the bottom of the report, and the report costs at most 1s up front. `case 'status'` funnels every branch through one `finish()` so no early `process.exit()` can truncate the line (`modules/version_notice.ts`, `dexbot.ts`, `modules/constants.ts`, `tests/test_version_notice.ts`).
28
+
29
+ - **Fix(version-notice)**: make the version probe answer instead of shrugging — a node that could not reach `registry.npmjs.org` reported `? Could not check for a newer version.` forever, and a single unreachable host, a too-tight timeout or a 5s network hiccup were indistinguishable from each other and from "you are current". Four defects, one symptom: (1) ONE source was a single point of failure, so the probe now queries npm's dist-tag document FIRST and falls back to the GitHub latest-release endpoint, derived from `UPDATER.REPOSITORY_URL` (`GITHUB_RELEASE_URL` pins it, `'off'` disables it, `GITHUB_API_BASE` retargets it at a mirror) — a host that cannot reach the registry now degrades to a slower probe instead of a permanent "unknown"; the total budget is split EVENLY across sources so a hanging first source cannot starve the fallback, and `compareVersions` strips a leading `v` so a `v1.6.8` GitHub tag does not parse as an ancient version and masquerade as an available update. The npm-first order is deliberate and was benchmarked, not assumed: latency is a wash (warm p50 npm 21ms / github 18ms, cold 92-102ms / 97-99ms), npm's document is 5x smaller (8KB vs 40KB), the GitHub API is 60 req/hour per IP unauthenticated (403 when spent) while npm has no comparable ceiling, and decisively, the release pipeline creates the GitHub release ~4-9 minutes BEFORE it publishes to npm (1.6.8 10:15:14Z vs 10:24:00Z) — GitHub-first would advertise a version `dexbot update` cannot yet install, which is a wrong hint rather than an early one. (2) EVERY failure path now records WHY (`ENOTFOUND`, `ECONNREFUSED`, `HTTP 403`, `timeout after Nms`, `no version in response`, `no fetch available`) and the gray verdict names it, persisted in the cache so even a throttled run can explain itself; an unnamed "?" is not actionable. (3) A FAILURE was throttled for the full 24h `NOTICE_INTERVAL_MS`, so one transient outage pinned the "?" for a day with no retry left to disprove it — a success is still cached (`UPDATER.NOTICE_INTERVAL_MS`, now 12h rather than 24h: the published version does not move, but `dexbot stat` is the command an operator runs to ask "am I current?" and a 24h window let that answer come from the previous morning), a failure now backs off for `UPDATER.NOTICE_RETRY_MS` (15min), and `DEXBOT_VERSION_CHECK_FORCE=1` bypasses the cache entirely as the diagnostic escape hatch. Every entry point consults the cache on every run; none of them re-probe on a timer of its own. (4) `dexbot stat` awaited the probe inline under a 750ms cap that a cold DNS + TLS handshake to the registry routinely exceeds; the probe is now STARTED at the top of the report and its verdict APPENDED at the end, so the process table is never delayed, the line can no longer be truncated by an early `process.exit()` (every branch in `case 'status'` now funnels through one `finish()` that flushes first), and the probe gets a real budget (`UPDATER.NOTICE_STATUS_TIMEOUT_MS` 6s) now that it is off the critical path. `UPDATER.NOTICE_TIMEOUT_MS` 2s → 4s for the same reason on the launcher path. `dexbot stat` then wraps the probe in the staged wait above. Behavioral impact: strictly more information and no new failure mode — the notice still never changes code, still never blocks a start beyond its bounded budget, and an unknown verdict is still never dressed up as "up to date". Risk: two requests instead of one when the first source fails (bounded by the same total budget), and a genuinely offline node now retries every 15min instead of once a day (`modules/version_notice.ts`, `dexbot.ts`, `modules/config.ts`, `modules/constants.ts`, `docs/README.md`, `tests/test_version_notice.ts`).
6
30
 
7
31
  ### 2026-09-26
8
32
 
9
33
  - **Fix(concurrency)**: bound the price-correction drain and keep timer lock-waiters out of long broadcast regions — `correctAllPriceMismatches` held `_gridLock` (no acquisition timeout) across every queued correction, running price updates sequentially with `SYNC_DELAY_MS` between each, so a large `ordersNeedingPriceCorrection` backlog could hold the lock for minutes while every concurrent actor died at the 20s fill-lock timeout. Cancel-class entries (duplicate orphans / surplus / type mismatch) are still fully drained — batched, zero-delay, fund-safety-critical — but the sequential update loop is now capped at `FILL_PROCESSING.CORRECTION_MAX_UPDATES_PER_CYCLE` (default 5); the unselected remainder stays queued durably and re-drains next cycle, keeping its queue position so newer entries cannot be starved. A rate-limited backlog alarm (`CORRECTION_QUEUE_WARN_THRESHOLD` default 10, `CORRECTION_QUEUE_WARN_RATE_LIMIT_MS` 5 min) fires even while the drain defers, which is exactly when the queue is growing. The drain also defers *before* acquiring `_gridLock` when `isBroadcastingActive()`, and the maintenance timer loops (open-orders sync, periodic blockchain fetch) get the same pre-acquire deferral via `shouldDeferMaintenanceForBroadcast`; that helper is age-bounded by `BROADCAST_STALE_CLEAR_MS` so a leaked broadcast flag still lets the periodic tick through to run `_clearStaleBroadcastFlag` (deferring on a stale flag would otherwise remove the only watchdog that clears it). `TIMING.FILL_BROADCAST_DEFER_MAX_MS` is now derived as `max(configured, BROADCAST_STALE_CLEAR_MS + 30s)` so a legitimately long startup reconcile Phase 2 cannot outlast the fill-consumer deferral and drop it into the in-lock wait, and the deferral bound re-arms whenever `manager._broadcastingStartedAt` advances (a live region) while a frozen flag still trips the fallback. Startup create-group execution yields to the event loop between groups (`setTimeout(0)`, browser-safe) so the region's timers/watchdogs (region-end reschedule, `_awaitBroadcastIdle`, stale-flag clear) are not starved. Behavioral impact: a correction backlog no longer monopolizes `_gridLock`; fills/corrections still drain, bounded per cycle; the broadcast-deferral bound now outlasts the stale-flag watchdog it depends on; a leaked broadcast flag still self-heals. Risk: only the sequential price-update loop is budgeted, so a very large update backlog drains over multiple cycles (`modules/order/utils/order.ts`, `modules/constants.ts`, `modules/dexbot_fill_runtime.ts`, `modules/dexbot_maintenance_runtime.ts`, `modules/order/grid_reconcile_internal.ts`, `modules/order/manager.ts`, `tests/test_correction_queue_staleness.ts`, `tests/test_fill_pipeline_robustness.ts`, `tests/test_lock_bypass_guards.ts`).
10
34
 
35
+ - **Refactor(concurrency)**: make the correction-drain bound time-based and harden the grid-lock/deferral invariants — `CORRECTION_MAX_UPDATES_PER_CYCLE` bounded a *count* while the invariant it protects is *lock-hold duration* (each update costs `SYNC_DELAY_MS` plus its RPC round-trip, which grows with chain congestion), so the default 5 could still hold `_gridLock` past the 20s fill-lock timeout on a slow chain. New `FILL_PROCESSING.CORRECTION_LOCK_HOLD_BUDGET_MS` (default 4000) is the primary bound: the sequential update loop stops pulling entries once the elapsed window closes, and `CORRECTION_MAX_UPDATES_PER_CYCLE` becomes an optional hard cap (default null = uncapped count; 0 = drain no updates). Cancel-class entries stay unbudgeted. `AsyncLock.heldForMs()` now exposes live hold duration and `checkGridLockHoldDuration` runs on every maintenance tick, emitting a rate-limited `[GRID-LOCK]` warn when `_gridLock` is held past `TIMING.GRID_LOCK_HOLD_WARN_MS` (default 15s) — observational only, because a mutating lock cannot be force-released safely. `BROADCAST_STALE_CLEAR_MS` is now the single authority for both deferral bounds: `FILL_BROADCAST_DEFER_MAX_MS` is derived as `staleClear + TIMING.BROADCAST_DEFER_SAFETY_MARGIN_MS` (named, default 30s) and a load-time check throws if the ordering invariant is ever violated (`modules/constants.ts`, `modules/order/utils/order.ts`, `modules/order/async_lock.ts`, `modules/dexbot_maintenance_runtime.ts`, `tests/test_correction_queue_staleness.ts`, `tests/test_async_lock_force_release.ts`, `tests/test_lock_bypass_guards.ts`).
36
+
11
37
  - **Fix(logging)**: restore PM2 log output — the `Logger` stacked two independent suppressions: it auto-quieted console output whenever PM2 log paths were present (`quietUnderPm2` defaulted true) **and** skipped its own file writes under PM2, so every line from a PM2-managed bot, the credential daemon, and the module loggers was dropped (the content in `profiles/logs/*.log` came from non-PM2 runs; PM2's own `out_file`s stayed empty). The constructor no longer auto-quiets: under PM2 stdout is the only sink and PM2's `log_date_format` supplies the timestamp, while non-PM2 runs with a `logFile` stay console-quiet to avoid duplicate output. `quietUnderPm2: true` remains as an explicit opt-in to the legacy silent behaviour, and new `isPm2LogCaptureActive()` centralizes the `pm_out_log_path`/`pm_err_log_path` predicate shared by the constructor and `_enqueueWrite` (`modules/order/logger.ts`, `tests/test_logger.ts`).
12
38
 
13
39
  - **Fix(pm2)**: enable real log rotation — PM2 core ignores the per-app `max_size` option, so PM2-owned log files were never rotated. The launcher now installs and configures `pm2-logrotate` (100M per file, retain 10, compressed) on first start; detection via `pm2 jlist` keeps it idempotent and the step is best-effort with timeouts so startup never blocks on a failed install. New `runPm2Raw()` covers the module-management verbs (`jlist`/`install`/`set`) that fall outside `execPM2Command`'s process-control whitelist (`pm2.ts`, `docs/LOGGING.md`).
14
40
 
41
+ - **Docs**: close the changelog gaps and realign stale references - an audit of the 1.6.5..1.6.6 range found three shipped housekeeping commits documented nowhere (their entries are now filed under [1.6.6], whose title also gained the sweep), and the same staleness pass found published docs describing the pre-1.6.7 guard and the removed key-manager abort path instead of the shipped behaviour: `docs/GRID_PRICE_INVARIANT.md` now carries the pivot snapshot contract (persist with the grid, restore with the boundary, provenance gate, validation chain, generation invalidation), `docs/CREDENTIAL_SECURITY.md` states the cancellation contract (Escape is not a wrong password; a complete account key is a usable account, not password metadata), and `docs/ORDER_ENGINE_POST_1.0_RETROSPECTIVE.md` repoints the boundary invariants and phase statuses at the suites that hold the coverage today. Documentation only, no runtime change (`CHANGELOG.md`, `docs/GRID_PRICE_INVARIANT.md`, `docs/CREDENTIAL_SECURITY.md`, `docs/ORDER_ENGINE_POST_1.0_RETROSPECTIVE.md`, `README.md`).
42
+
43
+ - **Feat(version-notice)**: announce newer DEXBot2 releases on start/pm2 — operators had no way to learn a newer release existed: `UPDATER.ACTIVE` defaults to false by design (a bot handling real funds must never silently change its own code) and the only version comparison lived in `dexbot update`. A passive, never-throwing notice now probes the npm registry once per `UPDATER.NOTICE_INTERVAL_MS` (24h) using a single bounded HTTPS GET (no `npm` subprocess), reports a newer `latest` on `dexbot start`/`pm2`/`status`, and never changes code. Gating is independent of the updater via `UPDATER.NOTICE_ENABLED` (default on); `DEXBOT_SKIP_VERSION_NOTICE=1` silences it for tests/CI. The cache lives in `profiles/version_check.json` (gitignored, atomic write) and records the last probe, the observed latest, and the announced version. `dexbot start`/`pm2` emit from the child launcher (parent/child relocation-notice convention); internal children stay silent (`modules/version_notice.ts`, `dexbot.ts`, `pm2.ts`, `unlock.ts`, `modules/constants.ts`, `modules/paths.ts`, `tests/test_version_notice.ts`).
44
+
45
+ - **Fix(version-notice)**: latch notify-once only after the notice is displayed — the "announced" version was persisted as soon as the probe resolved, so a launcher path that returned without printing (the already-running race window, a startup failure before the success summary) could permanently suppress a hint the operator never saw. The probe now records the observation only; the single `printVersionNotice` path advances the latch, and the latch only ever moves forward so a registry briefly serving an older `latest` (dist-tag rollback) cannot make an announced version reappear. `--dryrun` no longer probes or writes the cache, the missed `unlock.ts` terminal flush is added, and the isolated-foreground launch path prints the notice without awaiting it so the bot start is never delayed. `dexbot status` caps the inline probe at `UPDATER.NOTICE_STATUS_TIMEOUT_MS` (750ms) instead of the 2s default. Hardening: `path.join` for install-kind detection, strict cache field types, and an overridable probe timeout. The probe's timeout is now a race-based hard backstop that resolves even with no `AbortController` or a `fetch` that ignores the abort signal, so a hung registry socket can never stall a terminal `flushVersionNotice` ahead of `process.exit()`; the await+print flush is centralized in the module rather than reimplemented in `unlock.ts` (`modules/version_notice.ts`, `unlock.ts`, `pm2.ts`, `dexbot.ts`, `modules/constants.ts`, `tests/test_version_notice.ts`).
46
+
47
+ - **Feat(version-notice)**: report the installed-vs-published version in `dexbot stat` and on every start — the notice only spoke when a newer release existed, so an operator had no positive confirmation that the running build was current, and `dexbot stat` showed a bare `DEXBot2 vX.Y.Z` line with no verdict. The probe now returns a `VersionStatus` (`up-to-date` / `update-available` / `unknown`) instead of a notice-or-nothing, and ONE renderer (`formatVersionStatusLine`) paints it: green `✓ Your version is up to date.` when the install matches the registry, orange `⬆ A new version is available: vX.Y.Z.` when it does not, gray `? Could not check for a newer version.` when the probe could not answer — an unknown probe is never dressed up as "up to date", because that is exactly the state in which a real update hides. A throttled run (probe already done inside `NOTICE_INTERVAL_MS`) now reports the state from the cached observation instead of returning nothing, so `dexbot stat` answers "am I current?" without spending a request, and an offline node still prints the installed version. The one-time `dexbot update` hint keeps its notify-once latch, so the orange line is shown on every start but the hint repeats only until it is displayed. Centralization: the probe (`startVersionStatusCheck`), the colour/wording (`formatVersionStatusLine`), the hint text and the latch live only in `modules/version_notice.ts`; `unlock.ts`, `pm2.ts` and `dexbot.ts` consume them and cannot drift. The old notice-only entry points (`startVersionNoticeCheck`, `printVersionNotice`) and the pre-rendered `VersionNotice.message` string are REMOVED rather than kept as adapters — they were a second copy of the same wording that only tests still read, which is how a start path and a status path end up disagreeing; the tests now assert on the lines the operator actually sees (`modules/version_notice.ts`, `dexbot.ts`, `unlock.ts`, `pm2.ts`, `tests/test_version_notice.ts`). `dexbot stat` falls back to the plain header when the check is disabled (`DEXBOT_SKIP_VERSION_NOTICE=1`/`UPDATER.NOTICE_ENABLED=false`), and `--dryrun`/internal children still stay silent. Rendering-only change to the update path: no config keys, no network behaviour and no latch semantics change (`modules/version_notice.ts`, `dexbot.ts`, `unlock.ts`, `pm2.ts`, `tests/test_version_notice.ts`).
48
+
49
+ ### 2026-09-27
50
+
51
+ - **Refactor(genesis)**: remove the legacy tolerance price matcher; the frozen ladder is now the only price authority - v1.6.8's fail-closed load/startup gates made the no-genesis fallback unreachable in production (`_genesis` is only ever set by `loadGrid` after the E1 gate or by a grid build, and a populated `orders` Map without a ladder cannot be produced by any supported flow), but the branch was still the path an off-grid chain price became a slot's price — the exact corruption INV-GRID-004 exists to prevent. Deleted: the whole pass-2 legacy block (tolerance duplicate scan + strict `findMatchingGridOrderByOpenOrder` + the widened `ORPHAN_ADOPTION_TOLERANCE_MULTIPLIER` spread-orphan adoption), `findMatchingGridOrderByOpenOrder` itself (its last production caller was that block; the cancelOrder linkage now matches by `orderId`), `computeOutOfToleranceDriftTag` with the `price-drift-orphan` tag and the per-cycle auto-cancel that consumed it (`autoCancelOneUnmatchedOrphan`, its `bot._autoCancelOrphan*` state and the maintenance call site) — an off-grid order is HELD (`out-of-grid-deferred`) and resolved structurally, never cancelled off a fuzzy price diff — the pass-1 price-equality and duplicate-swap tolerance fallbacks, the correction-queue staleness tolerance, and `resolveLiveReserveEdgeAnchorPrice` tiers 2/3 (live slot extreme, resolved config bound) so the reserve anchor is the ladder extreme or nothing. Two constants go with them (`ORPHAN_ADOPTION_TOLERANCE_MULTIPLIER`, `PRICE_DRIFT_TOLERANCE_MULTIPLIER`); a config that still sets either is simply ignored. The unreachable pass-2 hold is tagged `no-genesis-deferred`, so the shared suffix predicate keeps it non-blocking and the stranded-hold set escalates it (a reload is exactly its remedy). **E2 is now fail-closed**: `syncFromOpenOrders` calls `_assertGenesisInvariant` first and, when slots exist without a ladder, returns an empty result — no locks taken, nothing adopted, nothing queued for correction — after logging at `error` and requesting the structural resync that re-derives the ladder; it previously warned and continued *into* the matcher, and giving up that continuation is the point of the change. The same rule tightened two judgement calls: the pass-1 "did this order move?" test and the duplicate-swap tiebreak now compare LADDER LEVELS (`chainPriceOnSameLevel`: both prices map to the same slot) instead of float equality, so a legitimate few-quanta rest-drift inside one level no longer queues a spurious price correction or fails the tiebreak, and `adoptedSlotKeepsItsOwnPrice` reports a ladder-less manager as a fault instead of passing it. The createOrder materialize path still keeps a placed chain order tracked when the grid is undefined, but for a `slot-N` id it now logs the missing ladder at `error` and requests the resync (the descriptor-price fallback remains only for an unparseable id). Behavioral impact: no production flow changes; a future bypass of E1/E3 now produces a refused sync and a resync request rather than a fuzzy adoption. Risk: the ladder-less state is no longer survivable at runtime — it is repaired at load, which is where it must be (`modules/order/sync_engine.ts`, `modules/order/utils/order.ts`, `modules/order/genesis_policy.ts`, `modules/dexbot_cow_runtime.ts`, `modules/dexbot_class.ts`, `modules/dexbot_maintenance_runtime.ts`, `modules/constants.ts`, `docs/GRID_PRICE_INVARIANT.md`, `tests/test_sync_excess_orphan.ts`, `tests/test_sync_out_of_grid_defer.ts`, `tests/test_sync_logic.ts`, `tests/test_uncertain_broadcast.ts`, `tests/test_reserve_orders.ts`, `tests/test_pending_fill_crawls.ts`, `tests/test_correction_queue_staleness.ts`, `tests/test_sync_duplicate_orphan_swap.ts`, `tests/test_sync_empty_confirm.ts`, `tests/test_sync_lock_id_verification.ts`, `tests/test_resync_invariants.ts`, `tests/test_startup_partial_fill.ts`, `tests/test_cow_committed_order_protection.ts`, `tests/helpers/order_test_helpers.ts`).
52
+
53
+ - **Fix(genesis)**: refuse a persisted grid that has no usable price ladder, instead of loading it and degrading every slot-price consumer to a tolerance matcher - the genesis ladder is the only authoritative price for a slot (INV-GRID-004), and the "no genesis" state was reachable only from a pre-v1.4.25 snapshot through three silent paths: a >50% slot mismatch against the config-derived rail (refused to adopt, but then kept the grid anyway), a not-yet-numeric rail config (`startPrice:"pool"`, `minPrice:"2x"`), and a throwing ladder build. In all three the snapshot loaded with `manager._genesis === null`, so nearest-slot adoption, `computeOutOfToleranceDriftTag`, the materialize descriptor-price fallback, `resolveLiveReserveEdgeAnchorPrice` tiers 3/4 and the `isSlotInRail` fail-open all ran on a tolerance matcher - the exact path on which an off-grid price becomes grid evidence. `loadGrid` now resolves the ladder through ONE decision (`resolvePersistedGenesis` in the new `modules/order/genesis_policy.ts`) and, when no ladder can be established, throws `MissingGenesisError` BEFORE any mutation (no asset init, no fund reset, no boundary restore), so the caller rebuilds from a clean manager. The startup gate asks the same question before committing to resume-vs-regenerate, so a ladder-less snapshot is regenerated (`initializeGrid` re-derives prices and reconcile is update-first) instead of half-loaded; the price-match resume reports "not resumed"; the recovery reload reports the failed reload for the structural resync - or, under `'halt'`, signals it so the automatic resync is suppressed. `GRID_LIMITS.MISSING_GENESIS_POLICY` (read as `config.gridLimits.MISSING_GENESIS_POLICY`) picks the response: `'rebuild'` (default, deterministic, no operator action) or `'halt'` (abort startup until a human runs a manual grid reset - strongest fund safety, opt-in because the bot stays down under PM2). Unknown values fall back to `'rebuild'`. The migration cross-check threshold is now the named `GRID_LIMITS.MISSING_GENESIS_MISMATCH_RATIO` (0.5) instead of an inline literal. Behavioral impact: a pre-v1.4.25 snapshot on a bot whose rail config is still unresolved now rebuilds once (deriving the ladder from the live market) instead of running permanently ladder-less; a snapshot whose config was edited past the ratio limit is rebuilt rather than loaded with a mismatched genesis. Risk: the rebuild re-slots live orders, the same net effect as a manual `dexbot reset` - use `MISSING_GENESIS_POLICY: 'halt'` to require explicit consent. Deliberately NOT adopted (rejected in the analysis): accepting the mismatched rail (mass-virtualizes live tracking, persists a mismatched genesis) and deriving the ladder from persisted slot prices (a truncated array would permanently shrink it) (`modules/order/genesis_policy.ts`, `modules/order/grid.ts`, `modules/dexbot_startup_runtime.ts`, `modules/dexbot_state_recovery.ts`, `modules/dexbot_maintenance_runtime.ts`, `modules/constants.ts`, `docs/GRID_PRICE_INVARIANT.md`).
54
+
55
+ - **Fix(genesis)**: centralize the rail geometry and close a non-terminating loop - the migration ladder builder duplicated `createOrderGrid`'s price-level generation, so a legacy snapshot could migrate to a different ladder than a fresh build of the same config; both now go through one `derivePriceLevels` (`modules/order/utils/math.ts`). The shared builder also refuses a non-advancing step (`incrementPercent` 0, negative, or small enough that `1 + inc/100` underflows) instead of spinning the geometric `while` forever - previously reachable from the startup migration gate. Config validation stays caller-side (`createOrderGrid` strict; migration builds a candidate ladder for the slot cross-check, so an out-of-bounds-but-finite edited config keeps reporting `slot_mismatch`, not a config error). Behavioral impact: a migrated ladder is identical to a fresh one, and an invalid increment cannot hang startup/load. (`modules/order/utils/math.ts`, `modules/order/grid.ts`, `modules/order/genesis_policy.ts`, `tests/test_missing_genesis_policy.ts`, `tests/test_dexbot_maintenance_runtime_dynamic_weights.ts`).
56
+
57
+ - **Feat(genesis)**: defence in depth for the same invariant - the sync entry (`syncFromOpenOrders`) now asserts the manager holds a ladder whenever it holds grid slots, and on a violation reports once per generation at `error` (with the recorded refusal reason, when there is one), counts it in `_genesisInvariantViolations`, and requests the debounced `requestStructuralGridResync('missing-genesis')` that re-derives the ladder. It deliberately does not throw: a sync in flight is not the place to abort a live manager, and the fail-closed decision belongs to the load-side gates. `initializeGrid` clears the fault record and the counter when it installs a new generation, so a resolved condition stops reporting. The persisted row is gated at the source too - `AccountOrders.loadGenesis` now refuses a row with empty/absent `priceLevels` instead of handing `loadGrid` a genesis it cannot validate against (a tampered but well-shaped hash is still returned; that warning belongs to `loadGrid`, which can say what it compared against). Together with the startup gate this is the E1/E2/Schema enforcement layer the invariant analysis asked for (`modules/order/sync_engine.ts`, `modules/account_orders.ts`, `modules/order/grid.ts`).
58
+
59
+ - **Test(genesis)**: add `tests/test_missing_genesis_policy.ts` (GEN-01..21) covering the T1 adoption (and its migration log), the T2/T3/T4 refusals, the ratio boundary (at-limit adopts, above refuses), policy resolution (default/case/garbage), `loadGrid` refusing before it mutates anything and honouring `'halt'`, the `loadGenesis` schema gate, the E2 assert's latch/counter/resync request, the recovery reload honouring `'halt'` (suppressed resync), and the shared rail geometry (migrated ladder equals a fresh build; a non-advancing increment is refused, not hung). `tests/test_grid_price_slot_invariant.ts` step 10 updated to the new contract (an edited config now refuses instead of warning and keeping the grid), and six fixtures that fed `loadGrid` a ladder-less snapshot (`test_boundary_restore_validation`, `test_grid_bloat`, `test_orphan_load_sanitize`, `test_pending_fill_crawls`, `test_uncertain_broadcast`, `test_dexbot_startup_dynamic_weight_wiring`) now persist a real ladder, as every production snapshot does; the boundary test's reversed-snapshot case was rewritten to pin the new contract (refused without a ladder, re-sorted to canonical order with one) (`tests/test_missing_genesis_policy.ts`, `tests/test_grid_price_slot_invariant.ts`, `tests/test_boundary_restore_validation.ts`, `tests/test_grid_bloat.ts`, `tests/test_orphan_load_sanitize.ts`, `tests/test_pending_fill_crawls.ts`, `tests/test_uncertain_broadcast.ts`, `tests/test_dexbot_startup_dynamic_weight_wiring.ts`).
60
+
61
+ - **Docs(genesis)**: document the missing-genesis policy, its trigger table, the three enforcement sites, the routing per caller and the rejected alternatives in `docs/GRID_PRICE_INVARIANT.md`, and extend `INV-GRID-004` in `docs/COW_INVARIANTS.md` with the refusal contract (`docs/GRID_PRICE_INVARIANT.md`, `docs/COW_INVARIANTS.md`).
62
+
63
+ - **Fix(reserve)**: exclude window members from every reserve classification site - the live-reserve count got the window exclusion in an earlier follow-up, but the no-crawl classification and the boundary-hold refill wire still ranked the plain floor/ceiling via `reserveEdgeIdSet` without it. When the active window reaches the grid edge (a keep-low window sitting on the floor), window members were misclassified as reserves: a genuine window fill was treated as static insurance and never crawled the boundary, so the hole was refilled same-side - and a guard-skipped window refill was dropped from `collectRefillSlotIds`' wire, so the hold could not pin the committed boundary. New `windowIdSetFromSlots` (with `liveWindowIdSet` delegating to it) supplies the window set to `deriveTargetBoundary`, `consumePendingFillCrawls`, `collectRefillSlotIds` (new `manager` option), the `initializeGrid` owed-crawl fold, and `_reconcileStartupSide`, matching the placement pickers and the count. Genuine reserve fills still never crawl; unknown boundary geometry fails open to the previous classification. Review-driven fixes in the same pass: `resolveReserveCount` migrates the legacy numeric `reserveOrders` form at read time and `validateBotEntry` accepts it (non-negative integer) instead of rejecting it; `applyPersistedPendingCrawls` logs a `restore-failed` ledger as retained (not dropped); the shared `railCenterIndex` removes the duplicated Tier-4 rail-center formula; and the reserve-sizing comment, `order.ts` section header, `AccountOrders` method list, and `INV-COW-008` are corrected. Behavioral impact: a window fill at the grid edge crawls again and a skipped window refill pins the boundary; a hand-edited numeric `reserveOrders` is honored. Risk: none beyond restoring the intended crawl - a genuine reserve (outside the window) is unaffected and still no-crawl. Tests: the reserve window-overlap no-crawl and refill-wire regression plus numeric-form read/validation cases, and the dynamic-weights ESM mock name list (`modules/order/utils/order.ts`, `modules/order/grid.ts`, `modules/order/grid_reconcile_internal.ts`, `modules/order/manager.ts`, `modules/order/utils/system.ts`, `modules/bot_settings.ts`, `modules/account_orders.ts`, `docs/COW_INVARIANTS.md`, `tests/test_reserve_orders.ts`, `tests/test_bot_settings.ts`, `tests/test_dexbot_maintenance_runtime_dynamic_weights.ts`).
64
+
65
+ ### 2026-09-28
66
+
67
+ - **Chore(packaging)**: drop test sources from the npm tarball - the published package shipped 19 claw bridge test files and two Kalman suites under `analysis/trend_detection/` through the blanket "claw" and "analysis" `files` entries, neither reachable from the installed runtime. "!claw/tests" removes 232K of TS test sources with zero runtime use; the two Kalman suites move to `analysis/legacy/tests/` (already excluded from the package and the prod tsconfig) and are converted to the CJS `require()` style the other legacy suites use, and both are wired into the `test:legacy` chain so they stay executed (their previous entry point, the `analysis/trend_detection/package.json` test script, nothing invoked). Package drops from 1137 to 1109 files; runtime modules that merely sit under a tests-named path (`dist/analysis/trend_detection`, `dist/market_adapter/test_helpers`) and the claw example are deliberately left in (`package.json`, `analysis/legacy/tests/test_kalman_trend.ts`, `analysis/legacy/tests/test_kalman_velocity_smoothing.ts`, `analysis/trend_detection/package.json`, `analysis/README.md`).
68
+
69
+ - **Chore(packaging)**: trim the npm tarball to shipped docs, assets and declarations - two reductions to the `files` whitelist. The blanket "analysis" entry shipped all 44 analysis `.ts` sources even though `tsc` already emits their compiled twins under `dist/analysis/`, so every tool shipped twice; it is replaced with an explicit list matching the way `docs/`, `modules/` and `market_adapter/` are already packaged - `analysis/uplot` must keep shipping (analysis/chart_utils.ts inlines the vendored uPlot runtime via `fs.readFileSync` from `PATHS.ANALYSIS.ASSETS_DIR`, a runtime dependency) plus the six `.md` files `analysis/README.md` links to, so shipping the top-level README alone would ship broken links. Separately, `dist/**/*.js.map` and `dist/**/*.d.ts.map` (464 files, 3.49 MB) are dropped: they resolve to root `.ts` sources never in `files` and nothing consumes them (zero runtime dependencies, no source-map-support, no `--enable-source-maps`), expressed as `files` negations so a local `dist/` keeps its maps while only the published tarball loses them; the 234 `.d.ts` files are kept for deep importers. Net: 1109 files / 2.902 MB unpacked down to 600 files / 2.131 MB (`package.json`).
70
+
71
+ - **Feat(tv)**: replay market-adapter grid resets in the bot charts - `gridPrice: "ama"` charts now visualize WHEN the grid would have recentered, not only where it sits today. `grid_reset_sim.ts` replays the two recentering triggers from `docs/GRID_RECALCULATION.md` §3/§4 over the chart's 1h AMA series (price-delta ratchet + slope-delta, price trigger first, the accepted slope baseline re-seeded on every reset, `clampGridPriceToBounds` semantics for absolute bounds), and `grid_reset_config.ts` resolves the thresholds through the production chain (constants → general.settings → market_adapter_settings globals/pair/bot) instead of reimplementing it, with `--grid-delta-pct`/`--grid-slope-delta-pct`/`--grid-warmup` CLI overrides plus an in-chart toggle and a bottom-left threshold panel; the replay is embedded into the self-contained HTML via `embedFunctionSources`, so pool/pair charts are untouched. Three runtime fixes were needed to make the chart's source chain honest: a persisted not-ready slope snapshot (`isReady:false`, slopePct 0) no longer acts as a phantom 0 %/bar baseline that could trip the slope trigger on the first real slope; a non-positive slope threshold now DISABLES the trigger instead of firing every cycle on delta ≥ 0 when the factor/maxSlopePct config is missing; and `MARKET_ADAPTER.AMA_SLOPE_DELTA_THRESHOLD_PERCENT` is read back from general settings (the editor's AMA-Slope Delta knob was inert) with `amaSlope` rebuilt so the shared `DEFAULTS` object is not poisoned. Risk: low - the runtime changes only affect bots whose configured/default slope factor resolves non-positive (previously spurious per-bar resets persisted via `advanceTriggeredBotState`); research-only modules otherwise (`analysis/tradingview/grid_reset_sim.ts`, `analysis/tradingview/grid_reset_config.ts`, `analysis/tradingview/tradingview_uplot_chart_generator.ts`, `analysis/tradingview/analyze_tradingview.ts`, `analysis/tradingview/README.md`, `analysis/README.md`, `market_adapter/core/market_adapter_service.ts`, `market_adapter/market_adapter.ts`, `market_adapter/core/strategies/dynamic_weight_series.ts`, `docs/GRID_RECALCULATION.md`, `tests/test_grid_reset_sim.ts`, `tests/test_market_adapter_logic.ts`, `tests/test_market_adapter_service.ts`, `tests/test_tradingview_chart_storage_key.ts`, `tests/README.md`).
72
+
73
+ - **Chore(dynamic-weight)**: raise the `kalS%` default from 1.0 to 1.11 - `DYNAMIC_WEIGHT_KALMAN_MAX_SLOPE_PCT` now requires a slightly stronger trend move before the Kalman composite branch reaches full directional strength; the research doc is synced to match (`modules/constants.ts`, `analysis/trend_detection/DYNAMIC_WEIGHT_RESEARCH.md`).
74
+
75
+ - **Fix(market-adapter)**: make the Kibana tail refresh incremental and bounded - shard coverage (`meta.queriedRanges`) now records `at`, the wall-clock time each query ran, so the newest window only re-queries buckets no query has seen `TAIL_SETTLE_LAG_MS` after they closed instead of a fixed 48h overlap. Gap immutability is judged per gap (`GAP_SETTLE_HORIZON_MS`) rather than per window, so a month-old gap in a "now" window stops being re-fetched forever; small gaps merge (`GAP_MERGE_TOLERANCE_BUCKETS`) and the sub-range budget is spent on merged span hours, not gap count, so one extra 1h hole can no longer escalate a run to a full-window fetch; persisted coverage spans are capped (`MAX_COVERAGE_SPANS`); a re-verifying run rewrites its shard even when the candles are identical because the moved verification time is the news, while a pure-reuse run still writes nothing. The timestamped refresh is capped at `TAIL_REFRESH_HOURS`: an old coverage hole (span compaction, an undatable shard, a hand-written file) would otherwise drag the boundary back weeks and re-query settled history on every run - without the cap a 30-day window with a mid-window hole re-fetched ~20 days per run, with it the worst case is the legacy 48h. Tests cover the incremental tail, the 48h ceiling, per-gap pruning, span compaction, and sub-range gap merging (`market_adapter/inputs/window_cache.ts`, `market_adapter/README.md`, `tests/test_window_cache.ts`).
76
+
77
+ - **Tune(range)**: widen the orange tight zone, `suizidal` starts below 1.4x - `RANGE_QUALITY` `ORANGE_MIN`/`RED_MAX` 1.45 → 1.4, so the orange tight zone is 1.4x-1.55x and a range below 1.4x flags red (suizidal); single-sourced via `RANGE_QUALITY`, the bot-editor legend and live range coloring follow automatically (`modules/constants.ts`).
78
+
79
+ - **Fix(clear)**: make the `dexbot clear*` scripts warn when the runtime is live, and sweep the rotated audit trail - `clear` reads like a harmless log wipe but is not: a running bot re-persists its grid within seconds, a running adapter rewrites both its state file and `market_adapter.lock` (deleting that lock is exactly what lets a second adapter start), and open log file descriptors mean the deleted space is only reclaimed on restart, so every wipe issued against a live fleet was silently cosmetic. `scripts/lib/dexbot-paths.sh` gains five helpers shared by all four `clear-*` scripts: `live_pid_from_file` (pid liveness by file), `runtime_processes` (the monolithic pid files, plus this install's online PM2 apps via `pm2 jlist` - filtered to `cwd`/`script_path` under the project or profiles root, and probed only when the daemon pid file is alive, so a cleanup script can never spawn a PM2 daemon as a side effect), `warn_if_runtime_running` (a warning block listing every hit with the reason it matters; advisory by construction - the prompt still runs, the deletion still happens, no exit code changes), `log_files` (one predicate - `*.log`, rotated `*.log.*`, `*.jsonl*` - now used by the count, the preview, the delete and the verification in both `clear-logs.sh` and `clear-all.sh`, so those four can no longer disagree) and `note_audit_included`. The predicate change is a fix, not cosmetics: `daemon-audit.jsonl.1` and `.2`, produced by the credential daemon's own rotation, match neither `*.jsonl` nor `*.log.*`, so `clear` used to delete the live audit file and leave its rotated history behind - a half-wiped trail that reads like tampering without being it. The audit trail is still deleted along with the rest of the logs, deliberately, with no opt-in flag and no second prompt: it is named in the preview (`Includes the credential audit trail: daemon-audit.jsonl*`) and the operator answers the same single `y`, since an explicit y/n confirmation is the right place for that decision. The published descriptions were wrong in the same direction - the README comment implied `clear` also performed the other three commands, and nothing said these are offline-only - so `dexbot help`, the CLI reference table, the onboarding troubleshooting guide, `scripts/README.md` and the README now state each command's exact scope, that the credential audit trail goes with the logs, and what deliberately survives every `clear*`: `bots.json`, `keys.json`, the generated settings files and `credit_runtime/` (`dexbot default` remains the separate settings reset) (`scripts/lib/dexbot-paths.sh`, `scripts/clear-logs.sh`, `scripts/clear-orders.sh`, `scripts/clear-market-adapter.sh`, `scripts/clear-all.sh`, `dexbot.ts`, `README.md`, `docs/WORKFLOW.md`, `docs/BITSHARES_ONBOARDING.md`, `scripts/README.md`).
80
+
81
+ - **Docs**: currency sweep over the published docs - `CHANGELOG.md` re-verified against the 12 commits since v1.6.7 (no gaps, nothing to add), then the drift that accumulated around it is closed. `docs/EVOLUTION.md`'s headline numbers are reconciled with the repository: the executive summary claimed 2,277 commits while its own footer said 2,300 (`git rev-list --count HEAD` = 2,300), the test count said 298 against 305 files in `tests/`, and every era row in the version-history table was recomputed from the current history - the first two rows were badly off (v0.1.0→v0.6.0 1,217 → 998, v0.6.0→v1.0.0 309 → 650) and the later rows drifted by 10-25% because each was written when its era closed and never refreshed; the table now states that its counts are `git rev-list --count` over the current history so the next reader does not have to guess which convention a number used. `docs/DEXBOT_COMPARISON.md`'s testing-depth row moves 256 → 305. `docs/README.md` gains source-map entries for `order/genesis_policy.ts` and `version_notice.ts`, and stops calling the untagged 1.6.8 "released". `docs/WORKFLOW.md`'s `start` feature list no longer advertises auto-update as a default, because `UPDATER.ACTIVE` is default-off by design, and the broken `#version-notice` anchor it introduced is dropped (no such section exists in that file; the behaviour is release-noted, not documented there). `modules/README.md`'s layout tree gains the modules and `order/utils/` files it had drifted past (`version_notice`, `cli_start_onboarding`, `cli_start_output`, `cli_colors`, `credit_pricing`, `grid_price_source`, `node_connect_policy`, `order/genesis_policy`, `utils/text_width`, `utils/chain_logs`; no stale entries were found, only missing ones), and `tests/README.md` points at `npm run test:legacy` and the `test_missing_genesis_policy.ts` / `test_last_fill_pivot_persistence.ts` / `test_version_notice.ts` suites. Verified alongside the sweep: the CLI table in `docs/WORKFLOW.md` matches every command and alias in `dexbot.ts`; the `GRID_PRICE_INVARIANT.md` key-constant table matches `modules/constants.ts` value-for-value; `RANGE_QUALITY` (1.4/1.55/2.0) and `DYNAMIC_WEIGHT_KALMAN_MAX_SLOPE_PCT` (1.11) match the constants and the research doc; every relative markdown link in the repo resolves; and no doc still references a removed symbol (`ORPHAN_ADOPTION_TOLERANCE_MULTIPLIER`, `PRICE_DRIFT_TOLERANCE_MULTIPLIER`, `findMatchingGridOrderByOpenOrder`, `price-drift-orphan`, `printVersionNotice`, the `dexbot whitelist` command) outside the changelog's historical and removal-tombstone entries. Documentation only, no runtime change (`docs/EVOLUTION.md`, `docs/DEXBOT_COMPARISON.md`, `docs/README.md`, `docs/WORKFLOW.md`, `modules/README.md`, `tests/README.md`).
82
+
83
+ ## [1.6.7] - 2026-09-26 - Native Session Recovery, Start Onboarding, Keys UX, Guard Pivot Persistence
84
+
85
+ ### 2026-09-26
86
+
15
87
  - **Feat(guard)**: persist/restore the LAST-FILL-GUARD pivot with the grid snapshot — the guard was fully disabled after every restart (in-memory `_lastFilledPrice`/`_lastFilledType` reset to null) precisely while the boundary was still being rebuilt, and the book seed (`seedLastFilledPricesFromBook`) that re-armed it is only a proxy (max resting buy / min resting sell) that goes wrong whenever the book isn't adjacent to the last fill (partials, rotations, reserve shelf, dust). `persistGridSnapshot` now builds a `{price, type, fillsAt, genesisHash}` row (`buildLastFillPivotPayload`) and passes it as `storeMasterGrid`'s 10th param; `grid.loadGrid` restores it via `restoreLastFillPivot` right after `_restoreBoundary` — with genesis applied and the grid re-typed, before the first reconcile/broadcast — so startup, price-match resume, and the recovery reload all inherit it from one call site. The row carries the CURRENT live genesis hash, so a regenerated/re-derived grid refuses a pivot from a dead generation. Restore validation runs TTL → genesis binding → on-grid: the TTL is 24h (`GRID_LIMITS.LAST_FILL_PIVOT_TTL_MS`) with the ORIGINAL `fillsAt` preserved through `setLastFillPivot`'s `atMs`, so it keeps meaning "age of the last fill", not "time since last restart"; the on-grid check reuses the runtime's own `resolveOnGridPivot` ladder validator (lazily required from `utils/system.ts` so one increment fallback chain and one drift rule serve both the per-probe live guard and the restore; the snapped ladder level is restored, never the raw float; an off-ladder row falls back to the book seed). TTL and genesis-mismatch verdicts erase the stored row through one shared drop path (`AccountOrders.clearPersistedLastFillPivot`, so no half-invalid row can re-arm the same verdict next boot). The fill-ledger reconstruction alternative was rejected: a snapshot mirror invalidates in lockstep with the boundary instead of maintaining a second source of truth (`modules/account_orders.ts`, `modules/order/utils/system.ts`, `modules/order/grid.ts`, `modules/constants.ts`).
16
88
 
17
89
  - **Refactor(guard)**: centralize LAST-FILL-GUARD pivot mutation behind one provenance-tagged writer — fills persist, heuristics don't. New shared `setLastFillPivot(type, price, 'fill'|'book', atMs?)` in `utils/system.ts` sets `_lastFilledPrice`/`_lastFilledType`/`_lastFilledAt`, a `lastFillPivotSource` flag, and the per-side `_lastFilledBuyPrice`/`_lastFilledSellPrice` mirror in one place; `OrderManager._setLastFillPivot` delegates to it and cow_runtime's queued-fill refresh calls it directly, replacing three hand-rolled scalar-mutation sites. Only `'fill'` provenance is persist-eligible, so a book seed never fossilizes as market truth. The row shape is validated by one shared gate (`normalizeLastFillPivot`) used by both the `storeMasterGrid` sanitizer and the loader, so the two checks cannot drift (`modules/order/manager.ts`, `modules/dexbot_cow_runtime.ts`, `modules/order/utils/system.ts`, `modules/account_orders.ts`).
package/README.md CHANGED
@@ -329,7 +329,7 @@ First-run details and common mistakes are covered in the [BitShares Onboarding T
329
329
 
330
330
  ```bash
331
331
  dexbot key # Master password/keyring
332
- dexbot bot # Interactive bot configurator (adapter flags: 2) Modify bot → 6) Adapter)
332
+ dexbot bot # Interactive bot configurator
333
333
 
334
334
  dexbot reset {all|<bot>} # Regenerate grid
335
335
  dexbot disable {all|<bot>} # Disable bot in config
@@ -338,11 +338,11 @@ dexbot enable {all|<bot>} # Enable bot in config
338
338
  dexbot stat # Runtime status (unlock or PM2)
339
339
  dexbot order [<bot>] # Analyze order grids (--export → HTML to analysis/charts/)
340
340
  dexbot tv <bot|pool|A/B> # TradingView 1h chart with AMA overlay (default: 3 months)
341
- dexbot credit [<bot>] # Live summed MPA + borrowed-credit positions per asset per bot
341
+ dexbot credit [<bot>] # Live summed MPA + borrowed-credit positions
342
342
  dexbot export <bot> # Export trades + settings (CSV/JSON) for analysis/
343
343
 
344
344
  dexbot update # Update DEXBot2
345
- dexbot clear # Clear log files (also clear-orders, clear-market-adapter, clear-all)
345
+ dexbot clear # Delete log files in <profiles>/logs
346
346
  dexbot default # Reset settings to defaults
347
347
  dexbot help # Grouped command reference
348
348
  ```
@@ -306,7 +306,7 @@ node dist/analysis/analyze_trade_heatmap.js \
306
306
 
307
307
  ### TradingView Chart (`tradingview/analyze_tradingview.ts`)
308
308
 
309
- Generates a standalone TradingView-style HTML chart with candle OHLC, SMA, AMA, VWMA, and volume panel. See [tradingview/README.md](tradingview/README.md) for full documentation.
309
+ Generates a standalone TradingView-style HTML chart with candle OHLC, SMA, AMA, VWMA, and volume panel. For AMA-grid bots it also replays the market adapter's grid resets (AMA-price Δ / AMA-slope Δ) using the thresholds resolved from `general.settings` / `market_adapter_settings` — see [tradingview/README.md](tradingview/README.md#grid-reset-simulation) and [docs/GRID_RECALCULATION.md](../docs/GRID_RECALCULATION.md). See [tradingview/README.md](tradingview/README.md) for full documentation.
310
310
 
311
311
  # Recommended one-step: bot, pool, or pair (fetches candles + renders, default 3 months)
312
312
  dexbot tv <bot-key>
@@ -411,8 +411,7 @@ Shared analyzers and chart renderers for the dynamic-weight signal path. Core en
411
411
  **Tests:**
412
412
 
413
413
  ```bash
414
- node dist/analysis/trend_detection/tests/test_kalman_trend.js
415
- node dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.js
414
+ npm run test:legacy
416
415
  ```
417
416
 
418
417
  **Note:** `trend_detection/` has no external dependencies — runs directly from the compiled build (`node dist/...`).
@@ -39,6 +39,7 @@ The sections below cover manual usage (explicit candle files, direct runner flag
39
39
  - SMA overlay
40
40
  - AMA preset buttons `1–4` (one-click AMA1–4, active preset highlighted); numeric inputs kept
41
41
  - Bot-grid range highlight, off by default (the bot's min/max around AMA with live asymmetric tilt; red above AMA, green below)
42
+ - Grid-reset simulation (AMA bots, on by default): replays the market adapter's two recentering triggers over the candle history — the accepted grid center as a step line, the simulated grid range around it, and a marker per reset (`init` = first AMA snapshot, `Δ1` = AMA-price Δ, `Δs` = AMA-slope Δ). Thresholds come from the live config chain; a bottom-left panel shows the values, where they came from, and the reset counts (see [Grid-Reset Simulation](#grid-reset-simulation))
42
43
  - Range-scale switch: fit the price axis to the range band
43
44
  - VWMA overlay
44
45
  - Order overlay for bot charts (active grid buys/sells as dashed levels, reserve line at the lowest grid buy, ceiling line at the highest grid sell, spread label; pair-aware, toggle in-chart)
@@ -193,6 +194,10 @@ market_adapter/data/lp/<pair>/lp_pool_<id>_<interval>.json
193
194
  | `--range` | Enable range highlight (off by default; toggle in-chart) | off |
194
195
  | `--no-range` | Disable range highlight | — |
195
196
  | `--range-scale` | Range Scaling: size the band by AMA slope like the grid build + fit price axis to it | — |
197
+ | `--no-grid-reset` | Render without the grid-reset simulation (toggle it back in the chart) | on for AMA bots |
198
+ | `--grid-delta-pct <n>` | Override the AMA-price Δ threshold for the simulation (skips config resolution) | config |
199
+ | `--grid-slope-delta-pct <n>` | Override the AMA-slope Δ threshold for the simulation, in %/bar | config |
200
+ | `--grid-warmup <bars>` | Override the simulation start bar (skipped before the first accepted center) | AMA warmup |
196
201
  | `--range-span <mult>` | x-range around AMA, 1.2–2 (default: bot grid setting) | bot grid |
197
202
  | `--orders-file <path>` | Order-grid JSON override for the overlay (default: `profiles/orders/<botKey>.json`) | bot orders |
198
203
  | `--no-orders` | Disable the order overlay (levels, reserve/ceiling lines, spread label) | — |
@@ -201,6 +206,78 @@ market_adapter/data/lp/<pair>/lp_pool_<id>_<interval>.json
201
206
  | `--no-update-marker` | Suppress the update marker even when the candle file has stamped meta | — |
202
207
  | `--quiet` | Suppress progress logs | — |
203
208
 
209
+ ## Grid-Reset Simulation
210
+
211
+ Bot charts (`--bot-key <key>`, i.e. bots with `gridPrice: "ama"`) additionally
212
+ replay the market adapter's grid recentering over the candle history, so you can
213
+ see *when the grid would have moved* instead of only where it sits today. See
214
+ [docs/GRID_RECALCULATION.md](../../docs/GRID_RECALCULATION.md) for the runtime
215
+ mechanics; the chart mirrors §3 and §4 and nothing else.
216
+
217
+ **What it draws**
218
+
219
+ - **Grid center** (violet step line, legend `Grid`) — the accepted
220
+ `gridCenterPrice`. It only moves on a trigger, so the line is a staircase:
221
+ flat = "the grid would still be sitting here".
222
+ - **Simulated range** (violet band) — the grid bounds that center would own:
223
+ the bot's `minPrice`/`maxPrice` multipliers around the accepted center, tilted
224
+ by the *accepted* slope through `applyAsymmetricBounds` +
225
+ `applyNarrowingSideGuard` (the same functions the live grid build uses). It
226
+ re-tilts only at resets, exactly like the real thing.
227
+ - **Reset markers** — one vertical line per reset, colored and tagged by reason:
228
+ grey `init` (first accepted AMA snapshot, `market_adapter_bootstrap`),
229
+ amber `Δ1` (`market_adapter_delta_threshold`), cyan `Δs`
230
+ (`market_adapter_ama_slope_delta_threshold`).
231
+ - **Panel (bottom-left)** — effective `AMA Δ` and `Slope Δ` thresholds, the
232
+ layer each came from, reset counts, and the last reset.
233
+
234
+ **Where the thresholds come from**
235
+
236
+ Resolved through the same chain the running adapter uses, by
237
+ `analysis/tradingview/grid_reset_config.ts`:
238
+
239
+ 1. `modules/constants.ts` (`MARKET_ADAPTER.AMA_DELTA_THRESHOLD_PERCENT`,
240
+ `AMA_SLOPE_DELTA_THRESHOLD_PERCENT` × `DYNAMIC_WEIGHT_AMA_MAX_SLOPE_PCT`)
241
+ 2. `profiles/general.settings.json` → `MARKET_ADAPTER.AMA_DELTA_THRESHOLD_PERCENT`
242
+ and `MARKET_ADAPTER.AMA_SLOPE_DELTA_THRESHOLD_PERCENT` (the editor's
243
+ `AMA-Slope Δ`, applied to `amaSlope.deltaThresholdPct` by
244
+ `applyRuntimeDefaultsFromGeneralSettings`)
245
+ 3. `profiles/market_adapter_settings.json` → `globals` → `pairs[].marketAdapterSettings` → `pairs[].botOverrides[<botName>]`
246
+
247
+ The effective numbers come from the production resolvers themselves
248
+ (`applyRuntimeDefaultsFromGeneralSettings`, `resolveBotCfg`,
249
+ `calculateBotThreshold`, `MarketAdapterService.resolveAmaSlopeDeltaThresholdPercent`),
250
+ so the chart cannot drift from the runtime. The panel labels the winning layer;
251
+ `--grid-delta-pct` / `--grid-slope-delta-pct` short-circuit the chain and report
252
+ `cli` as the source.
253
+
254
+ **Gates the replay honors**
255
+
256
+ - The `Δs` trigger only fires for AMA-grid bots whitelisted for
257
+ `asymmetricBounds` (range scaling) in
258
+ `profiles/market_adapter_whitelist.json` **and** carrying an explicit
259
+ `weightDistribution` — the adapter skips the slope signal otherwise.
260
+ When gated off, the panel shows the threshold with `off` and the slope
261
+ trigger is inert, like in production. A non-positive resolved threshold
262
+ disables the trigger too (it never means "fire every cycle").
263
+ - The replay starts at the AMA warmup point (`getAmaWarmupBars`), capped at half
264
+ the dataset so a short chart still shows something; the applied value is in
265
+ the panel and can be forced with `--grid-warmup`.
266
+ - Absolute `minPrice`/`maxPrice` pin the center like `clampGridPriceToBounds` —
267
+ drift is measured against the **clamped** center, so an AMA outside the
268
+ bounds does not emit a reset marker every bar; `"Nx"` multipliers travel with
269
+ the center and never clamp.
270
+ - Not simulated (out of scope for a candle chart): RMS structural divergence,
271
+ available-funds resizes, manual/legacy triggers, and the staleness / gap /
272
+ no-new-candle suppression gates. One evaluation per 1h bar.
273
+
274
+ The replay runs in the page, so the AMA series (and therefore the trigger
275
+ points) follows the AMA inputs and preset buttons; the gating parameters that
276
+ would come from config (`erPeriod`, lookback, warmup, clip percentile) are fixed
277
+ at generation time. The replay uses the canonical `simulateGridResetSeries()`
278
+ from `analysis/tradingview/grid_reset_sim.ts`, embedded verbatim via
279
+ `embedFunctionSources` — not a hand copy of the adapter logic.
280
+
204
281
  ## Notes
205
282
 
206
283
  - The chart embeds the vendored `uPlot` runtime inline (no CDN, no sibling `uplot/` dir, no DEXBot2 install needed). Each export is a single self-contained HTML file that renders anywhere, even after being copied or mailed to a machine without DEXBot2.
@@ -216,7 +293,7 @@ market_adapter/data/lp/<pair>/lp_pool_<id>_<interval>.json
216
293
  - The update marker falls back to `prevUpdateLastCandleSec` / `prevUpdateNewBars` stamped in the candle-file `meta` when the flags are absent; those fields are written by external incremental-fetch tooling, not by anything in this repo.
217
294
  - `Ctrl+0` (or `Cmd+0`) resets the time-axis zoom to the full dataset.
218
295
  - Mouse: drag the candles to pan time + price (price drag sets a manual range); wheel zooms time, except over the price axis where it zooms price. Shift+wheel zooms price anywhere over the price pane (cursor-anchored). Dragging the price-axis gutter scales price, dragging the time-axis gutter scales the timeframe; double-click the price axis to return to autofit. While the price range is manual, timeframe moves no longer refit it.
219
- - Indicator, timeframe, scale, and overlay-visibility changes are persisted in browser `localStorage` per pool/pair chart (`dexbot2-tradingview-uplot-v3:<pool>:<A>_<B>:<baseSecs|base>`); cursor sync between the price/volume panes uses a separate constant key.
296
+ - Indicator, timeframe, scale, and overlay-visibility changes are persisted in browser `localStorage` per pool/pair chart (`dexbot2-tradingview-uplot-v3:<pool>:<A>_<B>:<baseSecs|base>`); cursor sync between the price/volume panes uses a separate constant key. The `Resets` toggle is persisted the same way, so a chart opened from a previous session keeps its simulation state.
220
297
  - The price axis defaults to log base `10`, with a toolbar switch for `Log` / `Linear`.
221
298
  - If you regenerate the HTML and then open it later, no CDN access is needed — the `uPlot` library (JS + CSS) is inlined into the file itself, so it renders fully offline and is independent of where the file lives on disk.
222
299
 
@@ -170,7 +170,7 @@ All panels share aligned vertical time grid lines, and the bottom output panel s
170
170
  | **lb** | 1–32 | 9 | Logarithmic. Lookback bars for AMA slope calculation |
171
171
  | **ema** | 0–32 | 0 | AMA input EMA span in bars (0 = off). Low-pass filters the AMA before the slope is taken; the gray dashed Raw‰ line shows the unfiltered slope for comparison |
172
172
  | **amaS%** | 0.06–0.12 | 0.09 | Logarithmic. Gear ratio for average per-bar AMA slope saturation |
173
- | **kalS%** | 0.5–1.5 | 1.0 | Logarithmic. Gear ratio for Kalman composite saturation |
173
+ | **kalS%** | 0.5–1.5 | 1.11 | Logarithmic. Gear ratio for Kalman composite saturation |
174
174
  | **clip%** | 0–55 | 10 | Percentile clip: filters extreme inputs (0 = off) |
175
175
 
176
176
  ### Output Controls
package/claw/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dexbot2-claw",
3
- "version": "1.6.7",
3
+ "version": "1.6.9",
4
4
  "private": true,
5
5
  "description": "Claw bridge and runtime integration layer for BitShares and DEXBot2.",
6
6
  "type": "module",
@@ -2,7 +2,7 @@
2
2
  "id": "bitshares-claw",
3
3
  "name": "BitShares Claw",
4
4
  "description": "Native BitShares and DEXBot2 tools from the DEXBot2 claw integration",
5
- "version": "1.6.7",
5
+ "version": "1.6.9",
6
6
  "skills": [
7
7
  "skills"
8
8
  ],
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bitshares-claw-openclaw-plugin",
3
3
  "private": true,
4
- "version": "1.6.7",
4
+ "version": "1.6.9",
5
5
  "type": "module",
6
6
  "main": "index.js"
7
7
  }
@@ -23,6 +23,10 @@ declare function parseArgs(): {
23
23
  rangeSpan: number | undefined;
24
24
  ordersFile: string | null;
25
25
  noOrders: boolean;
26
+ gridResetEnabled: boolean;
27
+ gridDeltaPct: number | undefined;
28
+ gridSlopeDeltaPct: number | undefined;
29
+ gridWarmupBars: number | undefined;
26
30
  noUpdateMarker: boolean;
27
31
  updateMarkerTsSec: number | null;
28
32
  updateMarkerNewBars: number | null;
@@ -3,6 +3,8 @@
3
3
  import fs from 'node:fs';
4
4
  import path from 'node:path';
5
5
  import { generateHTML } from './tradingview_uplot_chart_generator.js';
6
+ import { resolveGridResetSimConfig, toGridSimPayload } from './grid_reset_config.js';
7
+ import { resolveAmaConfig } from '../bot_key_utils.js';
6
8
  import { MARKET_ADAPTER } from '../../modules/constants.js';
7
9
  import { loadCandleFile } from '../math_utils.js';
8
10
  import { getErrorMessage } from '../../modules/utils/errors.js';
@@ -35,6 +37,10 @@ function parseArgs() {
35
37
  rangeSpan: undefined,
36
38
  ordersFile: null,
37
39
  noOrders: false,
40
+ gridResetEnabled: true,
41
+ gridDeltaPct: undefined,
42
+ gridSlopeDeltaPct: undefined,
43
+ gridWarmupBars: undefined,
38
44
  noUpdateMarker: false,
39
45
  updateMarkerTsSec: null,
40
46
  updateMarkerNewBars: null,
@@ -85,6 +91,31 @@ function parseArgs() {
85
91
  config.ordersFile = String(args[++i] || '');
86
92
  else if (arg === '--no-orders')
87
93
  config.noOrders = true;
94
+ else if (arg === '--grid-reset')
95
+ config.gridResetEnabled = true;
96
+ else if (arg === '--no-grid-reset')
97
+ config.gridResetEnabled = false;
98
+ else if (arg === '--grid-delta-pct') {
99
+ const v = parseFloat(args[++i]);
100
+ if (Number.isFinite(v) && v > 0)
101
+ config.gridDeltaPct = Math.max(0.01, v);
102
+ else
103
+ console.warn('[TradingView] --grid-delta-pct requires a positive number; ignoring.');
104
+ }
105
+ else if (arg === '--grid-slope-delta-pct') {
106
+ const v = parseFloat(args[++i]);
107
+ if (Number.isFinite(v) && v > 0)
108
+ config.gridSlopeDeltaPct = Math.max(0.0001, v);
109
+ else
110
+ console.warn('[TradingView] --grid-slope-delta-pct requires a positive number; ignoring.');
111
+ }
112
+ else if (arg === '--grid-warmup') {
113
+ const v = parseFloat(args[++i]);
114
+ if (Number.isFinite(v) && v >= 0)
115
+ config.gridWarmupBars = Math.max(0, Math.round(v));
116
+ else
117
+ console.warn('[TradingView] --grid-warmup requires a non-negative bar count; ignoring.');
118
+ }
88
119
  else if (arg === '--no-update-marker')
89
120
  config.noUpdateMarker = true;
90
121
  else if (arg === '--update-marker-ts')
@@ -234,6 +265,28 @@ async function main() {
234
265
  const gridBounds = { low: ordersData.low, high: ordersData.high };
235
266
  if (!config.quiet && ordersFile)
236
267
  console.log(`[TradingView] Order overlay: ${orderBuys.length} buys + ${orderSells.length} sells from ${ordersFile}`);
268
+ // Grid-reset simulation (docs/GRID_RECALCULATION.md §3/§4): resolve the
269
+ // AMA-price and AMA-slope delta thresholds exactly like the running
270
+ // adapter does (constants → general.settings → market_adapter_settings
271
+ // globals/pair/bot), so the chart replays the real recentering points.
272
+ const simOverrides = {
273
+ priceDeltaThresholdPercent: config.gridDeltaPct,
274
+ slopeDeltaThresholdPercent: config.gridSlopeDeltaPct,
275
+ warmupBars: config.gridWarmupBars,
276
+ };
277
+ const gridSim = botKey
278
+ ? toGridSimPayload(resolveGridResetSimConfig({
279
+ botKey,
280
+ bot: botMeta,
281
+ ama: resolveAmaConfig(botKey),
282
+ overrides: simOverrides,
283
+ }))
284
+ : null;
285
+ if (!config.quiet && gridSim) {
286
+ console.log(`[TradingView] Grid resets: AMA Δ ${gridSim.priceDeltaThresholdPercent}% (${gridSim.priceSource})`
287
+ + ` | AMA-Slope Δ ${gridSim.slopeDeltaThresholdPercent}%/bar (${gridSim.slopeSource})`
288
+ + ` | slope trigger ${gridSim.slopeEnabled ? 'on' : 'off'}`);
289
+ }
237
290
  const html = generateHTML({
238
291
  candles,
239
292
  meta: jsonMeta || {
@@ -259,6 +312,8 @@ async function main() {
259
312
  rangeScaleEnabled: config.rangeScaleEnabled,
260
313
  rangeSpan: config.rangeSpan,
261
314
  grid,
315
+ gridSim,
316
+ gridSimEnabled: config.gridResetEnabled,
262
317
  priceScale: config.priceScale === 'linear' ? 'linear' : 'log',
263
318
  defaultTimeframe: '1h',
264
319
  marketAdapter: MARKET_ADAPTER,
@@ -0,0 +1,61 @@
1
+ /**
2
+ * @param {Object} input
3
+ * @param {string|null} input.botKey Bot key from profiles/bots.json.
4
+ * @param {Object|null} input.bot Raw bots.json entry (for cfg layering).
5
+ * @param {Object|null} input.ama Resolved AMA config (er/fast/slow) the chart runs with.
6
+ * @param {Object} [input.overrides] CLI overrides {priceDeltaThresholdPercent, slopeDeltaThresholdPercent, enabled}.
7
+ */
8
+ declare function resolveGridResetSimConfig({ botKey, bot, ama, overrides }?: any): {
9
+ enabled: boolean;
10
+ botKey: any;
11
+ priceDeltaThresholdPercent: any;
12
+ priceSource: any;
13
+ slopeDeltaThresholdPercent: any;
14
+ slopeSource: any;
15
+ slopeEnabled: boolean;
16
+ dynamicWeightEnabled: boolean;
17
+ lookbackBars: any;
18
+ maxSlopePct: any;
19
+ neutralZonePct: number;
20
+ maxSlopeOffset: any;
21
+ clipPercentile: number;
22
+ maxAsymmetryFactor: any;
23
+ minScaleSlots: any;
24
+ incrementPercent: number | null;
25
+ erPeriod: number;
26
+ warmupBars: number;
27
+ warmupBarsOverride: number | null;
28
+ clampMin: number | null;
29
+ clampMax: number | null;
30
+ notes: string[];
31
+ };
32
+ /**
33
+ * Flatten the resolved config for the chart payload, dropping anything the page
34
+ * must not see (e.g. Infinity from a disabled threshold).
35
+ */
36
+ declare function toGridSimPayload(cfg: any): {
37
+ enabled: boolean;
38
+ botKey: any;
39
+ priceDeltaThresholdPercent: any;
40
+ priceSource: any;
41
+ slopeDeltaThresholdPercent: any;
42
+ slopeSource: any;
43
+ slopeEnabled: boolean;
44
+ dynamicWeightEnabled: boolean;
45
+ lookbackBars: any;
46
+ maxSlopePct: any;
47
+ neutralZonePct: any;
48
+ maxSlopeOffset: any;
49
+ clipPercentile: any;
50
+ maxAsymmetryFactor: any;
51
+ minScaleSlots: any;
52
+ incrementPercent: any;
53
+ erPeriod: any;
54
+ warmupBars: any;
55
+ warmupBarsOverride: any;
56
+ clampMin: any;
57
+ clampMax: any;
58
+ notes: any;
59
+ } | null;
60
+ export { resolveGridResetSimConfig, toGridSimPayload };
61
+ //# sourceMappingURL=grid_reset_config.d.ts.map