dexbot 1.4.17 → 1.4.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/README.md +1 -0
- package/analysis/README.md +43 -43
- package/analysis/ama_fitting/README.md +8 -8
- package/analysis/ama_fitting/package.json +1 -1
- package/analysis/bot_fitting/README.md +4 -4
- package/analysis/bot_fitting/backtest_ama_sweep.ts +1 -1
- package/analysis/bot_usage/discover_bot_accounts.ts +11 -11
- package/analysis/tradingview/README.md +4 -4
- package/analysis/trend_detection/DYNAMIC_WEIGHT_RESEARCH.md +2 -2
- package/analysis/trend_detection/SIGNAL_DOCUMENTATION.md +1 -1
- package/analysis/trend_detection/package.json +1 -1
- package/claw/README.md +45 -45
- package/claw/docs/AI_BOT_LIBRARY_API.md +6 -6
- package/claw/examples/short_mpa_bts_strategy.ts +3 -3
- package/claw/package.json +21 -21
- package/claw/runtimes/openclaw-plugin/openclaw.plugin.json +1 -1
- package/claw/runtimes/openclaw-plugin/package.json +1 -1
- package/claw/scripts/claw_bridge.ts +2 -2
- package/claw/scripts/claw_skill_md.ts +1 -1
- package/claw/skills/launcher-ops/references/launcher-workflow.md +5 -5
- package/claw/skills/margin-trading/references/honest-asset-list.md +1 -1
- package/claw/skills/memu-memory/SKILL.md +3 -3
- package/claw/tests/test_claw_mcp_transport.ts +2 -2
- package/dist/analysis/ama_fitting/analyze_ama_price_changes.d.ts +3 -0
- package/dist/analysis/ama_fitting/analyze_ama_price_changes.d.ts.map +1 -0
- package/dist/analysis/ama_fitting/analyze_ama_price_changes.js +148 -0
- package/dist/analysis/ama_fitting/analyze_ama_price_changes.js.map +1 -0
- package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.d.ts +12 -0
- package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.d.ts.map +1 -0
- package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.js +389 -0
- package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.js.map +1 -0
- package/dist/analysis/ama_fitting/calibrate_convergence_er.d.ts +3 -0
- package/dist/analysis/ama_fitting/calibrate_convergence_er.d.ts.map +1 -0
- package/dist/analysis/ama_fitting/calibrate_convergence_er.js +200 -0
- package/dist/analysis/ama_fitting/calibrate_convergence_er.js.map +1 -0
- package/dist/analysis/ama_fitting/fetch_lp_candles.d.ts +3 -0
- package/dist/analysis/ama_fitting/fetch_lp_candles.d.ts.map +1 -0
- package/dist/analysis/ama_fitting/fetch_lp_candles.js +213 -0
- package/dist/analysis/ama_fitting/fetch_lp_candles.js.map +1 -0
- package/dist/analysis/ama_fitting/generate_unified_comparison_chart.d.ts +25 -0
- package/dist/analysis/ama_fitting/generate_unified_comparison_chart.d.ts.map +1 -0
- package/dist/analysis/ama_fitting/generate_unified_comparison_chart.js +247 -0
- package/dist/analysis/ama_fitting/generate_unified_comparison_chart.js.map +1 -0
- package/dist/analysis/ama_fitting/optimizer_high_resolution.d.ts +35 -0
- package/dist/analysis/ama_fitting/optimizer_high_resolution.d.ts.map +1 -0
- package/dist/analysis/ama_fitting/optimizer_high_resolution.js +782 -0
- package/dist/analysis/ama_fitting/optimizer_high_resolution.js.map +1 -0
- package/dist/analysis/analyze_derivatives.d.ts +86 -0
- package/dist/analysis/analyze_derivatives.d.ts.map +1 -0
- package/dist/analysis/analyze_derivatives.js +285 -0
- package/dist/analysis/analyze_derivatives.js.map +1 -0
- package/dist/analysis/analyze_dynamic_weight.d.ts +14 -0
- package/dist/analysis/analyze_dynamic_weight.d.ts.map +1 -0
- package/dist/analysis/analyze_dynamic_weight.js +197 -0
- package/dist/analysis/analyze_dynamic_weight.js.map +1 -0
- package/dist/analysis/analyze_kalman.d.ts +13 -0
- package/dist/analysis/analyze_kalman.d.ts.map +1 -0
- package/dist/analysis/analyze_kalman.js +118 -0
- package/dist/analysis/analyze_kalman.js.map +1 -0
- package/dist/analysis/analyze_regime.d.ts +20 -0
- package/dist/analysis/analyze_regime.d.ts.map +1 -0
- package/dist/analysis/analyze_regime.js +139 -0
- package/dist/analysis/analyze_regime.js.map +1 -0
- package/dist/analysis/analyze_regime_windows.d.ts +19 -0
- package/dist/analysis/analyze_regime_windows.d.ts.map +1 -0
- package/dist/analysis/analyze_regime_windows.js +414 -0
- package/dist/analysis/analyze_regime_windows.js.map +1 -0
- package/dist/analysis/analyze_risk_profile.d.ts +3 -0
- package/dist/analysis/analyze_risk_profile.d.ts.map +1 -0
- package/dist/analysis/analyze_risk_profile.js +186 -0
- package/dist/analysis/analyze_risk_profile.js.map +1 -0
- package/dist/analysis/analyze_trade_heatmap.d.ts +3 -0
- package/dist/analysis/analyze_trade_heatmap.d.ts.map +1 -0
- package/dist/analysis/analyze_trade_heatmap.js +358 -0
- package/dist/analysis/analyze_trade_heatmap.js.map +1 -0
- package/dist/analysis/analyze_volatility.d.ts +22 -0
- package/dist/analysis/analyze_volatility.d.ts.map +1 -0
- package/dist/analysis/analyze_volatility.js +165 -0
- package/dist/analysis/analyze_volatility.js.map +1 -0
- package/dist/analysis/bot_fitting/backtest_ama_sweep.d.ts +91 -0
- package/dist/analysis/bot_fitting/backtest_ama_sweep.d.ts.map +1 -0
- package/dist/analysis/bot_fitting/backtest_ama_sweep.js +792 -0
- package/dist/analysis/bot_fitting/backtest_ama_sweep.js.map +1 -0
- package/dist/analysis/bot_fitting/backtest_bot_fitting.d.ts +2 -0
- package/dist/analysis/bot_fitting/backtest_bot_fitting.d.ts.map +1 -0
- package/dist/analysis/bot_fitting/backtest_bot_fitting.js +380 -0
- package/dist/analysis/bot_fitting/backtest_bot_fitting.js.map +1 -0
- package/dist/analysis/bot_fitting/shared_utils.d.ts +26 -0
- package/dist/analysis/bot_fitting/shared_utils.d.ts.map +1 -0
- package/dist/analysis/bot_fitting/shared_utils.js +42 -0
- package/dist/analysis/bot_fitting/shared_utils.js.map +1 -0
- package/dist/analysis/bot_key_utils.d.ts +11 -0
- package/dist/analysis/bot_key_utils.d.ts.map +1 -0
- package/dist/analysis/bot_key_utils.js +153 -0
- package/dist/analysis/bot_key_utils.js.map +1 -0
- package/dist/analysis/bot_usage/discover_bot_accounts.d.ts +3 -0
- package/dist/analysis/bot_usage/discover_bot_accounts.d.ts.map +1 -0
- package/dist/analysis/bot_usage/discover_bot_accounts.js +499 -0
- package/dist/analysis/bot_usage/discover_bot_accounts.js.map +1 -0
- package/dist/analysis/bot_usage/kibana_bot_queries.d.ts +531 -0
- package/dist/analysis/bot_usage/kibana_bot_queries.d.ts.map +1 -0
- package/dist/analysis/bot_usage/kibana_bot_queries.js +399 -0
- package/dist/analysis/bot_usage/kibana_bot_queries.js.map +1 -0
- package/dist/analysis/chart_css.d.ts +17 -0
- package/dist/analysis/chart_css.d.ts.map +1 -0
- package/dist/analysis/chart_css.js +49 -0
- package/dist/analysis/chart_css.js.map +1 -0
- package/dist/analysis/chart_ui.d.ts +45 -0
- package/dist/analysis/chart_ui.d.ts.map +1 -0
- package/dist/analysis/chart_ui.js +97 -0
- package/dist/analysis/chart_ui.js.map +1 -0
- package/dist/analysis/chart_utils.d.ts +27 -0
- package/dist/analysis/chart_utils.d.ts.map +1 -0
- package/dist/analysis/chart_utils.js +153 -0
- package/dist/analysis/chart_utils.js.map +1 -0
- package/dist/analysis/derivative_chart_generator.d.ts +12 -0
- package/dist/analysis/derivative_chart_generator.d.ts.map +1 -0
- package/dist/analysis/derivative_chart_generator.js +891 -0
- package/dist/analysis/derivative_chart_generator.js.map +1 -0
- package/dist/analysis/math_utils.d.ts +22 -0
- package/dist/analysis/math_utils.d.ts.map +1 -0
- package/dist/analysis/math_utils.js +43 -0
- package/dist/analysis/math_utils.js.map +1 -0
- package/dist/analysis/price_sources.d.ts +40 -0
- package/dist/analysis/price_sources.d.ts.map +1 -0
- package/dist/analysis/price_sources.js +94 -0
- package/dist/analysis/price_sources.js.map +1 -0
- package/dist/analysis/resolve_source.d.ts +25 -0
- package/dist/analysis/resolve_source.d.ts.map +1 -0
- package/dist/analysis/resolve_source.js +69 -0
- package/dist/analysis/resolve_source.js.map +1 -0
- package/dist/analysis/trade_profitability.d.ts +115 -0
- package/dist/analysis/trade_profitability.d.ts.map +1 -0
- package/dist/analysis/trade_profitability.js +1240 -0
- package/dist/analysis/trade_profitability.js.map +1 -0
- package/dist/analysis/tradingview/analyze_tradingview.d.ts +31 -0
- package/dist/analysis/tradingview/analyze_tradingview.d.ts.map +1 -0
- package/dist/analysis/tradingview/analyze_tradingview.js +146 -0
- package/dist/analysis/tradingview/analyze_tradingview.js.map +1 -0
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.d.ts +5 -0
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.d.ts.map +1 -0
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js +1714 -0
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js.map +1 -0
- package/dist/analysis/trend_detection/derivative_analyzer.d.ts +247 -0
- package/dist/analysis/trend_detection/derivative_analyzer.d.ts.map +1 -0
- package/dist/analysis/trend_detection/derivative_analyzer.js +901 -0
- package/dist/analysis/trend_detection/derivative_analyzer.js.map +1 -0
- package/dist/analysis/trend_detection/dynamic_weight_chart_generator.d.ts +3 -0
- package/dist/analysis/trend_detection/dynamic_weight_chart_generator.d.ts.map +1 -0
- package/dist/analysis/trend_detection/dynamic_weight_chart_generator.js +1361 -0
- package/dist/analysis/trend_detection/dynamic_weight_chart_generator.js.map +1 -0
- package/dist/analysis/trend_detection/hurst_analyzer.d.ts +6 -0
- package/dist/analysis/trend_detection/hurst_analyzer.d.ts.map +1 -0
- package/dist/analysis/trend_detection/hurst_analyzer.js +7 -0
- package/dist/analysis/trend_detection/hurst_analyzer.js.map +1 -0
- package/dist/analysis/trend_detection/kalman_chart_generator.d.ts +3 -0
- package/dist/analysis/trend_detection/kalman_chart_generator.d.ts.map +1 -0
- package/dist/analysis/trend_detection/kalman_chart_generator.js +360 -0
- package/dist/analysis/trend_detection/kalman_chart_generator.js.map +1 -0
- package/dist/analysis/trend_detection/kalman_trend_analyzer.d.ts +8 -0
- package/dist/analysis/trend_detection/kalman_trend_analyzer.d.ts.map +1 -0
- package/dist/analysis/trend_detection/kalman_trend_analyzer.js +8 -0
- package/dist/analysis/trend_detection/kalman_trend_analyzer.js.map +1 -0
- package/dist/analysis/trend_detection/kalman_velocity_smoothing.d.ts +6 -0
- package/dist/analysis/trend_detection/kalman_velocity_smoothing.d.ts.map +1 -0
- package/dist/analysis/trend_detection/kalman_velocity_smoothing.js +7 -0
- package/dist/analysis/trend_detection/kalman_velocity_smoothing.js.map +1 -0
- package/dist/analysis/trend_detection/permutation_entropy_analyzer.d.ts +6 -0
- package/dist/analysis/trend_detection/permutation_entropy_analyzer.d.ts.map +1 -0
- package/dist/analysis/trend_detection/permutation_entropy_analyzer.js +7 -0
- package/dist/analysis/trend_detection/permutation_entropy_analyzer.js.map +1 -0
- package/dist/analysis/trend_detection/regime_chart_generator.d.ts +3 -0
- package/dist/analysis/trend_detection/regime_chart_generator.d.ts.map +1 -0
- package/dist/analysis/trend_detection/regime_chart_generator.js +310 -0
- package/dist/analysis/trend_detection/regime_chart_generator.js.map +1 -0
- package/dist/analysis/trend_detection/tests/test_kalman_trend.d.ts +2 -0
- package/dist/analysis/trend_detection/tests/test_kalman_trend.d.ts.map +1 -0
- package/dist/analysis/trend_detection/tests/test_kalman_trend.js +128 -0
- package/dist/analysis/trend_detection/tests/test_kalman_trend.js.map +1 -0
- package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.d.ts +2 -0
- package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.d.ts.map +1 -0
- package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.js +37 -0
- package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.js.map +1 -0
- package/dist/analysis/trend_detection/volatility_chart_generator.d.ts +3 -0
- package/dist/analysis/trend_detection/volatility_chart_generator.d.ts.map +1 -0
- package/dist/analysis/trend_detection/volatility_chart_generator.js +646 -0
- package/dist/analysis/trend_detection/volatility_chart_generator.js.map +1 -0
- package/dist/bot.js +1 -1
- package/dist/bot.js.map +1 -1
- package/dist/market_adapter/ama_signal_runner.js +1 -1
- package/dist/market_adapter/ama_signal_runner.js.map +1 -1
- package/dist/market_adapter/inputs/fetch_cex_synthetic_data.js +1 -1
- package/dist/modules/account_bots.d.ts +1 -0
- package/dist/modules/account_bots.d.ts.map +1 -1
- package/dist/modules/account_bots.js +27 -5
- package/dist/modules/account_bots.js.map +1 -1
- package/dist/modules/constants.d.ts +1 -0
- package/dist/modules/constants.d.ts.map +1 -1
- package/dist/modules/constants.js +12 -3
- package/dist/modules/constants.js.map +1 -1
- package/dist/modules/dexbot_class.d.ts +22 -0
- package/dist/modules/dexbot_class.d.ts.map +1 -1
- package/dist/modules/dexbot_class.js +27 -1
- package/dist/modules/dexbot_class.js.map +1 -1
- package/dist/modules/dexbot_cow_runtime.d.ts +48 -1
- package/dist/modules/dexbot_cow_runtime.d.ts.map +1 -1
- package/dist/modules/dexbot_cow_runtime.js +168 -4
- package/dist/modules/dexbot_cow_runtime.js.map +1 -1
- package/dist/modules/order/grid_reconcile_internal.d.ts.map +1 -1
- package/dist/modules/order/grid_reconcile_internal.js +6 -27
- package/dist/modules/order/grid_reconcile_internal.js.map +1 -1
- package/dist/modules/order/strategy.d.ts.map +1 -1
- package/dist/modules/order/strategy.js +6 -15
- package/dist/modules/order/strategy.js.map +1 -1
- package/dist/modules/order/utils/math.d.ts +29 -1
- package/dist/modules/order/utils/math.d.ts.map +1 -1
- package/dist/modules/order/utils/math.js +46 -1
- package/dist/modules/order/utils/math.js.map +1 -1
- package/dist/modules/order/utils/system.d.ts +2 -0
- package/dist/modules/order/utils/system.d.ts.map +1 -1
- package/dist/modules/order/utils/system.js +30 -2
- package/dist/modules/order/utils/system.js.map +1 -1
- package/dist/modules/runtime_settings.d.ts +1 -0
- package/dist/modules/runtime_settings.d.ts.map +1 -1
- package/dist/modules/runtime_settings.js +13 -2
- package/dist/modules/runtime_settings.js.map +1 -1
- package/dist/scripts/generate_lp_chart.js +1 -1
- package/dist/scripts/test-credit-renewal.js +1 -1
- package/docs/DEXBOT_COMPARISON.md +3 -3
- package/docs/EVOLUTION.md +26 -95
- package/docs/FUND_MOVEMENT_AND_ACCOUNTING.md +1 -1
- package/docs/GRID_RECALCULATION.md +2 -2
- package/docs/LIFECYCLE.md +207 -0
- package/docs/README.md +9 -1
- package/docs/developer_guide.md +4 -3
- package/market_adapter/README.md +23 -23
- package/package.json +18 -21
- package/scripts/README.md +12 -12
- package/scripts/bots +5 -7
- package/scripts/clear-market-adapter.sh +1 -1
- package/scripts/dexbot +5 -7
- package/scripts/keys +5 -7
- package/scripts/pm2 +5 -7
- package/scripts/unlock +5 -7
- package/scripts/update.js +6 -7
- package/scripts/repo-stats.html +0 -480
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dexbot",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.19",
|
|
4
4
|
"description": "The first open source trading bot with zero runtime dependencies and a fully adaptive market making strategy.",
|
|
5
5
|
"main": "dist/modules/dexbot_class.js",
|
|
6
6
|
"exports": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
16
|
"dist",
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
"ecosystem.config.cjs",
|
|
19
19
|
"scripts/bots",
|
|
20
20
|
"scripts/clean-dist.js",
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"docs/WORKFLOW.md",
|
|
53
53
|
"docs/architecture.md",
|
|
54
54
|
"docs/developer_guide.md",
|
|
55
|
+
"docs/LIFECYCLE.md",
|
|
55
56
|
"docs/docker.md",
|
|
56
57
|
"market_adapter/README.md",
|
|
57
58
|
"modules/README.md",
|
|
@@ -82,21 +83,21 @@
|
|
|
82
83
|
"pmain": "bash scripts/pmain.sh",
|
|
83
84
|
"pdev": "bash scripts/pdev.sh",
|
|
84
85
|
"ptest": "bash scripts/ptest.sh",
|
|
85
|
-
"lp:chart": "
|
|
86
|
-
"market-adapter:whitelist": "
|
|
87
|
-
"market-adapter:fetch-cex-synthetic": "
|
|
88
|
-
"analysis:tradingview": "
|
|
89
|
-
"ama:chart:lp-local": "
|
|
90
|
-
"analysis:derivatives": "
|
|
91
|
-
"analysis:trade-pnl": "
|
|
92
|
-
"native:release-gates": "
|
|
86
|
+
"lp:chart": "npm run build && node dist/scripts/generate_lp_chart.js",
|
|
87
|
+
"market-adapter:whitelist": "npm run build && node dist/scripts/generate_market_adapter_whitelist.js",
|
|
88
|
+
"market-adapter:fetch-cex-synthetic": "npm run build && node dist/market_adapter/inputs/fetch_cex_synthetic_data.js",
|
|
89
|
+
"analysis:tradingview": "npm run build && node dist/analysis/tradingview/analyze_tradingview.js",
|
|
90
|
+
"ama:chart:lp-local": "npm run build && node dist/analysis/ama_fitting/generate_unified_comparison_chart.js",
|
|
91
|
+
"analysis:derivatives": "npm run build && node dist/analysis/analyze_derivatives.js",
|
|
92
|
+
"analysis:trade-pnl": "npm run build && node dist/analysis/trade_profitability.js",
|
|
93
|
+
"native:release-gates": "npm run build && node dist/scripts/native_release_gates.js",
|
|
93
94
|
"native:serial-snapshots": "tsx tests/test_native_serial_ops.ts",
|
|
94
95
|
"native:ecc-invariants": "tsx tests/test_native_ecc.ts",
|
|
95
|
-
"native:corpus": "
|
|
96
|
-
"test:credit-renewal": "
|
|
97
|
-
"version:sync": "
|
|
98
|
-
"version:check": "
|
|
99
|
-
"verify:browser-bundle": "
|
|
96
|
+
"native:corpus": "npm run build && node dist/scripts/generate_mainnet_corpus_report.js",
|
|
97
|
+
"test:credit-renewal": "npm run build && node dist/scripts/test-credit-renewal.js",
|
|
98
|
+
"version:sync": "npm run build && node dist/scripts/sync-version.js",
|
|
99
|
+
"version:check": "npm run build && node dist/scripts/sync-version.js --check",
|
|
100
|
+
"verify:browser-bundle": "npm run build && node dist/scripts/verify-browser-bundle.js",
|
|
100
101
|
"pretest": "tsc --noEmit",
|
|
101
102
|
"test": "node --import tsx scripts/run-tests.ts",
|
|
102
103
|
"test:live": "RUN_LIVE_BITSHARES_TESTS=1 node --import tsx scripts/run-tests.ts",
|
|
@@ -174,14 +175,10 @@
|
|
|
174
175
|
"url": "https://github.com/froooze/DEXBot2/issues"
|
|
175
176
|
},
|
|
176
177
|
"homepage": "https://github.com/froooze/DEXBot2#readme",
|
|
177
|
-
"
|
|
178
|
-
"tsconfig": true
|
|
179
|
-
},
|
|
180
|
-
"dependencies": {
|
|
181
|
-
"tsx": "^4.22.3"
|
|
182
|
-
},
|
|
178
|
+
"dependencies": {},
|
|
183
179
|
"devDependencies": {
|
|
184
180
|
"@types/node": "^25.9.1",
|
|
181
|
+
"tsx": "^4.22.3",
|
|
185
182
|
"typescript": "^6.0.3"
|
|
186
183
|
}
|
|
187
184
|
}
|
package/scripts/README.md
CHANGED
|
@@ -90,7 +90,7 @@ bash scripts/reset-settings.sh
|
|
|
90
90
|
**Purpose:** Check `bots.json` for schema errors or missing required fields.
|
|
91
91
|
```bash
|
|
92
92
|
# Validate the live bot configuration
|
|
93
|
-
|
|
93
|
+
node dist/scripts/validate_bots.js
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
### Market Adapter Whitelist Generation
|
|
@@ -118,7 +118,7 @@ dexbot white --prune
|
|
|
118
118
|
```bash
|
|
119
119
|
# Calculates RMS Error (hardcoded threshold: 1 promille ≈ 3.2% avg error)
|
|
120
120
|
# RMS quadratically penalizes large errors - see docs/GRID_RECALCULATION.md
|
|
121
|
-
|
|
121
|
+
node dist/scripts/divergence-calc.js
|
|
122
122
|
```
|
|
123
123
|
**Reference:** RMS threshold interpretation in [Grid Recalculation docs](../docs/GRID_RECALCULATION.md)
|
|
124
124
|
|
|
@@ -127,7 +127,7 @@ tsx scripts/divergence-calc.ts
|
|
|
127
127
|
**Purpose:** Analyze grid trading metrics and order distribution patterns.
|
|
128
128
|
```bash
|
|
129
129
|
# Analyzes spread accuracy, geometric consistency, and fund distribution
|
|
130
|
-
|
|
130
|
+
node dist/scripts/analyze-orders.js
|
|
131
131
|
```
|
|
132
132
|
|
|
133
133
|
For AMA bots (`gridPrice: ama`) the analyzer reads `<botKey>.dynamicgrid.json`
|
|
@@ -140,7 +140,7 @@ static weights.
|
|
|
140
140
|
**File:** `diagnose-kibana-candles.ts`
|
|
141
141
|
**Purpose:** Fetch raw Kibana LP candles for a specific pool to verify trading activity.
|
|
142
142
|
```bash
|
|
143
|
-
|
|
143
|
+
node dist/scripts/diagnose-kibana-candles.js
|
|
144
144
|
```
|
|
145
145
|
|
|
146
146
|
### Pool History Diagnostics
|
|
@@ -148,17 +148,17 @@ tsx scripts/diagnose-kibana-candles.ts
|
|
|
148
148
|
**Purpose:** Inspect raw BitShares pool history API responses.
|
|
149
149
|
```bash
|
|
150
150
|
# Inspect pool history (default pool 1.19.133)
|
|
151
|
-
|
|
151
|
+
node dist/scripts/diagnose-pool-history.js
|
|
152
152
|
|
|
153
153
|
# Custom pool, limit, and time range
|
|
154
|
-
|
|
154
|
+
node dist/scripts/diagnose-pool-history.js --pool 1.19.x --limit 100 --hours 48 --maxPages 5
|
|
155
155
|
```
|
|
156
156
|
|
|
157
157
|
### Print Grid Sample
|
|
158
158
|
**File:** `print_grid.ts`
|
|
159
159
|
**Purpose:** Demonstrate the grid structure — shows consecutive price levels with percentage differences between adjacent slots.
|
|
160
160
|
```bash
|
|
161
|
-
|
|
161
|
+
node dist/scripts/print_grid.js
|
|
162
162
|
```
|
|
163
163
|
|
|
164
164
|
### Grid Calculation Runner
|
|
@@ -166,10 +166,10 @@ tsx scripts/print_grid.ts
|
|
|
166
166
|
**Purpose:** Standalone order grid calculation debugger — loads a bot config, initializes the grid, and simulates sync cycles.
|
|
167
167
|
```bash
|
|
168
168
|
# Default (first bot, 3 cycles)
|
|
169
|
-
|
|
169
|
+
node dist/scripts/runner.js
|
|
170
170
|
|
|
171
171
|
# Specific bot, 10 cycles with 1s delay
|
|
172
|
-
LIVE_BOT_NAME=my-bot CALC_CYCLES=10 CALC_DELAY_MS=1000
|
|
172
|
+
LIVE_BOT_NAME=my-bot CALC_CYCLES=10 CALC_DELAY_MS=1000 node dist/scripts/runner.js
|
|
173
173
|
```
|
|
174
174
|
Useful for verifying config produces the expected grid, testing price derivation, and debugging fund allocation.
|
|
175
175
|
Requires a live BitShares connection (asset metadata lookups and price derivation are on-chain).
|
|
@@ -215,7 +215,7 @@ Tests run with native Node `assert` — no test framework needed. See [tests/REA
|
|
|
215
215
|
**File:** `analyze-git.ts`
|
|
216
216
|
**Purpose:** Analyze git history and generate a chart of lines added vs deleted by file.
|
|
217
217
|
```bash
|
|
218
|
-
|
|
218
|
+
node dist/scripts/analyze-git.js
|
|
219
219
|
```
|
|
220
220
|
|
|
221
221
|
### Credit Renewal Test
|
|
@@ -402,8 +402,8 @@ alias dbu='dexbot update'
|
|
|
402
402
|
alias dbc='bash scripts/clear-logs.sh'
|
|
403
403
|
alias dbr='bash scripts/clear-orders.sh'
|
|
404
404
|
alias dba='bash scripts/clear-all.sh'
|
|
405
|
-
alias dbv='
|
|
406
|
-
alias dbd='
|
|
405
|
+
alias dbv='node dist/scripts/validate_bots.js'
|
|
406
|
+
alias dbd='node dist/scripts/divergence-calc.js'
|
|
407
407
|
```
|
|
408
408
|
|
|
409
409
|
---
|
package/scripts/bots
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
process.argv[2] = 'bots';
|
|
3
|
+
// Shim: runs compiled dist/dexbot.js
|
|
3
4
|
import { existsSync } from 'node:fs';
|
|
4
5
|
import path from 'node:path';
|
|
5
6
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
6
|
-
import { createRequire } from 'node:module';
|
|
7
7
|
|
|
8
8
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
9
|
-
const require = createRequire(import.meta.url);
|
|
10
9
|
const root = path.resolve(__dirname, '..');
|
|
11
10
|
const distTarget = path.join(root, 'dist', 'dexbot.js');
|
|
12
11
|
|
|
13
|
-
if (existsSync(distTarget)) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
require('tsx/cjs');
|
|
17
|
-
require(path.join(root, 'dexbot.ts'));
|
|
12
|
+
if (!existsSync(distTarget)) {
|
|
13
|
+
console.error('dist/dexbot.js not found. Run `npm run build` first.');
|
|
14
|
+
process.exit(1);
|
|
18
15
|
}
|
|
16
|
+
await import(pathToFileURL(distTarget).href);
|
|
@@ -187,7 +187,7 @@ if [ "$REMAINING_DATA" -eq 0 ] && [ "$REMAINING_STATE" -eq 0 ] && [ "$REMAINING_
|
|
|
187
187
|
log_info "Next steps:"
|
|
188
188
|
log_info "- The market adapter will bootstrap fresh candle data from Kibana on next run"
|
|
189
189
|
log_info "- All bot center prices and AMA state will be recomputed"
|
|
190
|
-
log_info "- Start market adapter:
|
|
190
|
+
log_info "- Start market adapter: node dist/market_adapter/market_adapter.js"
|
|
191
191
|
else
|
|
192
192
|
log_warning "Cleanup incomplete. Remaining data files: $REMAINING_DATA, remaining state files: $REMAINING_STATE, remaining logs: $REMAINING_LOG"
|
|
193
193
|
fi
|
package/scripts/dexbot
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
// Shim: runs compiled dist/dexbot.js
|
|
2
3
|
import { existsSync } from 'node:fs';
|
|
3
4
|
import path from 'node:path';
|
|
4
5
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
5
|
-
import { createRequire } from 'node:module';
|
|
6
6
|
|
|
7
7
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
8
|
-
const require = createRequire(import.meta.url);
|
|
9
8
|
const root = path.resolve(__dirname, '..');
|
|
10
9
|
const distTarget = path.join(root, 'dist', 'dexbot.js');
|
|
11
10
|
|
|
12
|
-
if (existsSync(distTarget)) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
require('tsx/cjs');
|
|
16
|
-
require(path.join(root, 'dexbot.ts'));
|
|
11
|
+
if (!existsSync(distTarget)) {
|
|
12
|
+
console.error('dist/dexbot.js not found. Run `npm run build` first.');
|
|
13
|
+
process.exit(1);
|
|
17
14
|
}
|
|
15
|
+
await import(pathToFileURL(distTarget).href);
|
package/scripts/keys
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
process.argv[2] = 'keys';
|
|
3
|
+
// Shim: runs compiled dist/dexbot.js
|
|
3
4
|
import { existsSync } from 'node:fs';
|
|
4
5
|
import path from 'node:path';
|
|
5
6
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
6
|
-
import { createRequire } from 'node:module';
|
|
7
7
|
|
|
8
8
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
9
|
-
const require = createRequire(import.meta.url);
|
|
10
9
|
const root = path.resolve(__dirname, '..');
|
|
11
10
|
const distTarget = path.join(root, 'dist', 'dexbot.js');
|
|
12
11
|
|
|
13
|
-
if (existsSync(distTarget)) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
require('tsx/cjs');
|
|
17
|
-
require(path.join(root, 'dexbot.ts'));
|
|
12
|
+
if (!existsSync(distTarget)) {
|
|
13
|
+
console.error('dist/dexbot.js not found. Run `npm run build` first.');
|
|
14
|
+
process.exit(1);
|
|
18
15
|
}
|
|
16
|
+
await import(pathToFileURL(distTarget).href);
|
package/scripts/pm2
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
// Shim: runs compiled dist/pm2.js
|
|
2
3
|
import { existsSync } from 'node:fs';
|
|
3
4
|
import path from 'node:path';
|
|
4
5
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
5
|
-
import { createRequire } from 'node:module';
|
|
6
6
|
|
|
7
7
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
8
|
-
const require = createRequire(import.meta.url);
|
|
9
8
|
const root = path.resolve(__dirname, '..');
|
|
10
9
|
const distTarget = path.join(root, 'dist', 'pm2.js');
|
|
11
10
|
|
|
12
|
-
if (existsSync(distTarget)) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
require('tsx/cjs');
|
|
16
|
-
require(path.join(root, 'pm2.ts'));
|
|
11
|
+
if (!existsSync(distTarget)) {
|
|
12
|
+
console.error('dist/pm2.js not found. Run `npm run build` first.');
|
|
13
|
+
process.exit(1);
|
|
17
14
|
}
|
|
15
|
+
await import(pathToFileURL(distTarget).href);
|
package/scripts/unlock
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
// Shim: runs compiled dist/unlock.js
|
|
2
3
|
import { existsSync } from 'node:fs';
|
|
3
4
|
import path from 'node:path';
|
|
4
5
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
5
|
-
import { createRequire } from 'node:module';
|
|
6
6
|
|
|
7
7
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
8
|
-
const require = createRequire(import.meta.url);
|
|
9
8
|
const root = path.resolve(__dirname, '..');
|
|
10
9
|
const distTarget = path.join(root, 'dist', 'unlock.js');
|
|
11
10
|
|
|
12
|
-
if (existsSync(distTarget)) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
require('tsx/cjs');
|
|
16
|
-
require(path.join(root, 'unlock.ts'));
|
|
11
|
+
if (!existsSync(distTarget)) {
|
|
12
|
+
console.error('dist/unlock.js not found. Run `npm run build` first.');
|
|
13
|
+
process.exit(1);
|
|
17
14
|
}
|
|
15
|
+
await import(pathToFileURL(distTarget).href);
|
package/scripts/update.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// Shim:
|
|
2
|
+
// Shim: runs compiled dist/scripts/update.js
|
|
3
3
|
import { existsSync } from 'fs';
|
|
4
4
|
import { dirname, join } from 'path';
|
|
5
5
|
import { fileURLToPath } from 'url';
|
|
6
6
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
7
7
|
const distTarget = join(__dirname, '..', 'dist', 'scripts', 'update.js');
|
|
8
|
-
if (existsSync(distTarget)) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
8
|
+
if (!existsSync(distTarget)) {
|
|
9
|
+
console.error('dist/scripts/update.js not found. Run `npm run build` first.');
|
|
10
|
+
process.exit(1);
|
|
11
|
+
}
|
|
12
|
+
await import(distTarget);
|