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