dexbot 1.4.17 → 1.4.18

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 (209) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/analysis/README.md +43 -43
  3. package/analysis/ama_fitting/README.md +8 -8
  4. package/analysis/ama_fitting/package.json +1 -1
  5. package/analysis/bot_fitting/README.md +4 -4
  6. package/analysis/bot_fitting/backtest_ama_sweep.ts +1 -1
  7. package/analysis/bot_usage/discover_bot_accounts.ts +11 -11
  8. package/analysis/tradingview/README.md +4 -4
  9. package/analysis/trend_detection/DYNAMIC_WEIGHT_RESEARCH.md +2 -2
  10. package/analysis/trend_detection/SIGNAL_DOCUMENTATION.md +1 -1
  11. package/analysis/trend_detection/package.json +1 -1
  12. package/claw/README.md +45 -45
  13. package/claw/docs/AI_BOT_LIBRARY_API.md +6 -6
  14. package/claw/examples/short_mpa_bts_strategy.ts +3 -3
  15. package/claw/package.json +21 -21
  16. package/claw/runtimes/openclaw-plugin/openclaw.plugin.json +1 -1
  17. package/claw/runtimes/openclaw-plugin/package.json +1 -1
  18. package/claw/scripts/claw_bridge.ts +2 -2
  19. package/claw/scripts/claw_skill_md.ts +1 -1
  20. package/claw/skills/launcher-ops/references/launcher-workflow.md +5 -5
  21. package/claw/skills/margin-trading/references/honest-asset-list.md +1 -1
  22. package/claw/skills/memu-memory/SKILL.md +3 -3
  23. package/claw/tests/test_claw_mcp_transport.ts +2 -2
  24. package/dist/analysis/ama_fitting/analyze_ama_price_changes.d.ts +3 -0
  25. package/dist/analysis/ama_fitting/analyze_ama_price_changes.d.ts.map +1 -0
  26. package/dist/analysis/ama_fitting/analyze_ama_price_changes.js +148 -0
  27. package/dist/analysis/ama_fitting/analyze_ama_price_changes.js.map +1 -0
  28. package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.d.ts +12 -0
  29. package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.d.ts.map +1 -0
  30. package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.js +389 -0
  31. package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.js.map +1 -0
  32. package/dist/analysis/ama_fitting/calibrate_convergence_er.d.ts +3 -0
  33. package/dist/analysis/ama_fitting/calibrate_convergence_er.d.ts.map +1 -0
  34. package/dist/analysis/ama_fitting/calibrate_convergence_er.js +200 -0
  35. package/dist/analysis/ama_fitting/calibrate_convergence_er.js.map +1 -0
  36. package/dist/analysis/ama_fitting/fetch_lp_candles.d.ts +3 -0
  37. package/dist/analysis/ama_fitting/fetch_lp_candles.d.ts.map +1 -0
  38. package/dist/analysis/ama_fitting/fetch_lp_candles.js +213 -0
  39. package/dist/analysis/ama_fitting/fetch_lp_candles.js.map +1 -0
  40. package/dist/analysis/ama_fitting/generate_unified_comparison_chart.d.ts +25 -0
  41. package/dist/analysis/ama_fitting/generate_unified_comparison_chart.d.ts.map +1 -0
  42. package/dist/analysis/ama_fitting/generate_unified_comparison_chart.js +247 -0
  43. package/dist/analysis/ama_fitting/generate_unified_comparison_chart.js.map +1 -0
  44. package/dist/analysis/ama_fitting/optimizer_high_resolution.d.ts +35 -0
  45. package/dist/analysis/ama_fitting/optimizer_high_resolution.d.ts.map +1 -0
  46. package/dist/analysis/ama_fitting/optimizer_high_resolution.js +782 -0
  47. package/dist/analysis/ama_fitting/optimizer_high_resolution.js.map +1 -0
  48. package/dist/analysis/analyze_derivatives.d.ts +86 -0
  49. package/dist/analysis/analyze_derivatives.d.ts.map +1 -0
  50. package/dist/analysis/analyze_derivatives.js +285 -0
  51. package/dist/analysis/analyze_derivatives.js.map +1 -0
  52. package/dist/analysis/analyze_dynamic_weight.d.ts +14 -0
  53. package/dist/analysis/analyze_dynamic_weight.d.ts.map +1 -0
  54. package/dist/analysis/analyze_dynamic_weight.js +197 -0
  55. package/dist/analysis/analyze_dynamic_weight.js.map +1 -0
  56. package/dist/analysis/analyze_kalman.d.ts +13 -0
  57. package/dist/analysis/analyze_kalman.d.ts.map +1 -0
  58. package/dist/analysis/analyze_kalman.js +118 -0
  59. package/dist/analysis/analyze_kalman.js.map +1 -0
  60. package/dist/analysis/analyze_regime.d.ts +20 -0
  61. package/dist/analysis/analyze_regime.d.ts.map +1 -0
  62. package/dist/analysis/analyze_regime.js +139 -0
  63. package/dist/analysis/analyze_regime.js.map +1 -0
  64. package/dist/analysis/analyze_regime_windows.d.ts +19 -0
  65. package/dist/analysis/analyze_regime_windows.d.ts.map +1 -0
  66. package/dist/analysis/analyze_regime_windows.js +414 -0
  67. package/dist/analysis/analyze_regime_windows.js.map +1 -0
  68. package/dist/analysis/analyze_risk_profile.d.ts +3 -0
  69. package/dist/analysis/analyze_risk_profile.d.ts.map +1 -0
  70. package/dist/analysis/analyze_risk_profile.js +186 -0
  71. package/dist/analysis/analyze_risk_profile.js.map +1 -0
  72. package/dist/analysis/analyze_trade_heatmap.d.ts +3 -0
  73. package/dist/analysis/analyze_trade_heatmap.d.ts.map +1 -0
  74. package/dist/analysis/analyze_trade_heatmap.js +358 -0
  75. package/dist/analysis/analyze_trade_heatmap.js.map +1 -0
  76. package/dist/analysis/analyze_volatility.d.ts +22 -0
  77. package/dist/analysis/analyze_volatility.d.ts.map +1 -0
  78. package/dist/analysis/analyze_volatility.js +165 -0
  79. package/dist/analysis/analyze_volatility.js.map +1 -0
  80. package/dist/analysis/bot_fitting/backtest_ama_sweep.d.ts +91 -0
  81. package/dist/analysis/bot_fitting/backtest_ama_sweep.d.ts.map +1 -0
  82. package/dist/analysis/bot_fitting/backtest_ama_sweep.js +792 -0
  83. package/dist/analysis/bot_fitting/backtest_ama_sweep.js.map +1 -0
  84. package/dist/analysis/bot_fitting/backtest_bot_fitting.d.ts +2 -0
  85. package/dist/analysis/bot_fitting/backtest_bot_fitting.d.ts.map +1 -0
  86. package/dist/analysis/bot_fitting/backtest_bot_fitting.js +380 -0
  87. package/dist/analysis/bot_fitting/backtest_bot_fitting.js.map +1 -0
  88. package/dist/analysis/bot_fitting/shared_utils.d.ts +26 -0
  89. package/dist/analysis/bot_fitting/shared_utils.d.ts.map +1 -0
  90. package/dist/analysis/bot_fitting/shared_utils.js +42 -0
  91. package/dist/analysis/bot_fitting/shared_utils.js.map +1 -0
  92. package/dist/analysis/bot_key_utils.d.ts +11 -0
  93. package/dist/analysis/bot_key_utils.d.ts.map +1 -0
  94. package/dist/analysis/bot_key_utils.js +153 -0
  95. package/dist/analysis/bot_key_utils.js.map +1 -0
  96. package/dist/analysis/bot_usage/discover_bot_accounts.d.ts +3 -0
  97. package/dist/analysis/bot_usage/discover_bot_accounts.d.ts.map +1 -0
  98. package/dist/analysis/bot_usage/discover_bot_accounts.js +499 -0
  99. package/dist/analysis/bot_usage/discover_bot_accounts.js.map +1 -0
  100. package/dist/analysis/bot_usage/kibana_bot_queries.d.ts +531 -0
  101. package/dist/analysis/bot_usage/kibana_bot_queries.d.ts.map +1 -0
  102. package/dist/analysis/bot_usage/kibana_bot_queries.js +399 -0
  103. package/dist/analysis/bot_usage/kibana_bot_queries.js.map +1 -0
  104. package/dist/analysis/chart_css.d.ts +17 -0
  105. package/dist/analysis/chart_css.d.ts.map +1 -0
  106. package/dist/analysis/chart_css.js +49 -0
  107. package/dist/analysis/chart_css.js.map +1 -0
  108. package/dist/analysis/chart_ui.d.ts +45 -0
  109. package/dist/analysis/chart_ui.d.ts.map +1 -0
  110. package/dist/analysis/chart_ui.js +97 -0
  111. package/dist/analysis/chart_ui.js.map +1 -0
  112. package/dist/analysis/chart_utils.d.ts +27 -0
  113. package/dist/analysis/chart_utils.d.ts.map +1 -0
  114. package/dist/analysis/chart_utils.js +153 -0
  115. package/dist/analysis/chart_utils.js.map +1 -0
  116. package/dist/analysis/derivative_chart_generator.d.ts +12 -0
  117. package/dist/analysis/derivative_chart_generator.d.ts.map +1 -0
  118. package/dist/analysis/derivative_chart_generator.js +891 -0
  119. package/dist/analysis/derivative_chart_generator.js.map +1 -0
  120. package/dist/analysis/math_utils.d.ts +22 -0
  121. package/dist/analysis/math_utils.d.ts.map +1 -0
  122. package/dist/analysis/math_utils.js +43 -0
  123. package/dist/analysis/math_utils.js.map +1 -0
  124. package/dist/analysis/price_sources.d.ts +40 -0
  125. package/dist/analysis/price_sources.d.ts.map +1 -0
  126. package/dist/analysis/price_sources.js +94 -0
  127. package/dist/analysis/price_sources.js.map +1 -0
  128. package/dist/analysis/resolve_source.d.ts +25 -0
  129. package/dist/analysis/resolve_source.d.ts.map +1 -0
  130. package/dist/analysis/resolve_source.js +69 -0
  131. package/dist/analysis/resolve_source.js.map +1 -0
  132. package/dist/analysis/trade_profitability.d.ts +115 -0
  133. package/dist/analysis/trade_profitability.d.ts.map +1 -0
  134. package/dist/analysis/trade_profitability.js +1240 -0
  135. package/dist/analysis/trade_profitability.js.map +1 -0
  136. package/dist/analysis/tradingview/analyze_tradingview.d.ts +31 -0
  137. package/dist/analysis/tradingview/analyze_tradingview.d.ts.map +1 -0
  138. package/dist/analysis/tradingview/analyze_tradingview.js +146 -0
  139. package/dist/analysis/tradingview/analyze_tradingview.js.map +1 -0
  140. package/dist/analysis/tradingview/tradingview_uplot_chart_generator.d.ts +5 -0
  141. package/dist/analysis/tradingview/tradingview_uplot_chart_generator.d.ts.map +1 -0
  142. package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js +1714 -0
  143. package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js.map +1 -0
  144. package/dist/analysis/trend_detection/derivative_analyzer.d.ts +247 -0
  145. package/dist/analysis/trend_detection/derivative_analyzer.d.ts.map +1 -0
  146. package/dist/analysis/trend_detection/derivative_analyzer.js +901 -0
  147. package/dist/analysis/trend_detection/derivative_analyzer.js.map +1 -0
  148. package/dist/analysis/trend_detection/dynamic_weight_chart_generator.d.ts +3 -0
  149. package/dist/analysis/trend_detection/dynamic_weight_chart_generator.d.ts.map +1 -0
  150. package/dist/analysis/trend_detection/dynamic_weight_chart_generator.js +1361 -0
  151. package/dist/analysis/trend_detection/dynamic_weight_chart_generator.js.map +1 -0
  152. package/dist/analysis/trend_detection/hurst_analyzer.d.ts +6 -0
  153. package/dist/analysis/trend_detection/hurst_analyzer.d.ts.map +1 -0
  154. package/dist/analysis/trend_detection/hurst_analyzer.js +7 -0
  155. package/dist/analysis/trend_detection/hurst_analyzer.js.map +1 -0
  156. package/dist/analysis/trend_detection/kalman_chart_generator.d.ts +3 -0
  157. package/dist/analysis/trend_detection/kalman_chart_generator.d.ts.map +1 -0
  158. package/dist/analysis/trend_detection/kalman_chart_generator.js +360 -0
  159. package/dist/analysis/trend_detection/kalman_chart_generator.js.map +1 -0
  160. package/dist/analysis/trend_detection/kalman_trend_analyzer.d.ts +8 -0
  161. package/dist/analysis/trend_detection/kalman_trend_analyzer.d.ts.map +1 -0
  162. package/dist/analysis/trend_detection/kalman_trend_analyzer.js +8 -0
  163. package/dist/analysis/trend_detection/kalman_trend_analyzer.js.map +1 -0
  164. package/dist/analysis/trend_detection/kalman_velocity_smoothing.d.ts +6 -0
  165. package/dist/analysis/trend_detection/kalman_velocity_smoothing.d.ts.map +1 -0
  166. package/dist/analysis/trend_detection/kalman_velocity_smoothing.js +7 -0
  167. package/dist/analysis/trend_detection/kalman_velocity_smoothing.js.map +1 -0
  168. package/dist/analysis/trend_detection/permutation_entropy_analyzer.d.ts +6 -0
  169. package/dist/analysis/trend_detection/permutation_entropy_analyzer.d.ts.map +1 -0
  170. package/dist/analysis/trend_detection/permutation_entropy_analyzer.js +7 -0
  171. package/dist/analysis/trend_detection/permutation_entropy_analyzer.js.map +1 -0
  172. package/dist/analysis/trend_detection/regime_chart_generator.d.ts +3 -0
  173. package/dist/analysis/trend_detection/regime_chart_generator.d.ts.map +1 -0
  174. package/dist/analysis/trend_detection/regime_chart_generator.js +310 -0
  175. package/dist/analysis/trend_detection/regime_chart_generator.js.map +1 -0
  176. package/dist/analysis/trend_detection/tests/test_kalman_trend.d.ts +2 -0
  177. package/dist/analysis/trend_detection/tests/test_kalman_trend.d.ts.map +1 -0
  178. package/dist/analysis/trend_detection/tests/test_kalman_trend.js +128 -0
  179. package/dist/analysis/trend_detection/tests/test_kalman_trend.js.map +1 -0
  180. package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.d.ts +2 -0
  181. package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.d.ts.map +1 -0
  182. package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.js +37 -0
  183. package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.js.map +1 -0
  184. package/dist/analysis/trend_detection/volatility_chart_generator.d.ts +3 -0
  185. package/dist/analysis/trend_detection/volatility_chart_generator.d.ts.map +1 -0
  186. package/dist/analysis/trend_detection/volatility_chart_generator.js +646 -0
  187. package/dist/analysis/trend_detection/volatility_chart_generator.js.map +1 -0
  188. package/dist/bot.js +1 -1
  189. package/dist/bot.js.map +1 -1
  190. package/dist/market_adapter/ama_signal_runner.js +1 -1
  191. package/dist/market_adapter/ama_signal_runner.js.map +1 -1
  192. package/dist/market_adapter/inputs/fetch_cex_synthetic_data.js +1 -1
  193. package/dist/scripts/generate_lp_chart.js +1 -1
  194. package/dist/scripts/test-credit-renewal.js +1 -1
  195. package/docs/DEXBOT_COMPARISON.md +3 -3
  196. package/docs/EVOLUTION.md +5 -4
  197. package/docs/FUND_MOVEMENT_AND_ACCOUNTING.md +1 -1
  198. package/docs/GRID_RECALCULATION.md +2 -2
  199. package/docs/README.md +1 -1
  200. package/market_adapter/README.md +23 -23
  201. package/package.json +17 -21
  202. package/scripts/README.md +12 -12
  203. package/scripts/bots +5 -7
  204. package/scripts/clear-market-adapter.sh +1 -1
  205. package/scripts/dexbot +5 -7
  206. package/scripts/keys +5 -7
  207. package/scripts/pm2 +5 -7
  208. package/scripts/unlock +5 -7
  209. package/scripts/update.js +6 -7
package/claw/README.md CHANGED
@@ -31,8 +31,8 @@ Integration layer for BitShares blockchain operations from DEXBot2 and supported
31
31
  | Track persistent short positions | [Position Manager](#position-manager) | `npm run example:position-manager` |
32
32
  | Choose a runtime (OpenClaw, Hermes, NanoBot, etc.) | [Multi-Runtime Support](#multi-runtime-support) | — |
33
33
  | Generate skill files for a runtime | [Multi-Runtime Support](#multi-runtime-support) | `npm run <runtime>:skill` |
34
- | Preview or apply bot setting changes | [Bot Settings](#bot-settings) | `tsx scripts/claw_bridge.ts bot-settings-preview` |
35
- | Inspect an on-chain MPA position | [Position Health](#position-health) | `tsx scripts/claw_bridge.ts mpa-position` |
34
+ | Preview or apply bot setting changes | [Bot Settings](#bot-settings) | `npm run claw:bridge -- bot-settings-preview` |
35
+ | Inspect an on-chain MPA position | [Position Health](#position-health) | `npm run claw:bridge -- mpa-position` |
36
36
  | List HONEST asset pricing | [HONEST Asset Report](#honest-asset-report) | `npm run report:honest-assets` |
37
37
 
38
38
  ## Install
@@ -140,7 +140,7 @@ npm run report:honest-assets
140
140
  JSON output:
141
141
 
142
142
  ```bash
143
- tsx scripts/honest_assets_report.ts --json
143
+ node ../dist/claw/scripts/honest_assets_report.js --json
144
144
  ```
145
145
 
146
146
  ## Signing And Broadcast
@@ -209,9 +209,9 @@ For a deeper comparison, see [docs/RUNTIME_COMPARISON.md](docs/RUNTIME_COMPARISO
209
209
  Use the runtime-neutral bridge command for JSON-friendly local integration:
210
210
 
211
211
  ```bash
212
- tsx scripts/claw_bridge.ts manifest
213
- tsx scripts/claw_bridge.ts profile-context --payload '{"botRef":"default"}'
214
- tsx scripts/claw_bridge.ts market-snapshot --payload '{"baseSymbol":"BTS","quoteSymbol":"USD"}'
212
+ npm run claw:bridge -- manifest
213
+ npm run claw:bridge -- profile-context --payload '{"botRef":"default"}'
214
+ npm run claw:bridge -- market-snapshot --payload '{"baseSymbol":"BTS","quoteSymbol":"USD"}'
215
215
  ```
216
216
 
217
217
  ### Bot Settings
@@ -219,9 +219,9 @@ tsx scripts/claw_bridge.ts market-snapshot --payload '{"baseSymbol":"BTS","quote
219
219
  Use the bridge to read, preview, and apply DEXBot2 bot settings through the locked profile adapter:
220
220
 
221
221
  ```bash
222
- tsx scripts/claw_bridge.ts bot-settings --payload '{"botRef":"default"}'
223
- tsx scripts/claw_bridge.ts bot-settings-preview --payload '{"botRef":"default","patch":{"incrementPercent":0.4,"weightDistribution":{"sell":0.7,"buy":0.4}}}'
224
- tsx scripts/claw_bridge.ts bot-settings-apply --payload '{"botRef":"default","patch":{"incrementPercent":0.4,"weightDistribution":{"sell":0.7,"buy":0.4}}}'
222
+ npm run claw:bridge -- bot-settings --payload '{"botRef":"default"}'
223
+ npm run claw:bridge -- bot-settings-preview --payload '{"botRef":"default","patch":{"incrementPercent":0.4,"weightDistribution":{"sell":0.7,"buy":0.4}}}'
224
+ npm run claw:bridge -- bot-settings-apply --payload '{"botRef":"default","patch":{"incrementPercent":0.4,"weightDistribution":{"sell":0.7,"buy":0.4}}}'
225
225
  ```
226
226
 
227
227
  Settings writes are serialized through the profile lock and the recalc trigger is written atomically, so concurrent bot-setting updates do not clobber each other.
@@ -273,10 +273,10 @@ OpenFang uses the same shared bridge surface through a local CLI wrapper.
273
273
  <details><summary>Compatibility command surface (click to expand)</summary>
274
274
 
275
275
  ```bash
276
- tsx scripts/claw_bridge.ts --runtime openfang manifest
277
- tsx scripts/claw_bridge.ts --runtime openfang profile-context --payload '{"botRef":"default"}'
278
- tsx scripts/claw_bridge.ts --runtime openfang market-snapshot --payload '{"baseSymbol":"BTS","quoteSymbol":"USD"}'
279
- tsx scripts/claw_bridge.ts --runtime openfang create-limit-order --payload '{"accountName":"your-account","sellAsset":"BTS","receiveAsset":"USD","amountToSell":10,"minToReceive":2}'
276
+ npm run openfang:bridge -- manifest
277
+ npm run openfang:bridge -- profile-context --payload '{"botRef":"default"}'
278
+ npm run openfang:bridge -- market-snapshot --payload '{"baseSymbol":"BTS","quoteSymbol":"USD"}'
279
+ npm run openfang:bridge -- create-limit-order --payload '{"accountName":"your-account","sellAsset":"BTS","receiveAsset":"USD","amountToSell":10,"minToReceive":2}'
280
280
  ```
281
281
 
282
282
  </details>
@@ -296,8 +296,8 @@ Add the shared Claw MCP server to `~/.hermes/config.yaml`:
296
296
  ```yaml
297
297
  mcp_servers:
298
298
  claw:
299
- command: "tsx"
300
- args: ["/absolute/path/to/claw/scripts/claw_mcp_server.ts", "--profile-root", "/absolute/path/to/DEXBot2"]
299
+ command: "node"
300
+ args: ["/absolute/path/to/DEXBot2/dist/claw/scripts/claw_mcp_server.js", "--profile-root", "/absolute/path/to/DEXBot2"]
301
301
  ```
302
302
 
303
303
  Hermes should use the shared MCP server for live tools and keep the generated `SKILL.md` focused on workflow guidance. The Claw MCP server registers raw tool ids such as `claw_manifest`; if Hermes shows a namespaced label in its UI, use the label shown there.
@@ -309,7 +309,7 @@ Run the MCP server over stdio:
309
309
  ```bash
310
310
  CLAW_ROOT="$(pwd)"
311
311
  DEXBOT_ROOT="$(cd .. && pwd)"
312
- tsx scripts/claw_mcp_server.ts --profile-root "$DEXBOT_ROOT"
312
+ node ../dist/claw/scripts/claw_mcp_server.js --profile-root "$DEXBOT_ROOT"
313
313
  ```
314
314
 
315
315
  The stdio transport uses newline-delimited JSON-RPC messages on `stdin` and `stdout`.
@@ -340,10 +340,10 @@ NanoClaw already ships its own `claw` skill, so keep this bridge skill named `bi
340
340
  <details><summary>Compatibility command surface (click to expand)</summary>
341
341
 
342
342
  ```bash
343
- tsx scripts/claw_bridge.ts --runtime nanoclaw manifest
344
- tsx scripts/claw_bridge.ts --runtime nanoclaw profile-context --payload '{"botRef":"default"}'
345
- tsx scripts/claw_bridge.ts --runtime nanoclaw market-snapshot --payload '{"baseSymbol":"BTS","quoteSymbol":"USD"}'
346
- tsx scripts/claw_bridge.ts --runtime nanoclaw create-limit-order --payload '{"accountName":"your-account","sellAsset":"BTS","receiveAsset":"USD","amountToSell":10,"minToReceive":2}'
343
+ npm run nanoclaw:bridge -- manifest
344
+ npm run nanoclaw:bridge -- profile-context --payload '{"botRef":"default"}'
345
+ npm run nanoclaw:bridge -- market-snapshot --payload '{"baseSymbol":"BTS","quoteSymbol":"USD"}'
346
+ npm run nanoclaw:bridge -- create-limit-order --payload '{"accountName":"your-account","sellAsset":"BTS","receiveAsset":"USD","amountToSell":10,"minToReceive":2}'
347
347
  ```
348
348
 
349
349
  </details>
@@ -361,13 +361,13 @@ npm run zeroclaw:skill -- --repo-root "$CLAW_ROOT" --profile-root "$DEXBOT_ROOT"
361
361
  <details><summary>Compatibility command surface (click to expand)</summary>
362
362
 
363
363
  ```bash
364
- tsx scripts/claw_bridge.ts --runtime zeroclaw manifest
365
- tsx scripts/claw_bridge.ts --runtime zeroclaw profile-context --payload '{"botRef":"default"}'
366
- tsx scripts/claw_bridge.ts --runtime zeroclaw market-snapshot --payload '{"baseSymbol":"BTS","quoteSymbol":"USD"}'
367
- tsx scripts/claw_bridge.ts --runtime zeroclaw create-limit-order --payload '{"accountName":"your-account","sellAsset":"BTS","receiveAsset":"USD","amountToSell":10,"minToReceive":2}'
368
- tsx scripts/claw_bridge.ts --runtime zeroclaw update-limit-order --payload '{"accountName":"your-account","orderId":"1.7.123","newParams":{"amountToSell":10,"minToReceive":2}}'
369
- tsx scripts/claw_bridge.ts --runtime zeroclaw execute-batch --payload '{"accountName":"your-account","operations":[]}'
370
- tsx scripts/claw_bridge.ts --runtime zeroclaw borrow-mpa --payload '{"accountName":"your-account","mpaAsset":"HONEST.USD","debtDelta":10,"collateralDelta":25000}'
364
+ npm run zeroclaw:bridge -- manifest
365
+ npm run zeroclaw:bridge -- profile-context --payload '{"botRef":"default"}'
366
+ npm run zeroclaw:bridge -- market-snapshot --payload '{"baseSymbol":"BTS","quoteSymbol":"USD"}'
367
+ npm run zeroclaw:bridge -- create-limit-order --payload '{"accountName":"your-account","sellAsset":"BTS","receiveAsset":"USD","amountToSell":10,"minToReceive":2}'
368
+ npm run zeroclaw:bridge -- update-limit-order --payload '{"accountName":"your-account","orderId":"1.7.123","newParams":{"amountToSell":10,"minToReceive":2}}'
369
+ npm run zeroclaw:bridge -- execute-batch --payload '{"accountName":"your-account","operations":[]}'
370
+ npm run zeroclaw:bridge -- borrow-mpa --payload '{"accountName":"your-account","mpaAsset":"HONEST.USD","debtDelta":10,"collateralDelta":25000}'
371
371
  ```
372
372
 
373
373
  </details>
@@ -385,13 +385,13 @@ npm run nullclaw:skill -- --repo-root "$CLAW_ROOT" --profile-root "$DEXBOT_ROOT"
385
385
  <details><summary>Compatibility command surface (click to expand)</summary>
386
386
 
387
387
  ```bash
388
- tsx scripts/claw_bridge.ts --runtime nullclaw manifest
389
- tsx scripts/claw_bridge.ts --runtime nullclaw profile-context --payload '{"botRef":"default"}'
390
- tsx scripts/claw_bridge.ts --runtime nullclaw market-snapshot --payload '{"baseSymbol":"BTS","quoteSymbol":"USD"}'
391
- tsx scripts/claw_bridge.ts --runtime nullclaw create-limit-order --payload '{"accountName":"your-account","sellAsset":"BTS","receiveAsset":"USD","amountToSell":10,"minToReceive":2}'
392
- tsx scripts/claw_bridge.ts --runtime nullclaw update-limit-order --payload '{"accountName":"your-account","orderId":"1.7.123","newParams":{"amountToSell":10,"minToReceive":2}}'
393
- tsx scripts/claw_bridge.ts --runtime nullclaw execute-batch --payload '{"accountName":"your-account","operations":[]}'
394
- tsx scripts/claw_bridge.ts --runtime nullclaw borrow-mpa --payload '{"accountName":"your-account","mpaAsset":"HONEST.USD","debtDelta":10,"collateralDelta":25000}'
388
+ npm run nullclaw:bridge -- manifest
389
+ npm run nullclaw:bridge -- profile-context --payload '{"botRef":"default"}'
390
+ npm run nullclaw:bridge -- market-snapshot --payload '{"baseSymbol":"BTS","quoteSymbol":"USD"}'
391
+ npm run nullclaw:bridge -- create-limit-order --payload '{"accountName":"your-account","sellAsset":"BTS","receiveAsset":"USD","amountToSell":10,"minToReceive":2}'
392
+ npm run nullclaw:bridge -- update-limit-order --payload '{"accountName":"your-account","orderId":"1.7.123","newParams":{"amountToSell":10,"minToReceive":2}}'
393
+ npm run nullclaw:bridge -- execute-batch --payload '{"accountName":"your-account","operations":[]}'
394
+ npm run nullclaw:bridge -- borrow-mpa --payload '{"accountName":"your-account","mpaAsset":"HONEST.USD","debtDelta":10,"collateralDelta":25000}'
395
395
  ```
396
396
 
397
397
  </details>
@@ -412,7 +412,7 @@ Start the memU MCP server:
412
412
  ```bash
413
413
  npm run memu:mcp
414
414
  # or
415
- tsx scripts/memu_mcp_server.ts --memu-dir /path/to/claw/data/memu
415
+ node ../dist/claw/scripts/memu_mcp_server.js --memu-dir /path/to/claw/data/memu
416
416
  ```
417
417
 
418
418
  `--memu-dir` is optional; it defaults to the resolved memU data directory
@@ -430,18 +430,18 @@ memU MCP server configuration for Hermes:
430
430
  ```yaml
431
431
  mcp_servers:
432
432
  memu:
433
- command: "tsx"
434
- args: ["/absolute/path/to/claw/scripts/memu_mcp_server.ts", "--memu-dir", "/absolute/path/to/claw/data/memu"]
433
+ command: "node"
434
+ args: ["/absolute/path/to/DEXBot2/dist/claw/scripts/memu_mcp_server.js", "--memu-dir", "/absolute/path/to/claw/data/memu"]
435
435
  ```
436
436
 
437
437
  <details><summary>Compatibility command surface (click to expand)</summary>
438
438
 
439
439
  ```bash
440
440
  # Via claw bridge
441
- tsx scripts/claw_bridge.ts memu-manifest
442
- tsx scripts/claw_bridge.ts memu-memorize --payload '{"resourceUrl":"/path/to/conv.txt","modality":"conversation"}'
443
- tsx scripts/claw_bridge.ts memu-retrieve --payload '{"queries":[{"role":"user","content":{"text":"What are my trading preferences?"}}]}'
444
- tsx scripts/claw_bridge.ts memu-status
441
+ npm run claw:bridge -- memu-manifest
442
+ npm run claw:bridge -- memu-memorize --payload '{"resourceUrl":"/path/to/conv.txt","modality":"conversation"}'
443
+ npm run claw:bridge -- memu-retrieve --payload '{"queries":[{"role":"user","content":{"text":"What are my trading preferences?"}}]}'
444
+ npm run claw:bridge -- memu-status
445
445
 
446
446
  # Via npm scripts
447
447
  npm run memu:status
@@ -475,7 +475,7 @@ The position health subsystem discovers on-chain debt positions, classifies coll
475
475
  Inspect one on-chain MPA position:
476
476
 
477
477
  ```bash
478
- tsx scripts/claw_bridge.ts mpa-position --payload '{"accountName":"your-account","mpaAsset":"HONEST.USD"}'
478
+ npm run claw:bridge -- mpa-position --payload '{"accountName":"your-account","mpaAsset":"HONEST.USD"}'
479
479
  ```
480
480
 
481
481
  The decision loop (`modules/decision_loop.ts`) is exposed as a module API. Its `evaluate()` call ties discovery, trend analysis, and health assessment into a single result with prioritized actions.
@@ -487,19 +487,19 @@ Read, preview, and apply DEXBot2 bot settings through the locked profile adapter
487
487
  Inspect the default policy:
488
488
 
489
489
  ```bash
490
- tsx scripts/claw_bridge.ts bot-settings --payload '{"botRef":"default"}'
490
+ npm run claw:bridge -- bot-settings --payload '{"botRef":"default"}'
491
491
  ```
492
492
 
493
493
  Preview an update without applying:
494
494
 
495
495
  ```bash
496
- tsx scripts/claw_bridge.ts bot-settings-preview --payload '{"botRef":"default","patch":{"weightDistribution":{"sell":0.7,"buy":0.4}}}'
496
+ npm run claw:bridge -- bot-settings-preview --payload '{"botRef":"default","patch":{"weightDistribution":{"sell":0.7,"buy":0.4}}}'
497
497
  ```
498
498
 
499
499
  Apply the update and write the recalc trigger:
500
500
 
501
501
  ```bash
502
- tsx scripts/claw_bridge.ts bot-settings-apply --payload '{"botRef":"default","patch":{"weightDistribution":{"sell":0.7,"buy":0.4}}}'
502
+ npm run claw:bridge -- bot-settings-apply --payload '{"botRef":"default","patch":{"weightDistribution":{"sell":0.7,"buy":0.4}}}'
503
503
  ```
504
504
 
505
505
  ## High-Level Actions
@@ -86,7 +86,7 @@ The Claw bridge supports the runtimes below. Each runtime shares the DEXBot2 cre
86
86
 
87
87
  ZeroClaw should use Claw as a compatibility layer, not as a second signing or credential system.
88
88
 
89
- - ZeroClaw can invoke the JSON/CLI bridge via `tsx scripts/claw_bridge.ts --runtime zeroclaw`.
89
+ - ZeroClaw can invoke the JSON/CLI bridge via `npm run zeroclaw:bridge`.
90
90
  - The manifest lives in [../modules/claw_manifest.ts](../modules/claw_manifest.ts) and is safe to query without starting the BitShares runtime.
91
91
  - Claw keeps private-key access inside its existing DEXBot2 credential path.
92
92
  - ZeroClaw gets read access to market, profile, HONEST, and order context, plus explicit action entrypoints when it needs to request a trade operation.
@@ -102,7 +102,7 @@ The bridge surface currently includes:
102
102
  - BTS-backed short open, take-profit, close, and plan builders
103
103
  - MPA position lookup
104
104
 
105
- Launcher behavior such as `tsx unlock --claw-only` and `tsx pm2 claw-only` is documented and maintained separately under `skills/launcher-ops/`.
105
+ Launcher behavior such as `npm run claw:unlock` and `npm run pm2:claw-only` is documented and maintained separately under `skills/launcher-ops/`.
106
106
 
107
107
  Recommended trust boundary:
108
108
 
@@ -122,7 +122,7 @@ cd claw && npm run zeroclaw:skill -- --profile-root /path/to/DEXBot2 --output ~/
122
122
 
123
123
  NullClaw uses the same bridge surface, with a native skill path centered on `SKILL.toml` in the workspace.
124
124
 
125
- - NullClaw can invoke the JSON/CLI bridge via `tsx scripts/claw_bridge.ts --runtime nullclaw`.
125
+ - NullClaw can invoke the JSON/CLI bridge via `npm run nullclaw:bridge`.
126
126
  - The manifest lives in [../modules/claw_manifest.ts](../modules/claw_manifest.ts) and is safe to query without starting the BitShares runtime.
127
127
  - Claw keeps private-key access inside its existing DEXBot2 credential path.
128
128
  - NullClaw gets the same read access to market, profile, HONEST, and order context, plus explicit action entrypoints when it needs to request a trade operation.
@@ -137,7 +137,7 @@ cd claw && npm run nullclaw:skill -- --profile-root /path/to/DEXBot2 --output ~/
137
137
 
138
138
  NanoClaw uses the same bridge surface, with a native `SKILL.md` path in the workspace skill tree.
139
139
 
140
- - NanoClaw can invoke the JSON/CLI bridge via `tsx scripts/claw_bridge.ts --runtime nanoclaw`.
140
+ - NanoClaw can invoke the JSON/CLI bridge via `npm run nanoclaw:bridge`.
141
141
  - The bridge lives in [../modules/claw_bridge.ts](../modules/claw_bridge.ts) and uses the shared Claw command surface.
142
142
  - Keep the generated skill named `bitshares-claw` so it does not collide with NanoClaw's bundled `claw` skill.
143
143
 
@@ -151,7 +151,7 @@ cd claw && npm run nanoclaw:skill -- --profile-root /path/to/DEXBot2 --output /p
151
151
 
152
152
  OpenFang uses the same bridge surface through a CLI-first wrapper and a workspace skill file.
153
153
 
154
- - OpenFang can invoke the JSON/CLI bridge via `tsx scripts/claw_bridge.ts --runtime openfang`.
154
+ - OpenFang can invoke the JSON/CLI bridge via `npm run openfang:bridge`.
155
155
  - The bridge lives in [../modules/claw_bridge.ts](../modules/claw_bridge.ts) and uses the shared Claw command surface.
156
156
  - Keep the generated skill named `bitshares-claw` so it stays separate from runtime-specific OpenFang skills and remains a thin wrapper around the shared CLI bridge.
157
157
 
@@ -185,7 +185,7 @@ mcp_servers:
185
185
  args: ["/absolute/path/to/claw/scripts/claw_mcp_server.js", "--profile-root", "/path/to/DEXBot2"]
186
186
  ```
187
187
 
188
- > In development you may substitute `tsx` + `claw_mcp_server.ts`; the generated skill file emits the `node` + `.js` form so it works against the compiled build (`npm run build`) without `tsx` installed.
188
+ > The generated skill file emits the `node` + `.js` form so it works against the compiled build (`npm run build`) without `tsx` installed.
189
189
 
190
190
  ### OpenClaw Compatibility
191
191
 
@@ -66,9 +66,9 @@ function parseArgs(argv: string[]): Record<string, any> {
66
66
 
67
67
  function printUsage() {
68
68
  console.log('Usage examples:');
69
- console.log(' tsx examples/short_mpa_bts_strategy.ts --mode open --mpa HONEST.USD --debt 10 --collateral 25000 --sell-price 1000');
70
- console.log(' tsx examples/short_mpa_bts_strategy.ts --mode tp --mpa HONEST.USD --cover 10 --buy-price 900');
71
- console.log(' tsx examples/short_mpa_bts_strategy.ts --mode close --mpa HONEST.USD --repay 10 --release-collateral 25000');
69
+ console.log(' node ../dist/claw/examples/short_mpa_bts_strategy.js --mode open --mpa HONEST.USD --debt 10 --collateral 25000 --sell-price 1000');
70
+ console.log(' node ../dist/claw/examples/short_mpa_bts_strategy.js --mode tp --mpa HONEST.USD --cover 10 --buy-price 900');
71
+ console.log(' node ../dist/claw/examples/short_mpa_bts_strategy.js --mode close --mpa HONEST.USD --repay 10 --release-collateral 25000');
72
72
  console.log('Add --execute to broadcast transactions. Without it, the script prints the plan only.');
73
73
  }
74
74
 
package/claw/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dexbot2-claw",
3
- "version": "1.4.17",
3
+ "version": "1.4.18",
4
4
  "private": true,
5
5
  "description": "Claw bridge and runtime integration layer for BitShares and DEXBot2.",
6
6
  "type": "module",
@@ -28,30 +28,30 @@
28
28
  "example:memu-integration": "npm run build && node ../dist/claw/examples/memu_integration_example.js",
29
29
  "example:position-manager": "npm run build && node ../dist/claw/examples/position_manager_cli.js",
30
30
  "example:short-mpa-bts": "npm run build && node ../dist/claw/examples/short_mpa_bts_strategy.js",
31
- "claw:bridge": "npx tsx scripts/claw_bridge.ts",
32
- "claw:mcp": "npx tsx scripts/claw_mcp_server.ts",
33
- "claw:skill": "npx tsx scripts/claw_skill_md.ts",
34
- "openfang:bridge": "npx tsx scripts/claw_bridge.ts --runtime openfang",
35
- "openfang:skill": "npx tsx scripts/claw_skill_md.ts --runtime openfang",
36
- "nanobot:skill": "npx tsx scripts/claw_skill_md.ts --runtime nanobot",
37
- "nanoclaw:bridge": "npx tsx scripts/claw_bridge.ts --runtime nanoclaw",
38
- "nanoclaw:skill": "npx tsx scripts/claw_skill_md.ts --runtime nanoclaw",
39
- "picoclaw:skill": "npx tsx scripts/claw_skill_md.ts --runtime picoclaw",
40
- "openclaw:skill": "npx tsx scripts/claw_skill_md.ts --runtime openclaw",
41
- "nullclaw:bridge": "npx tsx scripts/claw_bridge.ts --runtime nullclaw",
42
- "nullclaw:skill": "npx tsx scripts/claw_skill_md.ts --runtime nullclaw",
43
- "zeroclaw:bridge": "npx tsx scripts/claw_bridge.ts --runtime zeroclaw",
44
- "zeroclaw:skill": "npx tsx scripts/claw_skill_md.ts --runtime zeroclaw",
45
- "hermes:bridge": "npx tsx scripts/claw_bridge.ts --runtime hermes",
46
- "hermes:skill": "npx tsx scripts/claw_skill_md.ts --runtime hermes",
47
- "memu:bridge": "npx tsx scripts/memu_mcp_server.ts",
48
- "memu:mcp": "npx tsx scripts/memu_mcp_server.ts",
49
- "memu:skill": "npx tsx scripts/claw_skill_md.ts --runtime memu",
31
+ "claw:bridge": "npm run build && node ../dist/claw/scripts/claw_bridge.js",
32
+ "claw:mcp": "npm run build && node ../dist/claw/scripts/claw_mcp_server.js",
33
+ "claw:skill": "npm run build && node ../dist/claw/scripts/claw_skill_md.js",
34
+ "openfang:bridge": "npm run build && node ../dist/claw/scripts/claw_bridge.js --runtime openfang",
35
+ "openfang:skill": "npm run build && node ../dist/claw/scripts/claw_skill_md.js --runtime openfang",
36
+ "nanobot:skill": "npm run build && node ../dist/claw/scripts/claw_skill_md.js --runtime nanobot",
37
+ "nanoclaw:bridge": "npm run build && node ../dist/claw/scripts/claw_bridge.js --runtime nanoclaw",
38
+ "nanoclaw:skill": "npm run build && node ../dist/claw/scripts/claw_skill_md.js --runtime nanoclaw",
39
+ "picoclaw:skill": "npm run build && node ../dist/claw/scripts/claw_skill_md.js --runtime picoclaw",
40
+ "openclaw:skill": "npm run build && node ../dist/claw/scripts/claw_skill_md.js --runtime openclaw",
41
+ "nullclaw:bridge": "npm run build && node ../dist/claw/scripts/claw_bridge.js --runtime nullclaw",
42
+ "nullclaw:skill": "npm run build && node ../dist/claw/scripts/claw_skill_md.js --runtime nullclaw",
43
+ "zeroclaw:bridge": "npm run build && node ../dist/claw/scripts/claw_bridge.js --runtime zeroclaw",
44
+ "zeroclaw:skill": "npm run build && node ../dist/claw/scripts/claw_skill_md.js --runtime zeroclaw",
45
+ "hermes:bridge": "npm run build && node ../dist/claw/scripts/claw_bridge.js --runtime hermes",
46
+ "hermes:skill": "npm run build && node ../dist/claw/scripts/claw_skill_md.js --runtime hermes",
47
+ "memu:bridge": "npm run build && node ../dist/claw/scripts/memu_mcp_server.js",
48
+ "memu:mcp": "npm run build && node ../dist/claw/scripts/memu_mcp_server.js",
49
+ "memu:skill": "npm run build && node ../dist/claw/scripts/claw_skill_md.js --runtime memu",
50
50
  "memu:status": "npm run build && node --input-type=module -e \"const {runMemuCommand}=await import('../dist/claw/modules/memu_bridge.js');runMemuCommand('status').then(r=>console.log(JSON.stringify(r,null,2))).catch(e=>console.error(e.message))\"",
51
51
  "service:position-watch": "npm run build && node ../dist/claw/modules/position_manager_watch.js",
52
52
  "pm2:start": "npm run build && pm2 start ecosystem.config.cjs",
53
53
  "pm2:stop": "pm2 stop ecosystem.config.cjs",
54
- "report:honest-assets": "npx tsx scripts/honest_assets_report.ts",
54
+ "report:honest-assets": "npm run build && node ../dist/claw/scripts/honest_assets_report.js",
55
55
  "test": "npm run build && npx tsx tests/test_claw_regressions.ts && npx tsx tests/test_claw_state_store.ts && npx tsx tests/test_dexbot_profiles.ts && npx tsx tests/test_position_manager_watch_health.ts && npx tsx tests/test_claw_bridge.ts && npx tsx tests/test_memu_bridge.ts && npx tsx tests/test_short_mpa_strategy.ts && npx tsx tests/test_position_health.ts && npx tsx tests/test_claw_chain_layer.ts && npx tsx tests/test_claw_domain_logic.ts && npx tsx tests/test_claw_catalog_and_credentials.ts && npx tsx tests/test_claw_data_flow.ts && npx tsx tests/test_position_manager.ts && npx tsx tests/test_claw_skill_generation.ts && npx tsx tests/test_claw_manifest_and_matrix.ts && npx tsx tests/test_claw_mcp_transport.ts && npx tsx tests/test_nullclaw_tmp_integration.ts",
56
56
  "check": "npm run build && node --input-type=module -e \"await import('../dist/claw/index.js')\" && node -c ecosystem.config.cjs && node -c ../dist/claw/runtimes/openclaw-plugin/index.js"
57
57
  }
@@ -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.4.17",
5
+ "version": "1.4.18",
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.4.17",
4
+ "version": "1.4.18",
5
5
  "type": "module",
6
6
  "main": "index.js"
7
7
  }
@@ -111,7 +111,7 @@ function parseArgs(argv: any) {
111
111
  return options;
112
112
  }
113
113
 
114
- function printHelp(scriptPath = 'tsx scripts/claw_bridge.ts') {
114
+ function printHelp(scriptPath = 'node dist/claw/scripts/claw_bridge.js') {
115
115
  const commandLines = listClawCommandNames().map((command: any) => ` ${command}`);
116
116
 
117
117
  console.log([
@@ -127,7 +127,7 @@ function describeScriptRuntimeManifest(runtimeName: any, payload = {}) {
127
127
  return describeRuntimeManifest(runtimeName ? { ...payload, runtimeName } : payload);
128
128
  }
129
129
 
130
- async function main(runtimeName = null, scriptPath = 'tsx scripts/claw_bridge.ts') {
130
+ async function main(runtimeName = null, scriptPath = 'node dist/claw/scripts/claw_bridge.js') {
131
131
  const { command, help, payload } = parseArgs(process.argv.slice(2));
132
132
 
133
133
  if (help || !command) {
@@ -55,7 +55,7 @@ function parseArgs(argv: any) {
55
55
  function printHelp() {
56
56
  console.log([
57
57
  'Usage:',
58
- ' tsx scripts/claw_skill_md.ts --runtime <openclaw|hermes|openfang|nanobot|picoclaw|nanoclaw|zeroclaw|nullclaw|memu> [--repo-root PATH] [--profile-root PATH] [--output PATH]',
58
+ ' node dist/claw/scripts/claw_skill_md.js --runtime <openclaw|hermes|openfang|nanobot|picoclaw|nanoclaw|zeroclaw|nullclaw|memu> [--repo-root PATH] [--profile-root PATH] [--output PATH]',
59
59
  '',
60
60
  'Outputs a SKILL.md file for the requested runtime.',
61
61
  'If --output is omitted, the markdown is written to stdout.'
@@ -4,11 +4,11 @@ Use this reference for DEXBot2 startup and PM2 orchestration work.
4
4
 
5
5
  ## Commands
6
6
 
7
- - `tsx unlock` - single-prompt local startup.
8
- - `tsx unlock --claw-only` - credential daemon only, no bot startup.
9
- - `tsx pm2` - PM2 startup for all active bots.
10
- - `tsx pm2 <bot-name>` - PM2 startup for one active bot.
11
- - `tsx pm2 claw-only` - PM2 credential daemon only.
7
+ - `npm run unlock` - single-prompt local startup.
8
+ - `npm run claw:unlock` - credential daemon only, no bot startup.
9
+ - `npm run pm2:unlock` - PM2 startup for all active bots.
10
+ - `npm run pm2:unlock -- <bot-name>` - PM2 startup for one active bot.
11
+ - `npm run pm2:claw-only` - PM2 credential daemon only.
12
12
 
13
13
  ## Rules
14
14
 
@@ -68,7 +68,7 @@ These use HONEST.BTC as collateral instead of BTS — different collateral dynam
68
68
  ## Live Discovery
69
69
 
70
70
  ```bash
71
- tsx scripts/honest_assets_report.ts --json
71
+ node ../dist/claw/scripts/honest_assets_report.js --json
72
72
  ```
73
73
 
74
74
  Filter by `type === 'MPA'` for margin-tradeable assets. The `honest_ecosystem.ts` module's `isMpa()` function checks for `bitasset_data_id`.
@@ -148,14 +148,14 @@ For Hermes:
148
148
  ```yaml
149
149
  mcp_servers:
150
150
  memu:
151
- command: "tsx"
152
- args: ["/path/to/claw/scripts/memu_mcp_server.ts", "--memu-dir", "/path/to/claw/data/memu"]
151
+ command: "node"
152
+ args: ["/path/to/DEXBot2/dist/claw/scripts/memu_mcp_server.js", "--memu-dir", "/path/to/claw/data/memu"]
153
153
  ```
154
154
 
155
155
  For NanoBot/PicoClaw:
156
156
 
157
157
  ```bash
158
- tsx scripts/memu_mcp_server.ts --memu-dir /path/to/claw/data/memu
158
+ node ../dist/claw/scripts/memu_mcp_server.js --memu-dir /path/to/claw/data/memu
159
159
  ```
160
160
 
161
161
  ## Proactive Memory Patterns
@@ -31,7 +31,7 @@ async function testParserAcceptsJsonlAcrossChunksAndSingleBuffer() {
31
31
  capabilities: {},
32
32
  clientInfo: {
33
33
  name: 'claw-mcp-transport-test',
34
- version: '1.4.17'
34
+ version: '1.4.18'
35
35
  },
36
36
  protocolVersion: '2024-11-05'
37
37
  }
@@ -182,7 +182,7 @@ async function testMainEntrypointHandlesRealProcessInitialize() {
182
182
  capabilities: {},
183
183
  clientInfo: {
184
184
  name: 'claw-mcp-transport-test',
185
- version: '1.4.17'
185
+ version: '1.4.18'
186
186
  },
187
187
  protocolVersion: '2024-11-05'
188
188
  }
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=analyze_ama_price_changes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyze_ama_price_changes.d.ts","sourceRoot":"","sources":["../../../analysis/ama_fitting/analyze_ama_price_changes.ts"],"names":[],"mappings":""}
@@ -0,0 +1,148 @@
1
+ #!/usr/bin/env node
2
+ import path from 'node:path';
3
+ import { calculateAMA } from '../../market_adapter/core/strategies/ama.js';
4
+ import { getStorage } from '../../modules/storage/index.js';
5
+ const { readJSON } = getStorage();
6
+ import { MARKET_ADAPTER } from '../../modules/constants.js';
7
+ 'use strict';
8
+ /**
9
+ * AMA REPOSITION FREQUENCY ANALYSIS
10
+ *
11
+ * Simulates AMA_DELTA_THRESHOLD_PERCENT grid-reposition logic for all four AMA
12
+ * series on LP candle data.
13
+ *
14
+ * Uses the production threshold from MARKET_ADAPTER.AMA_DELTA_THRESHOLD_PERCENT
15
+ * (modules/constants.ts).
16
+ *
17
+ * Usage:
18
+ * tsx analysis/ama_fitting/analyze_ama_price_changes.ts --data <path-to-lp-candles.json> --results <path-to-optimization-results.json>
19
+ */
20
+ const REPOS_THRESHOLD_PCT = MARKET_ADAPTER.AMA_DELTA_THRESHOLD_PERCENT;
21
+ /**
22
+ * Simulate AMA_DELTA_THRESHOLD_PERCENT reposition logic.
23
+ *
24
+ * Starting from the first post-warmup AMA value, track cumulative drift from
25
+ * the last reposition baseline. When drift ≥ threshold, a reposition fires:
26
+ * record step-count since previous reposition, reset baseline to current AMA.
27
+ */
28
+ function trackRepositions(amaValues, thresholdPct, warmup) {
29
+ let events = 0;
30
+ const steps = [];
31
+ let baseline = amaValues[warmup];
32
+ let stepCounter = 0;
33
+ for (let i = warmup + 1; i < amaValues.length; i++) {
34
+ const curr = amaValues[i];
35
+ if (baseline === 0)
36
+ continue;
37
+ stepCounter++;
38
+ const driftPct = Math.abs((curr - baseline) / baseline) * 100;
39
+ if (driftPct >= thresholdPct) {
40
+ events++;
41
+ steps.push(stepCounter);
42
+ baseline = curr;
43
+ stepCounter = 0;
44
+ }
45
+ }
46
+ const min = steps.length > 0 ? Math.min(...steps) : 0;
47
+ const max = steps.length > 0 ? Math.max(...steps) : 0;
48
+ const avg = steps.length > 0 ? steps.reduce((a, b) => a + b, 0) / steps.length : 0;
49
+ return { events, steps, min, max, avg };
50
+ }
51
+ // ── Load data ─────────────────────────────────────────────────────────────────
52
+ function loadData(filePath) {
53
+ const json = readJSON(filePath);
54
+ const candles = json.candles ?? json;
55
+ return {
56
+ candles: candles.map((c) => ({ timestamp: c[0], close: c[4] })),
57
+ meta: json.meta ?? null,
58
+ };
59
+ }
60
+ function loadAmaParams(resultsPath) {
61
+ const json = readJSON(resultsPath);
62
+ const amas = json.meta?.amas;
63
+ if (!amas)
64
+ throw new Error('No amas found in results file');
65
+ return [
66
+ { key: 'AMA1', label: amas.AMA1.label, er: amas.AMA1.er, fast: amas.AMA1.fast, slow: amas.AMA1.slow },
67
+ { key: 'AMA2', label: amas.AMA2.label, er: amas.AMA2.er, fast: amas.AMA2.fast, slow: amas.AMA2.slow },
68
+ { key: 'AMA3', label: amas.AMA3.label, er: amas.AMA3.er, fast: amas.AMA3.fast, slow: amas.AMA3.slow },
69
+ { key: 'AMA4', label: amas.AMA4.label, er: amas.AMA4.er, fast: amas.AMA4.fast, slow: amas.AMA4.slow },
70
+ ];
71
+ }
72
+ // ── Analysis ──────────────────────────────────────────────────────────────────
73
+ // ── Main ──────────────────────────────────────────────────────────────────────
74
+ function run() {
75
+ const dataArgIdx = process.argv.indexOf('--data');
76
+ const resultsArgIdx = process.argv.indexOf('--results');
77
+ if (dataArgIdx === -1) {
78
+ throw new Error('--data <path-to-lp-candles.json> is required');
79
+ }
80
+ if (resultsArgIdx === -1) {
81
+ throw new Error('--results <path-to-optimization-results.json> is required');
82
+ }
83
+ const dataFile = path.resolve(process.argv[dataArgIdx + 1]);
84
+ const resultsFile = path.resolve(process.argv[resultsArgIdx + 1]);
85
+ const { candles, meta } = loadData(dataFile);
86
+ const amaParams = loadAmaParams(resultsFile);
87
+ const closes = candles.map((c) => c.close);
88
+ const totalSteps = closes.length - 1; // candle-to-candle transitions
89
+ const label = meta?.pool
90
+ ? `LP Pool ${meta.pool}`
91
+ : path.basename(dataFile, '.json');
92
+ const interval = meta?.intervalSeconds
93
+ ? `${meta.intervalSeconds / 3600}h`
94
+ : '?h';
95
+ console.log('');
96
+ console.log('════════════════════════════════════════════════════════════════════════════════');
97
+ console.log(' AMA Reposition Frequency Analysis (AMA_DELTA_THRESHOLD_PERCENT simulation)');
98
+ console.log('════════════════════════════════════════════════════════════════════════════════');
99
+ console.log(` Dataset: ${label} (${interval} candles)`);
100
+ console.log(` Candles: ${candles.length} → ${totalSteps} steps total`);
101
+ console.log(` Threshold: ${REPOS_THRESHOLD_PCT}% (from MARKET_ADAPTER.AMA_DELTA_THRESHOLD_PERCENT)`);
102
+ console.log('');
103
+ console.log(' Logic: set baseline at warmup end, count steps until AMA drifts ≥ threshold,');
104
+ console.log(' record reposition + reset baseline. Repeat for full live window.');
105
+ console.log('');
106
+ const results = [];
107
+ for (const params of amaParams) {
108
+ const values = calculateAMA(closes, {
109
+ erPeriod: params.er,
110
+ fastPeriod: params.fast,
111
+ slowPeriod: params.slow,
112
+ });
113
+ const r = trackRepositions(values, REPOS_THRESHOLD_PCT, params.er);
114
+ const liveSteps = totalSteps - params.er;
115
+ const freq = liveSteps > 0 ? (r.events / liveSteps * 1000).toFixed(1) : '–';
116
+ const avg = r.events > 0 ? r.avg.toFixed(1) : '–';
117
+ const suffix = String(params.label).replace(/^AMA\d\s*/i, '').replace(/^[-:\s]+/, '').trim();
118
+ const rowLabel = `${params.key} ${suffix}`;
119
+ console.log(` ── ${rowLabel} (warmup: ${params.er} live: ${liveSteps} steps) ──`);
120
+ console.log(` ≥${REPOS_THRESHOLD_PCT}% repositions: ${r.events} avg steps: ${avg} min: ${r.events > 0 ? r.min : '–'} max: ${r.events > 0 ? r.max : '–'} freq: ${freq}/1k steps`);
121
+ console.log('');
122
+ results.push({
123
+ label: rowLabel,
124
+ events: r.events,
125
+ avg: r.avg,
126
+ freq: liveSteps > 0 ? r.events / liveSteps * 1000 : 0,
127
+ });
128
+ }
129
+ console.log(' Note: warmup candles excluded (AMA initializes from SMA of the ER window).');
130
+ console.log('');
131
+ // ── Ranking: fewest repositions ────────────────────────────────────────────
132
+ results.sort((a, b) => a.events - b.events);
133
+ console.log(' Ranking — fewest repositions (least grid changes):');
134
+ console.log('');
135
+ console.log(' ' + '#'.padEnd(4) + 'AMA'.padEnd(20) + 'repositions'.padStart(12) + 'avg steps'.padStart(10) + ' /1000 steps');
136
+ console.log(' ' + '─'.repeat(4 + 20 + 12 + 10 + 12));
137
+ results.forEach((r, i) => {
138
+ console.log(' ' +
139
+ String(i + 1).padEnd(4) +
140
+ r.label.padEnd(20) +
141
+ String(r.events).padStart(12) +
142
+ r.avg.toFixed(1).padStart(10) +
143
+ ` ${r.freq.toFixed(1)}`);
144
+ });
145
+ console.log('');
146
+ }
147
+ run();
148
+ //# sourceMappingURL=analyze_ama_price_changes.js.map