dexbot 1.6.6 → 1.6.8
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 +89 -1
- package/README.md +8 -5
- package/analysis/README.md +2 -3
- package/analysis/tradingview/README.md +78 -1
- package/analysis/trend_detection/DYNAMIC_WEIGHT_RESEARCH.md +1 -1
- package/claw/package.json +1 -1
- package/claw/runtimes/openclaw-plugin/openclaw.plugin.json +1 -1
- package/claw/runtimes/openclaw-plugin/package.json +1 -1
- package/dist/analysis/tradingview/analyze_tradingview.d.ts +4 -0
- package/dist/analysis/tradingview/analyze_tradingview.js +55 -0
- package/dist/analysis/tradingview/grid_reset_config.d.ts +61 -0
- package/dist/analysis/tradingview/grid_reset_config.js +235 -0
- package/dist/analysis/tradingview/grid_reset_sim.d.ts +67 -0
- package/dist/analysis/tradingview/grid_reset_sim.js +307 -0
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js +419 -3
- package/dist/dexbot.js +44 -15
- package/dist/market_adapter/core/market_adapter_service.js +14 -2
- package/dist/market_adapter/core/strategies/dynamic_weight_series.d.ts +8 -1
- package/dist/market_adapter/core/strategies/dynamic_weight_series.js +5 -1
- package/dist/market_adapter/inputs/window_cache.d.ts +97 -19
- package/dist/market_adapter/inputs/window_cache.js +302 -48
- package/dist/market_adapter/market_adapter.d.ts +8 -1
- package/dist/market_adapter/market_adapter.js +22 -4
- package/dist/modules/account_bots.js +20 -9
- package/dist/modules/account_orders.d.ts +44 -4
- package/dist/modules/account_orders.js +104 -7
- package/dist/modules/bitshares-native/chain_client.d.ts +10 -0
- package/dist/modules/bitshares-native/chain_client.js +197 -28
- package/dist/modules/bitshares-native/subscriptions.js +312 -10
- package/dist/modules/bitshares-native/transport.d.ts +1 -0
- package/dist/modules/bitshares-native/transport.js +97 -3
- package/dist/modules/bitshares_client.d.ts +20 -0
- package/dist/modules/bitshares_client.js +29 -0
- package/dist/modules/bot_settings.js +10 -1
- package/dist/modules/chain_keys.d.ts +37 -22
- package/dist/modules/chain_keys.js +145 -44
- package/dist/modules/cli_start_onboarding.d.ts +10 -0
- package/dist/modules/cli_start_onboarding.js +15 -0
- package/dist/modules/cli_start_output.d.ts +6 -0
- package/dist/modules/cli_start_output.js +8 -0
- package/dist/modules/config.d.ts +1 -0
- package/dist/modules/config.js +1 -0
- package/dist/modules/constants.d.ts +23 -2
- package/dist/modules/constants.js +196 -15
- package/dist/modules/dexbot_class.d.ts +6 -76
- package/dist/modules/dexbot_class.js +0 -32
- package/dist/modules/dexbot_cow_runtime.d.ts +3 -58
- package/dist/modules/dexbot_cow_runtime.js +53 -96
- package/dist/modules/dexbot_fill_runtime.d.ts +6 -1
- package/dist/modules/dexbot_fill_runtime.js +22 -3
- package/dist/modules/dexbot_maintenance_runtime.d.ts +38 -1
- package/dist/modules/dexbot_maintenance_runtime.js +103 -11
- package/dist/modules/dexbot_startup_runtime.js +73 -20
- package/dist/modules/dexbot_state_recovery.d.ts +6 -0
- package/dist/modules/dexbot_state_recovery.js +34 -1
- package/dist/modules/order/async_lock.d.ts +8 -0
- package/dist/modules/order/async_lock.js +15 -0
- package/dist/modules/order/genesis_policy.d.ts +162 -0
- package/dist/modules/order/genesis_policy.js +267 -0
- package/dist/modules/order/grid.js +109 -135
- package/dist/modules/order/grid_reconcile.d.ts +9 -0
- package/dist/modules/order/grid_reconcile.js +13 -4
- package/dist/modules/order/grid_reconcile_internal.js +13 -2
- package/dist/modules/order/logger.d.ts +12 -2
- package/dist/modules/order/logger.js +29 -7
- package/dist/modules/order/manager.d.ts +53 -0
- package/dist/modules/order/manager.js +86 -25
- package/dist/modules/order/sync_engine.d.ts +19 -0
- package/dist/modules/order/sync_engine.js +284 -344
- package/dist/modules/order/utils/math.d.ts +22 -1
- package/dist/modules/order/utils/math.js +64 -1
- package/dist/modules/order/utils/order.d.ts +43 -58
- package/dist/modules/order/utils/order.js +302 -194
- package/dist/modules/order/utils/system.d.ts +97 -0
- package/dist/modules/order/utils/system.js +282 -3
- package/dist/modules/paths.d.ts +8 -1
- package/dist/modules/paths.js +11 -3
- package/dist/modules/utils/text_width.d.ts +19 -0
- package/dist/modules/utils/text_width.js +97 -0
- package/dist/modules/version_notice.d.ts +165 -0
- package/dist/modules/version_notice.js +364 -0
- package/dist/pm2.js +104 -18
- package/dist/scripts/update.js +62 -13
- package/dist/unlock.d.ts +14 -2
- package/dist/unlock.js +101 -4
- package/docs/BITSHARES_ONBOARDING.md +8 -1
- package/docs/COW_INVARIANTS.md +11 -2
- package/docs/CREDENTIAL_SECURITY.md +26 -0
- package/docs/DEXBOT_COMPARISON.md +4 -4
- package/docs/EVOLUTION.md +20 -18
- package/docs/FUND_MOVEMENT_AND_ACCOUNTING.md +1 -1
- package/docs/GRID_PRICE_INVARIANT.md +204 -31
- package/docs/GRID_RECALCULATION.md +12 -0
- package/docs/LOGGING.md +17 -2
- package/docs/ORDER_ENGINE_POST_1.0_RETROSPECTIVE.md +6 -7
- package/docs/README.md +3 -1
- package/docs/WORKFLOW.md +16 -5
- package/market_adapter/README.md +1 -1
- package/modules/README.md +18 -1
- package/package.json +14 -6
- package/scripts/README.md +28 -2
- package/scripts/clear-all.sh +13 -4
- package/scripts/clear-logs.sh +13 -4
- package/scripts/clear-market-adapter.sh +6 -0
- package/scripts/clear-orders.sh +5 -0
- package/scripts/lib/dexbot-paths.sh +108 -0
- package/tests/README.md +11 -3
- package/analysis/account_resolver.ts +0 -161
- package/analysis/ama_fitting/analyze_ama_price_changes.ts +0 -155
- package/analysis/ama_fitting/analyze_lambda_vs_slow.ts +0 -404
- package/analysis/ama_fitting/calibrate_convergence_er.ts +0 -201
- package/analysis/ama_fitting/fetch_lp_candles.ts +0 -184
- package/analysis/ama_fitting/generate_unified_comparison_chart.ts +0 -232
- package/analysis/ama_fitting/optimizer_high_resolution.ts +0 -802
- package/analysis/analyze_dynamic_weight.ts +0 -243
- package/analysis/analyze_kalman.ts +0 -157
- package/analysis/analyze_regime.ts +0 -158
- package/analysis/analyze_regime_windows.ts +0 -470
- package/analysis/analyze_risk_profile.ts +0 -199
- package/analysis/analyze_trade_heatmap.ts +0 -362
- package/analysis/analyze_volatility.ts +0 -182
- package/analysis/bot_fitting/backtest_ama_sweep.ts +0 -934
- package/analysis/bot_fitting/backtest_bot_fitting.ts +0 -861
- package/analysis/bot_fitting/shared_utils.ts +0 -52
- package/analysis/bot_key_utils.ts +0 -426
- package/analysis/bot_usage/discover_bot_accounts.ts +0 -635
- package/analysis/bot_usage/kibana_bot_queries.ts +0 -211
- package/analysis/chain_pool.ts +0 -47
- package/analysis/chart_css.ts +0 -62
- package/analysis/chart_ui.ts +0 -105
- package/analysis/chart_utils.ts +0 -210
- package/analysis/fills_source.ts +0 -228
- package/analysis/grid_correction_check.ts +0 -786
- package/analysis/math_utils.ts +0 -53
- package/analysis/price_sources.ts +0 -136
- package/analysis/resolve_bot_accounts.ts +0 -199
- package/analysis/resolve_source.ts +0 -99
- package/analysis/results/ama_sweep_results_lp_pool_133_1h.json +0 -2455
- package/analysis/results/bot_fitting_results_lp_pool_133_1h.json +0 -218
- package/analysis/trade_profitability.ts +0 -1335
- package/analysis/tradingview/analyze_tradingview.ts +0 -280
- package/analysis/tradingview/h-bts_tradingview.html +0 -1570
- package/analysis/tradingview/t-bts_tradingview.html +0 -1570
- package/analysis/tradingview/tradingview_uplot_chart_generator.ts +0 -3268
- package/analysis/trend_detection/dynamic_weight_chart_generator.ts +0 -1481
- package/analysis/trend_detection/hurst_analyzer.ts +0 -7
- package/analysis/trend_detection/kalman_chart_generator.ts +0 -398
- package/analysis/trend_detection/kalman_trend_analyzer.ts +0 -9
- package/analysis/trend_detection/kalman_velocity_smoothing.ts +0 -7
- package/analysis/trend_detection/package.json +0 -23
- package/analysis/trend_detection/permutation_entropy_analyzer.ts +0 -7
- package/analysis/trend_detection/regime_chart_generator.ts +0 -338
- package/analysis/trend_detection/tests/test_kalman_trend.ts +0 -153
- package/analysis/trend_detection/tests/test_kalman_velocity_smoothing.ts +0 -64
- package/analysis/trend_detection/volatility_chart_generator.ts +0 -654
- package/analysis/tsconfig.json +0 -29
- package/claw/tests/package.json +0 -3
- package/claw/tests/test_claw_bridge.ts +0 -570
- package/claw/tests/test_claw_catalog_and_credentials.ts +0 -156
- package/claw/tests/test_claw_chain_layer.ts +0 -739
- package/claw/tests/test_claw_data_flow.ts +0 -525
- package/claw/tests/test_claw_domain_logic.ts +0 -471
- package/claw/tests/test_claw_manifest_and_matrix.ts +0 -222
- package/claw/tests/test_claw_mcp_transport.ts +0 -243
- package/claw/tests/test_claw_regressions.ts +0 -711
- package/claw/tests/test_claw_skill_generation.ts +0 -103
- package/claw/tests/test_claw_state_store.ts +0 -44
- package/claw/tests/test_dexbot_profiles.ts +0 -654
- package/claw/tests/test_memu_bridge.ts +0 -189
- package/claw/tests/test_nullclaw_tmp_integration.ts +0 -57
- package/claw/tests/test_position_health.ts +0 -343
- package/claw/tests/test_position_manager.ts +0 -429
- package/claw/tests/test_position_manager_watch_health.ts +0 -100
- package/claw/tests/test_short_mpa_strategy.ts +0 -232
- package/dist/analysis/account_resolver.d.ts.map +0 -1
- package/dist/analysis/account_resolver.js.map +0 -1
- package/dist/analysis/ama_fitting/analyze_ama_price_changes.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/analyze_ama_price_changes.js.map +0 -1
- package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.js.map +0 -1
- package/dist/analysis/ama_fitting/calibrate_convergence_er.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/calibrate_convergence_er.js.map +0 -1
- package/dist/analysis/ama_fitting/fetch_lp_candles.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/fetch_lp_candles.js.map +0 -1
- package/dist/analysis/ama_fitting/generate_unified_comparison_chart.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/generate_unified_comparison_chart.js.map +0 -1
- package/dist/analysis/ama_fitting/optimizer_high_resolution.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/optimizer_high_resolution.js.map +0 -1
- package/dist/analysis/analyze_dynamic_weight.d.ts.map +0 -1
- package/dist/analysis/analyze_dynamic_weight.js.map +0 -1
- package/dist/analysis/analyze_kalman.d.ts.map +0 -1
- package/dist/analysis/analyze_kalman.js.map +0 -1
- package/dist/analysis/analyze_regime.d.ts.map +0 -1
- package/dist/analysis/analyze_regime.js.map +0 -1
- package/dist/analysis/analyze_regime_windows.d.ts.map +0 -1
- package/dist/analysis/analyze_regime_windows.js.map +0 -1
- package/dist/analysis/analyze_risk_profile.d.ts.map +0 -1
- package/dist/analysis/analyze_risk_profile.js.map +0 -1
- package/dist/analysis/analyze_trade_heatmap.d.ts.map +0 -1
- package/dist/analysis/analyze_trade_heatmap.js.map +0 -1
- package/dist/analysis/analyze_volatility.d.ts.map +0 -1
- package/dist/analysis/analyze_volatility.js.map +0 -1
- package/dist/analysis/bot_fitting/backtest_ama_sweep.d.ts.map +0 -1
- package/dist/analysis/bot_fitting/backtest_ama_sweep.js.map +0 -1
- package/dist/analysis/bot_fitting/backtest_bot_fitting.d.ts.map +0 -1
- package/dist/analysis/bot_fitting/backtest_bot_fitting.js.map +0 -1
- package/dist/analysis/bot_fitting/shared_utils.d.ts.map +0 -1
- package/dist/analysis/bot_fitting/shared_utils.js.map +0 -1
- package/dist/analysis/bot_key_utils.d.ts.map +0 -1
- package/dist/analysis/bot_key_utils.js.map +0 -1
- package/dist/analysis/bot_usage/discover_bot_accounts.d.ts.map +0 -1
- package/dist/analysis/bot_usage/discover_bot_accounts.js.map +0 -1
- package/dist/analysis/bot_usage/kibana_bot_queries.d.ts.map +0 -1
- package/dist/analysis/bot_usage/kibana_bot_queries.js.map +0 -1
- package/dist/analysis/chain_pool.d.ts.map +0 -1
- package/dist/analysis/chain_pool.js.map +0 -1
- package/dist/analysis/chart_css.d.ts.map +0 -1
- package/dist/analysis/chart_css.js.map +0 -1
- package/dist/analysis/chart_ui.d.ts.map +0 -1
- package/dist/analysis/chart_ui.js.map +0 -1
- package/dist/analysis/chart_utils.d.ts.map +0 -1
- package/dist/analysis/chart_utils.js.map +0 -1
- package/dist/analysis/fills_source.d.ts.map +0 -1
- package/dist/analysis/fills_source.js.map +0 -1
- package/dist/analysis/grid_correction_check.d.ts.map +0 -1
- package/dist/analysis/grid_correction_check.js.map +0 -1
- package/dist/analysis/math_utils.d.ts.map +0 -1
- package/dist/analysis/math_utils.js.map +0 -1
- package/dist/analysis/price_sources.d.ts.map +0 -1
- package/dist/analysis/price_sources.js.map +0 -1
- package/dist/analysis/resolve_bot_accounts.d.ts.map +0 -1
- package/dist/analysis/resolve_bot_accounts.js.map +0 -1
- package/dist/analysis/resolve_source.d.ts.map +0 -1
- package/dist/analysis/resolve_source.js.map +0 -1
- package/dist/analysis/trade_profitability.d.ts.map +0 -1
- package/dist/analysis/trade_profitability.js.map +0 -1
- package/dist/analysis/tradingview/analyze_tradingview.d.ts.map +0 -1
- package/dist/analysis/tradingview/analyze_tradingview.js.map +0 -1
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.d.ts.map +0 -1
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js.map +0 -1
- package/dist/analysis/trend_detection/dynamic_weight_chart_generator.d.ts.map +0 -1
- package/dist/analysis/trend_detection/dynamic_weight_chart_generator.js.map +0 -1
- package/dist/analysis/trend_detection/hurst_analyzer.d.ts.map +0 -1
- package/dist/analysis/trend_detection/hurst_analyzer.js.map +0 -1
- package/dist/analysis/trend_detection/kalman_chart_generator.d.ts.map +0 -1
- package/dist/analysis/trend_detection/kalman_chart_generator.js.map +0 -1
- package/dist/analysis/trend_detection/kalman_trend_analyzer.d.ts.map +0 -1
- package/dist/analysis/trend_detection/kalman_trend_analyzer.js.map +0 -1
- package/dist/analysis/trend_detection/kalman_velocity_smoothing.d.ts.map +0 -1
- package/dist/analysis/trend_detection/kalman_velocity_smoothing.js.map +0 -1
- package/dist/analysis/trend_detection/permutation_entropy_analyzer.d.ts.map +0 -1
- package/dist/analysis/trend_detection/permutation_entropy_analyzer.js.map +0 -1
- package/dist/analysis/trend_detection/regime_chart_generator.d.ts.map +0 -1
- package/dist/analysis/trend_detection/regime_chart_generator.js.map +0 -1
- package/dist/analysis/trend_detection/tests/test_kalman_trend.d.ts +0 -2
- package/dist/analysis/trend_detection/tests/test_kalman_trend.d.ts.map +0 -1
- package/dist/analysis/trend_detection/tests/test_kalman_trend.js +0 -128
- package/dist/analysis/trend_detection/tests/test_kalman_trend.js.map +0 -1
- package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.d.ts +0 -2
- package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.d.ts.map +0 -1
- package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.js +0 -37
- package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.js.map +0 -1
- package/dist/analysis/trend_detection/volatility_chart_generator.d.ts.map +0 -1
- package/dist/analysis/trend_detection/volatility_chart_generator.js.map +0 -1
- package/dist/bot.d.ts.map +0 -1
- package/dist/bot.js.map +0 -1
- package/dist/credential-daemon.d.ts.map +0 -1
- package/dist/credential-daemon.js.map +0 -1
- package/dist/dexbot.d.ts.map +0 -1
- package/dist/dexbot.js.map +0 -1
- package/dist/market_adapter/ama_signal_runner.d.ts.map +0 -1
- package/dist/market_adapter/ama_signal_runner.js.map +0 -1
- package/dist/market_adapter/candle_utils.d.ts.map +0 -1
- package/dist/market_adapter/candle_utils.js.map +0 -1
- package/dist/market_adapter/core/asymmetric_bounds.d.ts.map +0 -1
- package/dist/market_adapter/core/asymmetric_bounds.js.map +0 -1
- package/dist/market_adapter/core/config_normalizers.d.ts.map +0 -1
- package/dist/market_adapter/core/config_normalizers.js.map +0 -1
- package/dist/market_adapter/core/kibana_candles.d.ts.map +0 -1
- package/dist/market_adapter/core/kibana_candles.js.map +0 -1
- package/dist/market_adapter/core/kibana_client.d.ts.map +0 -1
- package/dist/market_adapter/core/kibana_client.js.map +0 -1
- package/dist/market_adapter/core/kibana_market_candles.d.ts.map +0 -1
- package/dist/market_adapter/core/kibana_market_candles.js.map +0 -1
- package/dist/market_adapter/core/market_adapter_service.d.ts.map +0 -1
- package/dist/market_adapter/core/market_adapter_service.js.map +0 -1
- package/dist/market_adapter/core/signals/hurst_analyzer.d.ts.map +0 -1
- package/dist/market_adapter/core/signals/hurst_analyzer.js.map +0 -1
- package/dist/market_adapter/core/signals/kalman_trend_analyzer.d.ts.map +0 -1
- package/dist/market_adapter/core/signals/kalman_trend_analyzer.js.map +0 -1
- package/dist/market_adapter/core/signals/kalman_velocity_smoothing.d.ts.map +0 -1
- package/dist/market_adapter/core/signals/kalman_velocity_smoothing.js.map +0 -1
- package/dist/market_adapter/core/signals/permutation_entropy_analyzer.d.ts.map +0 -1
- package/dist/market_adapter/core/signals/permutation_entropy_analyzer.js.map +0 -1
- package/dist/market_adapter/core/strategies/ama.d.ts.map +0 -1
- package/dist/market_adapter/core/strategies/ama.js.map +0 -1
- package/dist/market_adapter/core/strategies/ama_slope_model.d.ts.map +0 -1
- package/dist/market_adapter/core/strategies/ama_slope_model.js.map +0 -1
- package/dist/market_adapter/core/strategies/atr/calculator.d.ts.map +0 -1
- package/dist/market_adapter/core/strategies/atr/calculator.js.map +0 -1
- package/dist/market_adapter/core/strategies/collateral_manager.d.ts.map +0 -1
- package/dist/market_adapter/core/strategies/collateral_manager.js.map +0 -1
- package/dist/market_adapter/core/strategies/dynamic_weight_series.d.ts.map +0 -1
- package/dist/market_adapter/core/strategies/dynamic_weight_series.js.map +0 -1
- package/dist/market_adapter/core/strategies/regime_gate.d.ts.map +0 -1
- package/dist/market_adapter/core/strategies/regime_gate.js.map +0 -1
- package/dist/market_adapter/core/strategies/regime_interp.d.ts.map +0 -1
- package/dist/market_adapter/core/strategies/regime_interp.js.map +0 -1
- package/dist/market_adapter/core/strategies/volatility_shift.d.ts.map +0 -1
- package/dist/market_adapter/core/strategies/volatility_shift.js.map +0 -1
- package/dist/market_adapter/inputs/fetch_book_data.d.ts.map +0 -1
- package/dist/market_adapter/inputs/fetch_book_data.js.map +0 -1
- package/dist/market_adapter/inputs/fetch_cex_synthetic_data.d.ts.map +0 -1
- package/dist/market_adapter/inputs/fetch_cex_synthetic_data.js.map +0 -1
- package/dist/market_adapter/inputs/fetch_lp_data.d.ts.map +0 -1
- package/dist/market_adapter/inputs/fetch_lp_data.js.map +0 -1
- package/dist/market_adapter/inputs/kibana_feed_source.d.ts.map +0 -1
- package/dist/market_adapter/inputs/kibana_feed_source.js.map +0 -1
- package/dist/market_adapter/inputs/kibana_source.d.ts.map +0 -1
- package/dist/market_adapter/inputs/kibana_source.js.map +0 -1
- package/dist/market_adapter/inputs/window_cache.d.ts.map +0 -1
- package/dist/market_adapter/inputs/window_cache.js.map +0 -1
- package/dist/market_adapter/interval_utils.d.ts.map +0 -1
- package/dist/market_adapter/interval_utils.js.map +0 -1
- package/dist/market_adapter/log_format.d.ts.map +0 -1
- package/dist/market_adapter/log_format.js.map +0 -1
- package/dist/market_adapter/lp_chart_core.d.ts.map +0 -1
- package/dist/market_adapter/lp_chart_core.js.map +0 -1
- package/dist/market_adapter/lp_chart_runner.d.ts.map +0 -1
- package/dist/market_adapter/lp_chart_runner.js.map +0 -1
- package/dist/market_adapter/lp_chart_strategy_loader.d.ts.map +0 -1
- package/dist/market_adapter/lp_chart_strategy_loader.js.map +0 -1
- package/dist/market_adapter/market_adapter.d.ts.map +0 -1
- package/dist/market_adapter/market_adapter.js.map +0 -1
- package/dist/market_adapter/test_helpers.d.ts.map +0 -1
- package/dist/market_adapter/test_helpers.js.map +0 -1
- package/dist/market_adapter/utils/adapter_client.d.ts.map +0 -1
- package/dist/market_adapter/utils/adapter_client.js.map +0 -1
- package/dist/market_adapter/utils/atomic_write.d.ts.map +0 -1
- package/dist/market_adapter/utils/atomic_write.js.map +0 -1
- package/dist/market_adapter/utils/chain.d.ts.map +0 -1
- package/dist/market_adapter/utils/chain.js.map +0 -1
- package/dist/market_adapter/utils/data_discovery.d.ts.map +0 -1
- package/dist/market_adapter/utils/data_discovery.js.map +0 -1
- package/dist/market_adapter/utils/dynamic_grid_snapshot.d.ts.map +0 -1
- package/dist/market_adapter/utils/dynamic_grid_snapshot.js.map +0 -1
- package/dist/market_adapter/utils/file_lock.d.ts.map +0 -1
- package/dist/market_adapter/utils/file_lock.js.map +0 -1
- package/dist/market_adapter/utils/native_history.d.ts.map +0 -1
- package/dist/market_adapter/utils/native_history.js.map +0 -1
- package/dist/modules/account_bots.d.ts.map +0 -1
- package/dist/modules/account_bots.js.map +0 -1
- package/dist/modules/account_orders.d.ts.map +0 -1
- package/dist/modules/account_orders.js.map +0 -1
- package/dist/modules/authority_resolver.d.ts.map +0 -1
- package/dist/modules/authority_resolver.js.map +0 -1
- package/dist/modules/bitshares-native/chain_client.d.ts.map +0 -1
- package/dist/modules/bitshares-native/chain_client.js.map +0 -1
- package/dist/modules/bitshares-native/crypto/ecc.browser.d.ts.map +0 -1
- package/dist/modules/bitshares-native/crypto/ecc.browser.js.map +0 -1
- package/dist/modules/bitshares-native/crypto/ecc.d.ts.map +0 -1
- package/dist/modules/bitshares-native/crypto/ecc.js.map +0 -1
- package/dist/modules/bitshares-native/crypto/ecc_selector.d.ts.map +0 -1
- package/dist/modules/bitshares-native/crypto/ecc_selector.js.map +0 -1
- package/dist/modules/bitshares-native/index.d.ts.map +0 -1
- package/dist/modules/bitshares-native/index.js.map +0 -1
- package/dist/modules/bitshares-native/lru_cache.d.ts.map +0 -1
- package/dist/modules/bitshares-native/lru_cache.js.map +0 -1
- package/dist/modules/bitshares-native/resolvers.d.ts.map +0 -1
- package/dist/modules/bitshares-native/resolvers.js.map +0 -1
- package/dist/modules/bitshares-native/serial/chain_constants.d.ts.map +0 -1
- package/dist/modules/bitshares-native/serial/chain_constants.js.map +0 -1
- package/dist/modules/bitshares-native/serial/index.d.ts.map +0 -1
- package/dist/modules/bitshares-native/serial/index.js.map +0 -1
- package/dist/modules/bitshares-native/serial/operations.d.ts.map +0 -1
- package/dist/modules/bitshares-native/serial/operations.js.map +0 -1
- package/dist/modules/bitshares-native/serial/serializer.d.ts.map +0 -1
- package/dist/modules/bitshares-native/serial/serializer.js.map +0 -1
- package/dist/modules/bitshares-native/serial/types.d.ts.map +0 -1
- package/dist/modules/bitshares-native/serial/types.js.map +0 -1
- package/dist/modules/bitshares-native/signing_client.d.ts.map +0 -1
- package/dist/modules/bitshares-native/signing_client.js.map +0 -1
- package/dist/modules/bitshares-native/subscriptions.d.ts.map +0 -1
- package/dist/modules/bitshares-native/subscriptions.js.map +0 -1
- package/dist/modules/bitshares-native/transport.d.ts.map +0 -1
- package/dist/modules/bitshares-native/transport.js.map +0 -1
- package/dist/modules/bitshares-native/tx/builder.d.ts.map +0 -1
- package/dist/modules/bitshares-native/tx/builder.js.map +0 -1
- package/dist/modules/bitshares-native/tx/tx_cache.d.ts.map +0 -1
- package/dist/modules/bitshares-native/tx/tx_cache.js.map +0 -1
- package/dist/modules/bitshares_client.d.ts.map +0 -1
- package/dist/modules/bitshares_client.js.map +0 -1
- package/dist/modules/bot_defaults.d.ts.map +0 -1
- package/dist/modules/bot_defaults.js.map +0 -1
- package/dist/modules/bot_settings.d.ts.map +0 -1
- package/dist/modules/bot_settings.js.map +0 -1
- package/dist/modules/bots_file_lock.d.ts.map +0 -1
- package/dist/modules/bots_file_lock.js.map +0 -1
- package/dist/modules/broadcast_failure.d.ts.map +0 -1
- package/dist/modules/broadcast_failure.js.map +0 -1
- package/dist/modules/chain_keys.d.ts.map +0 -1
- package/dist/modules/chain_keys.js.map +0 -1
- package/dist/modules/chain_orders.d.ts.map +0 -1
- package/dist/modules/chain_orders.js.map +0 -1
- package/dist/modules/cli_colors.d.ts.map +0 -1
- package/dist/modules/cli_colors.js.map +0 -1
- package/dist/modules/config.d.ts.map +0 -1
- package/dist/modules/config.js.map +0 -1
- package/dist/modules/constants.d.ts.map +0 -1
- package/dist/modules/constants.js.map +0 -1
- package/dist/modules/cr_planner.d.ts.map +0 -1
- package/dist/modules/cr_planner.js.map +0 -1
- package/dist/modules/credential_policy.d.ts.map +0 -1
- package/dist/modules/credential_policy.js.map +0 -1
- package/dist/modules/credential_runtime.d.ts.map +0 -1
- package/dist/modules/credential_runtime.js.map +0 -1
- package/dist/modules/credential_session_cache.d.ts.map +0 -1
- package/dist/modules/credential_session_cache.js.map +0 -1
- package/dist/modules/credit_pricing.d.ts.map +0 -1
- package/dist/modules/credit_pricing.js.map +0 -1
- package/dist/modules/credit_runtime.d.ts.map +0 -1
- package/dist/modules/credit_runtime.js.map +0 -1
- package/dist/modules/crypto/browser_provider.d.ts.map +0 -1
- package/dist/modules/crypto/browser_provider.js.map +0 -1
- package/dist/modules/crypto/index.d.ts.map +0 -1
- package/dist/modules/crypto/index.js.map +0 -1
- package/dist/modules/crypto/node_provider.d.ts.map +0 -1
- package/dist/modules/crypto/node_provider.js.map +0 -1
- package/dist/modules/crypto/provider.d.ts.map +0 -1
- package/dist/modules/crypto/provider.js.map +0 -1
- package/dist/modules/crypto/pure_ripemd160.d.ts.map +0 -1
- package/dist/modules/crypto/pure_ripemd160.js.map +0 -1
- package/dist/modules/crypto/pure_scrypt.d.ts.map +0 -1
- package/dist/modules/crypto/pure_scrypt.js.map +0 -1
- package/dist/modules/crypto/pure_secp256k1.d.ts.map +0 -1
- package/dist/modules/crypto/pure_secp256k1.js.map +0 -1
- package/dist/modules/crypto/sync.d.ts.map +0 -1
- package/dist/modules/crypto/sync.js.map +0 -1
- package/dist/modules/daemon_node_health.d.ts.map +0 -1
- package/dist/modules/daemon_node_health.js.map +0 -1
- package/dist/modules/dexbot_class.d.ts.map +0 -1
- package/dist/modules/dexbot_class.js.map +0 -1
- package/dist/modules/dexbot_cow_runtime.d.ts.map +0 -1
- package/dist/modules/dexbot_cow_runtime.js.map +0 -1
- package/dist/modules/dexbot_credential_client.d.ts.map +0 -1
- package/dist/modules/dexbot_credential_client.js.map +0 -1
- package/dist/modules/dexbot_fill_runtime.d.ts.map +0 -1
- package/dist/modules/dexbot_fill_runtime.js.map +0 -1
- package/dist/modules/dexbot_maintenance_runtime.d.ts.map +0 -1
- package/dist/modules/dexbot_maintenance_runtime.js.map +0 -1
- package/dist/modules/dexbot_startup_runtime.d.ts.map +0 -1
- package/dist/modules/dexbot_startup_runtime.js.map +0 -1
- package/dist/modules/dexbot_state_recovery.d.ts.map +0 -1
- package/dist/modules/dexbot_state_recovery.js.map +0 -1
- package/dist/modules/env.d.ts.map +0 -1
- package/dist/modules/env.js.map +0 -1
- package/dist/modules/fund_registry.d.ts.map +0 -1
- package/dist/modules/fund_registry.js.map +0 -1
- package/dist/modules/general_settings.d.ts.map +0 -1
- package/dist/modules/general_settings.js.map +0 -1
- package/dist/modules/graceful_shutdown.d.ts.map +0 -1
- package/dist/modules/graceful_shutdown.js.map +0 -1
- package/dist/modules/grid_price_source.d.ts.map +0 -1
- package/dist/modules/grid_price_source.js.map +0 -1
- package/dist/modules/key_store.d.ts.map +0 -1
- package/dist/modules/key_store.js.map +0 -1
- package/dist/modules/launcher/adapter_requirement.d.ts.map +0 -1
- package/dist/modules/launcher/adapter_requirement.js.map +0 -1
- package/dist/modules/launcher/bot_supervisor.d.ts.map +0 -1
- package/dist/modules/launcher/bot_supervisor.js.map +0 -1
- package/dist/modules/launcher/child_env.d.ts.map +0 -1
- package/dist/modules/launcher/child_env.js.map +0 -1
- package/dist/modules/launcher/credential_bootstrap.d.ts.map +0 -1
- package/dist/modules/launcher/credential_bootstrap.js.map +0 -1
- package/dist/modules/launcher/credential_daemon.d.ts.map +0 -1
- package/dist/modules/launcher/credential_daemon.js.map +0 -1
- package/dist/modules/launcher/credential_secret.d.ts.map +0 -1
- package/dist/modules/launcher/credential_secret.js.map +0 -1
- package/dist/modules/launcher/foreign_cred_daemon.d.ts.map +0 -1
- package/dist/modules/launcher/foreign_cred_daemon.js.map +0 -1
- package/dist/modules/launcher/headless_password.d.ts.map +0 -1
- package/dist/modules/launcher/headless_password.js.map +0 -1
- package/dist/modules/launcher/launch_modes.d.ts.map +0 -1
- package/dist/modules/launcher/launch_modes.js.map +0 -1
- package/dist/modules/launcher/market_adapter_runtime.d.ts.map +0 -1
- package/dist/modules/launcher/market_adapter_runtime.js.map +0 -1
- package/dist/modules/launcher/market_adapter_watchdog.d.ts.map +0 -1
- package/dist/modules/launcher/market_adapter_watchdog.js.map +0 -1
- package/dist/modules/launcher/monolithic_runtime.d.ts.map +0 -1
- package/dist/modules/launcher/monolithic_runtime.js.map +0 -1
- package/dist/modules/launcher/runtime_entry.d.ts.map +0 -1
- package/dist/modules/launcher/runtime_entry.js.map +0 -1
- package/dist/modules/launcher/status_reporting.d.ts.map +0 -1
- package/dist/modules/launcher/status_reporting.js.map +0 -1
- package/dist/modules/launcher/supervisor_control.d.ts.map +0 -1
- package/dist/modules/launcher/supervisor_control.js.map +0 -1
- package/dist/modules/market_adapter_whitelist.d.ts.map +0 -1
- package/dist/modules/market_adapter_whitelist.js.map +0 -1
- package/dist/modules/node_connect_policy.d.ts.map +0 -1
- package/dist/modules/node_connect_policy.js.map +0 -1
- package/dist/modules/node_failure_ledger.d.ts.map +0 -1
- package/dist/modules/node_failure_ledger.js.map +0 -1
- package/dist/modules/node_health_cache.d.ts.map +0 -1
- package/dist/modules/node_health_cache.js.map +0 -1
- package/dist/modules/node_manager.d.ts.map +0 -1
- package/dist/modules/node_manager.js.map +0 -1
- package/dist/modules/order/accounting.d.ts.map +0 -1
- package/dist/modules/order/accounting.js.map +0 -1
- package/dist/modules/order/async_lock.d.ts.map +0 -1
- package/dist/modules/order/async_lock.js.map +0 -1
- package/dist/modules/order/export.d.ts.map +0 -1
- package/dist/modules/order/export.js.map +0 -1
- package/dist/modules/order/format.d.ts.map +0 -1
- package/dist/modules/order/format.js.map +0 -1
- package/dist/modules/order/grid.d.ts.map +0 -1
- package/dist/modules/order/grid.js.map +0 -1
- package/dist/modules/order/grid_reconcile.d.ts.map +0 -1
- package/dist/modules/order/grid_reconcile.js.map +0 -1
- package/dist/modules/order/grid_reconcile_internal.d.ts.map +0 -1
- package/dist/modules/order/grid_reconcile_internal.js.map +0 -1
- package/dist/modules/order/index.d.ts.map +0 -1
- package/dist/modules/order/index.js.map +0 -1
- package/dist/modules/order/logger.d.ts.map +0 -1
- package/dist/modules/order/logger.js.map +0 -1
- package/dist/modules/order/logger_state.d.ts.map +0 -1
- package/dist/modules/order/logger_state.js.map +0 -1
- package/dist/modules/order/manager.d.ts.map +0 -1
- package/dist/modules/order/manager.js.map +0 -1
- package/dist/modules/order/processed_fill_store.d.ts.map +0 -1
- package/dist/modules/order/processed_fill_store.js.map +0 -1
- package/dist/modules/order/strategy.d.ts.map +0 -1
- package/dist/modules/order/strategy.js.map +0 -1
- package/dist/modules/order/sync_engine.d.ts.map +0 -1
- package/dist/modules/order/sync_engine.js.map +0 -1
- package/dist/modules/order/utils/math.d.ts.map +0 -1
- package/dist/modules/order/utils/math.js.map +0 -1
- package/dist/modules/order/utils/order.d.ts.map +0 -1
- package/dist/modules/order/utils/order.js.map +0 -1
- package/dist/modules/order/utils/slot.d.ts.map +0 -1
- package/dist/modules/order/utils/slot.js.map +0 -1
- package/dist/modules/order/utils/system.d.ts.map +0 -1
- package/dist/modules/order/utils/system.js.map +0 -1
- package/dist/modules/order/utils/timeout.d.ts.map +0 -1
- package/dist/modules/order/utils/timeout.js.map +0 -1
- package/dist/modules/order/utils/validate.d.ts.map +0 -1
- package/dist/modules/order/utils/validate.js.map +0 -1
- package/dist/modules/order/utils/withPoolRef.d.ts.map +0 -1
- package/dist/modules/order/utils/withPoolRef.js.map +0 -1
- package/dist/modules/order/working_grid.d.ts.map +0 -1
- package/dist/modules/order/working_grid.js.map +0 -1
- package/dist/modules/path_api.d.ts.map +0 -1
- package/dist/modules/path_api.js.map +0 -1
- package/dist/modules/paths.d.ts.map +0 -1
- package/dist/modules/paths.js.map +0 -1
- package/dist/modules/process_discovery.d.ts.map +0 -1
- package/dist/modules/process_discovery.js.map +0 -1
- package/dist/modules/runtime.d.ts.map +0 -1
- package/dist/modules/runtime.js.map +0 -1
- package/dist/modules/runtime_settings.d.ts.map +0 -1
- package/dist/modules/runtime_settings.js.map +0 -1
- package/dist/modules/settings_merge.d.ts.map +0 -1
- package/dist/modules/settings_merge.js.map +0 -1
- package/dist/modules/socket_json_client.d.ts.map +0 -1
- package/dist/modules/socket_json_client.js.map +0 -1
- package/dist/modules/storage/browser_adapter.d.ts.map +0 -1
- package/dist/modules/storage/browser_adapter.js.map +0 -1
- package/dist/modules/storage/index.d.ts.map +0 -1
- package/dist/modules/storage/index.js.map +0 -1
- package/dist/modules/storage/node_adapter.d.ts.map +0 -1
- package/dist/modules/storage/node_adapter.js.map +0 -1
- package/dist/modules/storage/types.d.ts.map +0 -1
- package/dist/modules/storage/types.js.map +0 -1
- package/dist/modules/types.d.ts.map +0 -1
- package/dist/modules/types.js.map +0 -1
- package/dist/modules/utils/base58check.d.ts.map +0 -1
- package/dist/modules/utils/base58check.js.map +0 -1
- package/dist/modules/utils/build_dir.d.ts.map +0 -1
- package/dist/modules/utils/build_dir.js.map +0 -1
- package/dist/modules/utils/chain_logs.d.ts.map +0 -1
- package/dist/modules/utils/chain_logs.js.map +0 -1
- package/dist/modules/utils/errors.d.ts.map +0 -1
- package/dist/modules/utils/errors.js.map +0 -1
- package/dist/modules/utils/sanitize_key.d.ts.map +0 -1
- package/dist/modules/utils/sanitize_key.js.map +0 -1
- package/dist/modules/validate_profiles.d.ts.map +0 -1
- package/dist/modules/validate_profiles.js.map +0 -1
- package/dist/pm2.d.ts.map +0 -1
- package/dist/pm2.js.map +0 -1
- package/dist/scripts/analyze-credit.d.ts.map +0 -1
- package/dist/scripts/analyze-credit.js.map +0 -1
- package/dist/scripts/analyze-git.d.ts.map +0 -1
- package/dist/scripts/analyze-git.js.map +0 -1
- package/dist/scripts/analyze-orders.d.ts.map +0 -1
- package/dist/scripts/analyze-orders.js.map +0 -1
- package/dist/scripts/chart_command.d.ts.map +0 -1
- package/dist/scripts/chart_command.js.map +0 -1
- package/dist/scripts/diagnose-kibana-candles.d.ts.map +0 -1
- package/dist/scripts/diagnose-kibana-candles.js.map +0 -1
- package/dist/scripts/diagnose-pool-history.d.ts.map +0 -1
- package/dist/scripts/diagnose-pool-history.js.map +0 -1
- package/dist/scripts/divergence-calc.d.ts.map +0 -1
- package/dist/scripts/divergence-calc.js.map +0 -1
- package/dist/scripts/dw.d.ts.map +0 -1
- package/dist/scripts/dw.js.map +0 -1
- package/dist/scripts/generate_lp_chart.d.ts.map +0 -1
- package/dist/scripts/generate_lp_chart.js.map +0 -1
- package/dist/scripts/generate_mainnet_corpus_report.d.ts.map +0 -1
- package/dist/scripts/generate_mainnet_corpus_report.js.map +0 -1
- package/dist/scripts/native_release_gates.d.ts.map +0 -1
- package/dist/scripts/native_release_gates.js.map +0 -1
- package/dist/scripts/print_grid.d.ts.map +0 -1
- package/dist/scripts/print_grid.js.map +0 -1
- package/dist/scripts/run-tests.d.ts.map +0 -1
- package/dist/scripts/run-tests.js.map +0 -1
- package/dist/scripts/runner.d.ts.map +0 -1
- package/dist/scripts/runner.js.map +0 -1
- package/dist/scripts/sync-version.d.ts.map +0 -1
- package/dist/scripts/sync-version.js.map +0 -1
- package/dist/scripts/test-credit-renewal.d.ts.map +0 -1
- package/dist/scripts/test-credit-renewal.js.map +0 -1
- package/dist/scripts/tv.d.ts.map +0 -1
- package/dist/scripts/tv.js.map +0 -1
- package/dist/scripts/update.d.ts.map +0 -1
- package/dist/scripts/update.js.map +0 -1
- package/dist/scripts/update_dist_freshness.d.ts.map +0 -1
- package/dist/scripts/update_dist_freshness.js.map +0 -1
- package/dist/scripts/validate_bots.d.ts.map +0 -1
- package/dist/scripts/validate_bots.js.map +0 -1
- package/dist/scripts/verify-browser-bundle.d.ts.map +0 -1
- package/dist/scripts/verify-browser-bundle.js.map +0 -1
- package/dist/unlock.d.ts.map +0 -1
- package/dist/unlock.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,10 +2,98 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## [1.6.
|
|
5
|
+
## [1.6.8] - 2026-09-28 - Correction-Drain Bounds, PM2 Log Capture, Version Notice, Genesis Refusal & Legacy Matcher Removal, TV Grid-Reset Replay & Packaging Trim
|
|
6
|
+
|
|
7
|
+
### 2026-09-26
|
|
8
|
+
|
|
9
|
+
- **Fix(concurrency)**: bound the price-correction drain and keep timer lock-waiters out of long broadcast regions — `correctAllPriceMismatches` held `_gridLock` (no acquisition timeout) across every queued correction, running price updates sequentially with `SYNC_DELAY_MS` between each, so a large `ordersNeedingPriceCorrection` backlog could hold the lock for minutes while every concurrent actor died at the 20s fill-lock timeout. Cancel-class entries (duplicate orphans / surplus / type mismatch) are still fully drained — batched, zero-delay, fund-safety-critical — but the sequential update loop is now capped at `FILL_PROCESSING.CORRECTION_MAX_UPDATES_PER_CYCLE` (default 5); the unselected remainder stays queued durably and re-drains next cycle, keeping its queue position so newer entries cannot be starved. A rate-limited backlog alarm (`CORRECTION_QUEUE_WARN_THRESHOLD` default 10, `CORRECTION_QUEUE_WARN_RATE_LIMIT_MS` 5 min) fires even while the drain defers, which is exactly when the queue is growing. The drain also defers *before* acquiring `_gridLock` when `isBroadcastingActive()`, and the maintenance timer loops (open-orders sync, periodic blockchain fetch) get the same pre-acquire deferral via `shouldDeferMaintenanceForBroadcast`; that helper is age-bounded by `BROADCAST_STALE_CLEAR_MS` so a leaked broadcast flag still lets the periodic tick through to run `_clearStaleBroadcastFlag` (deferring on a stale flag would otherwise remove the only watchdog that clears it). `TIMING.FILL_BROADCAST_DEFER_MAX_MS` is now derived as `max(configured, BROADCAST_STALE_CLEAR_MS + 30s)` so a legitimately long startup reconcile Phase 2 cannot outlast the fill-consumer deferral and drop it into the in-lock wait, and the deferral bound re-arms whenever `manager._broadcastingStartedAt` advances (a live region) while a frozen flag still trips the fallback. Startup create-group execution yields to the event loop between groups (`setTimeout(0)`, browser-safe) so the region's timers/watchdogs (region-end reschedule, `_awaitBroadcastIdle`, stale-flag clear) are not starved. Behavioral impact: a correction backlog no longer monopolizes `_gridLock`; fills/corrections still drain, bounded per cycle; the broadcast-deferral bound now outlasts the stale-flag watchdog it depends on; a leaked broadcast flag still self-heals. Risk: only the sequential price-update loop is budgeted, so a very large update backlog drains over multiple cycles (`modules/order/utils/order.ts`, `modules/constants.ts`, `modules/dexbot_fill_runtime.ts`, `modules/dexbot_maintenance_runtime.ts`, `modules/order/grid_reconcile_internal.ts`, `modules/order/manager.ts`, `tests/test_correction_queue_staleness.ts`, `tests/test_fill_pipeline_robustness.ts`, `tests/test_lock_bypass_guards.ts`).
|
|
10
|
+
|
|
11
|
+
- **Refactor(concurrency)**: make the correction-drain bound time-based and harden the grid-lock/deferral invariants — `CORRECTION_MAX_UPDATES_PER_CYCLE` bounded a *count* while the invariant it protects is *lock-hold duration* (each update costs `SYNC_DELAY_MS` plus its RPC round-trip, which grows with chain congestion), so the default 5 could still hold `_gridLock` past the 20s fill-lock timeout on a slow chain. New `FILL_PROCESSING.CORRECTION_LOCK_HOLD_BUDGET_MS` (default 4000) is the primary bound: the sequential update loop stops pulling entries once the elapsed window closes, and `CORRECTION_MAX_UPDATES_PER_CYCLE` becomes an optional hard cap (default null = uncapped count; 0 = drain no updates). Cancel-class entries stay unbudgeted. `AsyncLock.heldForMs()` now exposes live hold duration and `checkGridLockHoldDuration` runs on every maintenance tick, emitting a rate-limited `[GRID-LOCK]` warn when `_gridLock` is held past `TIMING.GRID_LOCK_HOLD_WARN_MS` (default 15s) — observational only, because a mutating lock cannot be force-released safely. `BROADCAST_STALE_CLEAR_MS` is now the single authority for both deferral bounds: `FILL_BROADCAST_DEFER_MAX_MS` is derived as `staleClear + TIMING.BROADCAST_DEFER_SAFETY_MARGIN_MS` (named, default 30s) and a load-time check throws if the ordering invariant is ever violated (`modules/constants.ts`, `modules/order/utils/order.ts`, `modules/order/async_lock.ts`, `modules/dexbot_maintenance_runtime.ts`, `tests/test_correction_queue_staleness.ts`, `tests/test_async_lock_force_release.ts`, `tests/test_lock_bypass_guards.ts`).
|
|
12
|
+
|
|
13
|
+
- **Fix(logging)**: restore PM2 log output — the `Logger` stacked two independent suppressions: it auto-quieted console output whenever PM2 log paths were present (`quietUnderPm2` defaulted true) **and** skipped its own file writes under PM2, so every line from a PM2-managed bot, the credential daemon, and the module loggers was dropped (the content in `profiles/logs/*.log` came from non-PM2 runs; PM2's own `out_file`s stayed empty). The constructor no longer auto-quiets: under PM2 stdout is the only sink and PM2's `log_date_format` supplies the timestamp, while non-PM2 runs with a `logFile` stay console-quiet to avoid duplicate output. `quietUnderPm2: true` remains as an explicit opt-in to the legacy silent behaviour, and new `isPm2LogCaptureActive()` centralizes the `pm_out_log_path`/`pm_err_log_path` predicate shared by the constructor and `_enqueueWrite` (`modules/order/logger.ts`, `tests/test_logger.ts`).
|
|
14
|
+
|
|
15
|
+
- **Fix(pm2)**: enable real log rotation — PM2 core ignores the per-app `max_size` option, so PM2-owned log files were never rotated. The launcher now installs and configures `pm2-logrotate` (100M per file, retain 10, compressed) on first start; detection via `pm2 jlist` keeps it idempotent and the step is best-effort with timeouts so startup never blocks on a failed install. New `runPm2Raw()` covers the module-management verbs (`jlist`/`install`/`set`) that fall outside `execPM2Command`'s process-control whitelist (`pm2.ts`, `docs/LOGGING.md`).
|
|
16
|
+
|
|
17
|
+
- **Docs**: close the changelog gaps and realign stale references - an audit of the 1.6.5..1.6.6 range found three shipped housekeeping commits documented nowhere (their entries are now filed under [1.6.6], whose title also gained the sweep), and the same staleness pass found published docs describing the pre-1.6.7 guard and the removed key-manager abort path instead of the shipped behaviour: `docs/GRID_PRICE_INVARIANT.md` now carries the pivot snapshot contract (persist with the grid, restore with the boundary, provenance gate, validation chain, generation invalidation), `docs/CREDENTIAL_SECURITY.md` states the cancellation contract (Escape is not a wrong password; a complete account key is a usable account, not password metadata), and `docs/ORDER_ENGINE_POST_1.0_RETROSPECTIVE.md` repoints the boundary invariants and phase statuses at the suites that hold the coverage today. Documentation only, no runtime change (`CHANGELOG.md`, `docs/GRID_PRICE_INVARIANT.md`, `docs/CREDENTIAL_SECURITY.md`, `docs/ORDER_ENGINE_POST_1.0_RETROSPECTIVE.md`, `README.md`).
|
|
18
|
+
|
|
19
|
+
- **Feat(version-notice)**: announce newer DEXBot2 releases on start/pm2 — operators had no way to learn a newer release existed: `UPDATER.ACTIVE` defaults to false by design (a bot handling real funds must never silently change its own code) and the only version comparison lived in `dexbot update`. A passive, never-throwing notice now probes the npm registry once per `UPDATER.NOTICE_INTERVAL_MS` (24h) using a single bounded HTTPS GET (no `npm` subprocess), reports a newer `latest` on `dexbot start`/`pm2`/`status`, and never changes code. Gating is independent of the updater via `UPDATER.NOTICE_ENABLED` (default on); `DEXBOT_SKIP_VERSION_NOTICE=1` silences it for tests/CI. The cache lives in `profiles/version_check.json` (gitignored, atomic write) and records the last probe, the observed latest, and the announced version. `dexbot start`/`pm2` emit from the child launcher (parent/child relocation-notice convention); internal children stay silent (`modules/version_notice.ts`, `dexbot.ts`, `pm2.ts`, `unlock.ts`, `modules/constants.ts`, `modules/paths.ts`, `tests/test_version_notice.ts`).
|
|
20
|
+
|
|
21
|
+
- **Fix(version-notice)**: latch notify-once only after the notice is displayed — the "announced" version was persisted as soon as the probe resolved, so a launcher path that returned without printing (the already-running race window, a startup failure before the success summary) could permanently suppress a hint the operator never saw. The probe now records the observation only; the single `printVersionNotice` path advances the latch, and the latch only ever moves forward so a registry briefly serving an older `latest` (dist-tag rollback) cannot make an announced version reappear. `--dryrun` no longer probes or writes the cache, the missed `unlock.ts` terminal flush is added, and the isolated-foreground launch path prints the notice without awaiting it so the bot start is never delayed. `dexbot status` caps the inline probe at `UPDATER.NOTICE_STATUS_TIMEOUT_MS` (750ms) instead of the 2s default. Hardening: `path.join` for install-kind detection, strict cache field types, and an overridable probe timeout. The probe's timeout is now a race-based hard backstop that resolves even with no `AbortController` or a `fetch` that ignores the abort signal, so a hung registry socket can never stall a terminal `flushVersionNotice` ahead of `process.exit()`; the await+print flush is centralized in the module rather than reimplemented in `unlock.ts` (`modules/version_notice.ts`, `unlock.ts`, `pm2.ts`, `dexbot.ts`, `modules/constants.ts`, `tests/test_version_notice.ts`).
|
|
22
|
+
|
|
23
|
+
- **Feat(version-notice)**: report the installed-vs-published version in `dexbot stat` and on every start — the notice only spoke when a newer release existed, so an operator had no positive confirmation that the running build was current, and `dexbot stat` showed a bare `DEXBot2 vX.Y.Z` line with no verdict. The probe now returns a `VersionStatus` (`up-to-date` / `update-available` / `unknown`) instead of a notice-or-nothing, and ONE renderer (`formatVersionStatusLine`) paints it: green `✓ Your version is up to date.` when the install matches the registry, orange `⬆ A new version is available: vX.Y.Z.` when it does not, gray `? Could not check for a newer version.` when the probe could not answer — an unknown probe is never dressed up as "up to date", because that is exactly the state in which a real update hides. A throttled run (probe already done inside `NOTICE_INTERVAL_MS`) now reports the state from the cached observation instead of returning nothing, so `dexbot stat` answers "am I current?" without spending a request, and an offline node still prints the installed version. The one-time `dexbot update` hint keeps its notify-once latch, so the orange line is shown on every start but the hint repeats only until it is displayed. Centralization: the probe (`startVersionStatusCheck`), the colour/wording (`formatVersionStatusLine`), the hint text and the latch live only in `modules/version_notice.ts`; `unlock.ts`, `pm2.ts` and `dexbot.ts` consume them and cannot drift. The old notice-only entry points (`startVersionNoticeCheck`, `printVersionNotice`) and the pre-rendered `VersionNotice.message` string are REMOVED rather than kept as adapters — they were a second copy of the same wording that only tests still read, which is how a start path and a status path end up disagreeing; the tests now assert on the lines the operator actually sees (`modules/version_notice.ts`, `dexbot.ts`, `unlock.ts`, `pm2.ts`, `tests/test_version_notice.ts`). `dexbot stat` falls back to the plain header when the check is disabled (`DEXBOT_SKIP_VERSION_NOTICE=1`/`UPDATER.NOTICE_ENABLED=false`), and `--dryrun`/internal children still stay silent. Rendering-only change to the update path: no config keys, no network behaviour and no latch semantics change (`modules/version_notice.ts`, `dexbot.ts`, `unlock.ts`, `pm2.ts`, `tests/test_version_notice.ts`).
|
|
24
|
+
|
|
25
|
+
### 2026-09-27
|
|
26
|
+
|
|
27
|
+
- **Refactor(genesis)**: remove the legacy tolerance price matcher; the frozen ladder is now the only price authority - v1.6.8's fail-closed load/startup gates made the no-genesis fallback unreachable in production (`_genesis` is only ever set by `loadGrid` after the E1 gate or by a grid build, and a populated `orders` Map without a ladder cannot be produced by any supported flow), but the branch was still the path an off-grid chain price became a slot's price — the exact corruption INV-GRID-004 exists to prevent. Deleted: the whole pass-2 legacy block (tolerance duplicate scan + strict `findMatchingGridOrderByOpenOrder` + the widened `ORPHAN_ADOPTION_TOLERANCE_MULTIPLIER` spread-orphan adoption), `findMatchingGridOrderByOpenOrder` itself (its last production caller was that block; the cancelOrder linkage now matches by `orderId`), `computeOutOfToleranceDriftTag` with the `price-drift-orphan` tag and the per-cycle auto-cancel that consumed it (`autoCancelOneUnmatchedOrphan`, its `bot._autoCancelOrphan*` state and the maintenance call site) — an off-grid order is HELD (`out-of-grid-deferred`) and resolved structurally, never cancelled off a fuzzy price diff — the pass-1 price-equality and duplicate-swap tolerance fallbacks, the correction-queue staleness tolerance, and `resolveLiveReserveEdgeAnchorPrice` tiers 2/3 (live slot extreme, resolved config bound) so the reserve anchor is the ladder extreme or nothing. Two constants go with them (`ORPHAN_ADOPTION_TOLERANCE_MULTIPLIER`, `PRICE_DRIFT_TOLERANCE_MULTIPLIER`); a config that still sets either is simply ignored. The unreachable pass-2 hold is tagged `no-genesis-deferred`, so the shared suffix predicate keeps it non-blocking and the stranded-hold set escalates it (a reload is exactly its remedy). **E2 is now fail-closed**: `syncFromOpenOrders` calls `_assertGenesisInvariant` first and, when slots exist without a ladder, returns an empty result — no locks taken, nothing adopted, nothing queued for correction — after logging at `error` and requesting the structural resync that re-derives the ladder; it previously warned and continued *into* the matcher, and giving up that continuation is the point of the change. The same rule tightened two judgement calls: the pass-1 "did this order move?" test and the duplicate-swap tiebreak now compare LADDER LEVELS (`chainPriceOnSameLevel`: both prices map to the same slot) instead of float equality, so a legitimate few-quanta rest-drift inside one level no longer queues a spurious price correction or fails the tiebreak, and `adoptedSlotKeepsItsOwnPrice` reports a ladder-less manager as a fault instead of passing it. The createOrder materialize path still keeps a placed chain order tracked when the grid is undefined, but for a `slot-N` id it now logs the missing ladder at `error` and requests the resync (the descriptor-price fallback remains only for an unparseable id). Behavioral impact: no production flow changes; a future bypass of E1/E3 now produces a refused sync and a resync request rather than a fuzzy adoption. Risk: the ladder-less state is no longer survivable at runtime — it is repaired at load, which is where it must be (`modules/order/sync_engine.ts`, `modules/order/utils/order.ts`, `modules/order/genesis_policy.ts`, `modules/dexbot_cow_runtime.ts`, `modules/dexbot_class.ts`, `modules/dexbot_maintenance_runtime.ts`, `modules/constants.ts`, `docs/GRID_PRICE_INVARIANT.md`, `tests/test_sync_excess_orphan.ts`, `tests/test_sync_out_of_grid_defer.ts`, `tests/test_sync_logic.ts`, `tests/test_uncertain_broadcast.ts`, `tests/test_reserve_orders.ts`, `tests/test_pending_fill_crawls.ts`, `tests/test_correction_queue_staleness.ts`, `tests/test_sync_duplicate_orphan_swap.ts`, `tests/test_sync_empty_confirm.ts`, `tests/test_sync_lock_id_verification.ts`, `tests/test_resync_invariants.ts`, `tests/test_startup_partial_fill.ts`, `tests/test_cow_committed_order_protection.ts`, `tests/helpers/order_test_helpers.ts`).
|
|
28
|
+
|
|
29
|
+
- **Fix(genesis)**: refuse a persisted grid that has no usable price ladder, instead of loading it and degrading every slot-price consumer to a tolerance matcher - the genesis ladder is the only authoritative price for a slot (INV-GRID-004), and the "no genesis" state was reachable only from a pre-v1.4.25 snapshot through three silent paths: a >50% slot mismatch against the config-derived rail (refused to adopt, but then kept the grid anyway), a not-yet-numeric rail config (`startPrice:"pool"`, `minPrice:"2x"`), and a throwing ladder build. In all three the snapshot loaded with `manager._genesis === null`, so nearest-slot adoption, `computeOutOfToleranceDriftTag`, the materialize descriptor-price fallback, `resolveLiveReserveEdgeAnchorPrice` tiers 3/4 and the `isSlotInRail` fail-open all ran on a tolerance matcher - the exact path on which an off-grid price becomes grid evidence. `loadGrid` now resolves the ladder through ONE decision (`resolvePersistedGenesis` in the new `modules/order/genesis_policy.ts`) and, when no ladder can be established, throws `MissingGenesisError` BEFORE any mutation (no asset init, no fund reset, no boundary restore), so the caller rebuilds from a clean manager. The startup gate asks the same question before committing to resume-vs-regenerate, so a ladder-less snapshot is regenerated (`initializeGrid` re-derives prices and reconcile is update-first) instead of half-loaded; the price-match resume reports "not resumed"; the recovery reload reports the failed reload for the structural resync - or, under `'halt'`, signals it so the automatic resync is suppressed. `GRID_LIMITS.MISSING_GENESIS_POLICY` (read as `config.gridLimits.MISSING_GENESIS_POLICY`) picks the response: `'rebuild'` (default, deterministic, no operator action) or `'halt'` (abort startup until a human runs a manual grid reset - strongest fund safety, opt-in because the bot stays down under PM2). Unknown values fall back to `'rebuild'`. The migration cross-check threshold is now the named `GRID_LIMITS.MISSING_GENESIS_MISMATCH_RATIO` (0.5) instead of an inline literal. Behavioral impact: a pre-v1.4.25 snapshot on a bot whose rail config is still unresolved now rebuilds once (deriving the ladder from the live market) instead of running permanently ladder-less; a snapshot whose config was edited past the ratio limit is rebuilt rather than loaded with a mismatched genesis. Risk: the rebuild re-slots live orders, the same net effect as a manual `dexbot reset` - use `MISSING_GENESIS_POLICY: 'halt'` to require explicit consent. Deliberately NOT adopted (rejected in the analysis): accepting the mismatched rail (mass-virtualizes live tracking, persists a mismatched genesis) and deriving the ladder from persisted slot prices (a truncated array would permanently shrink it) (`modules/order/genesis_policy.ts`, `modules/order/grid.ts`, `modules/dexbot_startup_runtime.ts`, `modules/dexbot_state_recovery.ts`, `modules/dexbot_maintenance_runtime.ts`, `modules/constants.ts`, `docs/GRID_PRICE_INVARIANT.md`).
|
|
30
|
+
|
|
31
|
+
- **Fix(genesis)**: centralize the rail geometry and close a non-terminating loop - the migration ladder builder duplicated `createOrderGrid`'s price-level generation, so a legacy snapshot could migrate to a different ladder than a fresh build of the same config; both now go through one `derivePriceLevels` (`modules/order/utils/math.ts`). The shared builder also refuses a non-advancing step (`incrementPercent` 0, negative, or small enough that `1 + inc/100` underflows) instead of spinning the geometric `while` forever - previously reachable from the startup migration gate. Config validation stays caller-side (`createOrderGrid` strict; migration builds a candidate ladder for the slot cross-check, so an out-of-bounds-but-finite edited config keeps reporting `slot_mismatch`, not a config error). Behavioral impact: a migrated ladder is identical to a fresh one, and an invalid increment cannot hang startup/load. (`modules/order/utils/math.ts`, `modules/order/grid.ts`, `modules/order/genesis_policy.ts`, `tests/test_missing_genesis_policy.ts`, `tests/test_dexbot_maintenance_runtime_dynamic_weights.ts`).
|
|
32
|
+
|
|
33
|
+
- **Feat(genesis)**: defence in depth for the same invariant - the sync entry (`syncFromOpenOrders`) now asserts the manager holds a ladder whenever it holds grid slots, and on a violation reports once per generation at `error` (with the recorded refusal reason, when there is one), counts it in `_genesisInvariantViolations`, and requests the debounced `requestStructuralGridResync('missing-genesis')` that re-derives the ladder. It deliberately does not throw: a sync in flight is not the place to abort a live manager, and the fail-closed decision belongs to the load-side gates. `initializeGrid` clears the fault record and the counter when it installs a new generation, so a resolved condition stops reporting. The persisted row is gated at the source too - `AccountOrders.loadGenesis` now refuses a row with empty/absent `priceLevels` instead of handing `loadGrid` a genesis it cannot validate against (a tampered but well-shaped hash is still returned; that warning belongs to `loadGrid`, which can say what it compared against). Together with the startup gate this is the E1/E2/Schema enforcement layer the invariant analysis asked for (`modules/order/sync_engine.ts`, `modules/account_orders.ts`, `modules/order/grid.ts`).
|
|
34
|
+
|
|
35
|
+
- **Test(genesis)**: add `tests/test_missing_genesis_policy.ts` (GEN-01..21) covering the T1 adoption (and its migration log), the T2/T3/T4 refusals, the ratio boundary (at-limit adopts, above refuses), policy resolution (default/case/garbage), `loadGrid` refusing before it mutates anything and honouring `'halt'`, the `loadGenesis` schema gate, the E2 assert's latch/counter/resync request, the recovery reload honouring `'halt'` (suppressed resync), and the shared rail geometry (migrated ladder equals a fresh build; a non-advancing increment is refused, not hung). `tests/test_grid_price_slot_invariant.ts` step 10 updated to the new contract (an edited config now refuses instead of warning and keeping the grid), and six fixtures that fed `loadGrid` a ladder-less snapshot (`test_boundary_restore_validation`, `test_grid_bloat`, `test_orphan_load_sanitize`, `test_pending_fill_crawls`, `test_uncertain_broadcast`, `test_dexbot_startup_dynamic_weight_wiring`) now persist a real ladder, as every production snapshot does; the boundary test's reversed-snapshot case was rewritten to pin the new contract (refused without a ladder, re-sorted to canonical order with one) (`tests/test_missing_genesis_policy.ts`, `tests/test_grid_price_slot_invariant.ts`, `tests/test_boundary_restore_validation.ts`, `tests/test_grid_bloat.ts`, `tests/test_orphan_load_sanitize.ts`, `tests/test_pending_fill_crawls.ts`, `tests/test_uncertain_broadcast.ts`, `tests/test_dexbot_startup_dynamic_weight_wiring.ts`).
|
|
36
|
+
|
|
37
|
+
- **Docs(genesis)**: document the missing-genesis policy, its trigger table, the three enforcement sites, the routing per caller and the rejected alternatives in `docs/GRID_PRICE_INVARIANT.md`, and extend `INV-GRID-004` in `docs/COW_INVARIANTS.md` with the refusal contract (`docs/GRID_PRICE_INVARIANT.md`, `docs/COW_INVARIANTS.md`).
|
|
38
|
+
|
|
39
|
+
- **Fix(reserve)**: exclude window members from every reserve classification site - the live-reserve count got the window exclusion in an earlier follow-up, but the no-crawl classification and the boundary-hold refill wire still ranked the plain floor/ceiling via `reserveEdgeIdSet` without it. When the active window reaches the grid edge (a keep-low window sitting on the floor), window members were misclassified as reserves: a genuine window fill was treated as static insurance and never crawled the boundary, so the hole was refilled same-side - and a guard-skipped window refill was dropped from `collectRefillSlotIds`' wire, so the hold could not pin the committed boundary. New `windowIdSetFromSlots` (with `liveWindowIdSet` delegating to it) supplies the window set to `deriveTargetBoundary`, `consumePendingFillCrawls`, `collectRefillSlotIds` (new `manager` option), the `initializeGrid` owed-crawl fold, and `_reconcileStartupSide`, matching the placement pickers and the count. Genuine reserve fills still never crawl; unknown boundary geometry fails open to the previous classification. Review-driven fixes in the same pass: `resolveReserveCount` migrates the legacy numeric `reserveOrders` form at read time and `validateBotEntry` accepts it (non-negative integer) instead of rejecting it; `applyPersistedPendingCrawls` logs a `restore-failed` ledger as retained (not dropped); the shared `railCenterIndex` removes the duplicated Tier-4 rail-center formula; and the reserve-sizing comment, `order.ts` section header, `AccountOrders` method list, and `INV-COW-008` are corrected. Behavioral impact: a window fill at the grid edge crawls again and a skipped window refill pins the boundary; a hand-edited numeric `reserveOrders` is honored. Risk: none beyond restoring the intended crawl - a genuine reserve (outside the window) is unaffected and still no-crawl. Tests: the reserve window-overlap no-crawl and refill-wire regression plus numeric-form read/validation cases, and the dynamic-weights ESM mock name list (`modules/order/utils/order.ts`, `modules/order/grid.ts`, `modules/order/grid_reconcile_internal.ts`, `modules/order/manager.ts`, `modules/order/utils/system.ts`, `modules/bot_settings.ts`, `modules/account_orders.ts`, `docs/COW_INVARIANTS.md`, `tests/test_reserve_orders.ts`, `tests/test_bot_settings.ts`, `tests/test_dexbot_maintenance_runtime_dynamic_weights.ts`).
|
|
40
|
+
|
|
41
|
+
### 2026-09-28
|
|
42
|
+
|
|
43
|
+
- **Chore(packaging)**: drop test sources from the npm tarball - the published package shipped 19 claw bridge test files and two Kalman suites under `analysis/trend_detection/` through the blanket "claw" and "analysis" `files` entries, neither reachable from the installed runtime. "!claw/tests" removes 232K of TS test sources with zero runtime use; the two Kalman suites move to `analysis/legacy/tests/` (already excluded from the package and the prod tsconfig) and are converted to the CJS `require()` style the other legacy suites use, and both are wired into the `test:legacy` chain so they stay executed (their previous entry point, the `analysis/trend_detection/package.json` test script, nothing invoked). Package drops from 1137 to 1109 files; runtime modules that merely sit under a tests-named path (`dist/analysis/trend_detection`, `dist/market_adapter/test_helpers`) and the claw example are deliberately left in (`package.json`, `analysis/legacy/tests/test_kalman_trend.ts`, `analysis/legacy/tests/test_kalman_velocity_smoothing.ts`, `analysis/trend_detection/package.json`, `analysis/README.md`).
|
|
44
|
+
|
|
45
|
+
- **Chore(packaging)**: trim the npm tarball to shipped docs, assets and declarations - two reductions to the `files` whitelist. The blanket "analysis" entry shipped all 44 analysis `.ts` sources even though `tsc` already emits their compiled twins under `dist/analysis/`, so every tool shipped twice; it is replaced with an explicit list matching the way `docs/`, `modules/` and `market_adapter/` are already packaged - `analysis/uplot` must keep shipping (analysis/chart_utils.ts inlines the vendored uPlot runtime via `fs.readFileSync` from `PATHS.ANALYSIS.ASSETS_DIR`, a runtime dependency) plus the six `.md` files `analysis/README.md` links to, so shipping the top-level README alone would ship broken links. Separately, `dist/**/*.js.map` and `dist/**/*.d.ts.map` (464 files, 3.49 MB) are dropped: they resolve to root `.ts` sources never in `files` and nothing consumes them (zero runtime dependencies, no source-map-support, no `--enable-source-maps`), expressed as `files` negations so a local `dist/` keeps its maps while only the published tarball loses them; the 234 `.d.ts` files are kept for deep importers. Net: 1109 files / 2.902 MB unpacked down to 600 files / 2.131 MB (`package.json`).
|
|
46
|
+
|
|
47
|
+
- **Feat(tv)**: replay market-adapter grid resets in the bot charts - `gridPrice: "ama"` charts now visualize WHEN the grid would have recentered, not only where it sits today. `grid_reset_sim.ts` replays the two recentering triggers from `docs/GRID_RECALCULATION.md` §3/§4 over the chart's 1h AMA series (price-delta ratchet + slope-delta, price trigger first, the accepted slope baseline re-seeded on every reset, `clampGridPriceToBounds` semantics for absolute bounds), and `grid_reset_config.ts` resolves the thresholds through the production chain (constants → general.settings → market_adapter_settings globals/pair/bot) instead of reimplementing it, with `--grid-delta-pct`/`--grid-slope-delta-pct`/`--grid-warmup` CLI overrides plus an in-chart toggle and a bottom-left threshold panel; the replay is embedded into the self-contained HTML via `embedFunctionSources`, so pool/pair charts are untouched. Three runtime fixes were needed to make the chart's source chain honest: a persisted not-ready slope snapshot (`isReady:false`, slopePct 0) no longer acts as a phantom 0 %/bar baseline that could trip the slope trigger on the first real slope; a non-positive slope threshold now DISABLES the trigger instead of firing every cycle on delta ≥ 0 when the factor/maxSlopePct config is missing; and `MARKET_ADAPTER.AMA_SLOPE_DELTA_THRESHOLD_PERCENT` is read back from general settings (the editor's AMA-Slope Delta knob was inert) with `amaSlope` rebuilt so the shared `DEFAULTS` object is not poisoned. Risk: low - the runtime changes only affect bots whose configured/default slope factor resolves non-positive (previously spurious per-bar resets persisted via `advanceTriggeredBotState`); research-only modules otherwise (`analysis/tradingview/grid_reset_sim.ts`, `analysis/tradingview/grid_reset_config.ts`, `analysis/tradingview/tradingview_uplot_chart_generator.ts`, `analysis/tradingview/analyze_tradingview.ts`, `analysis/tradingview/README.md`, `analysis/README.md`, `market_adapter/core/market_adapter_service.ts`, `market_adapter/market_adapter.ts`, `market_adapter/core/strategies/dynamic_weight_series.ts`, `docs/GRID_RECALCULATION.md`, `tests/test_grid_reset_sim.ts`, `tests/test_market_adapter_logic.ts`, `tests/test_market_adapter_service.ts`, `tests/test_tradingview_chart_storage_key.ts`, `tests/README.md`).
|
|
48
|
+
|
|
49
|
+
- **Chore(dynamic-weight)**: raise the `kalS%` default from 1.0 to 1.11 - `DYNAMIC_WEIGHT_KALMAN_MAX_SLOPE_PCT` now requires a slightly stronger trend move before the Kalman composite branch reaches full directional strength; the research doc is synced to match (`modules/constants.ts`, `analysis/trend_detection/DYNAMIC_WEIGHT_RESEARCH.md`).
|
|
50
|
+
|
|
51
|
+
- **Fix(market-adapter)**: make the Kibana tail refresh incremental and bounded - shard coverage (`meta.queriedRanges`) now records `at`, the wall-clock time each query ran, so the newest window only re-queries buckets no query has seen `TAIL_SETTLE_LAG_MS` after they closed instead of a fixed 48h overlap. Gap immutability is judged per gap (`GAP_SETTLE_HORIZON_MS`) rather than per window, so a month-old gap in a "now" window stops being re-fetched forever; small gaps merge (`GAP_MERGE_TOLERANCE_BUCKETS`) and the sub-range budget is spent on merged span hours, not gap count, so one extra 1h hole can no longer escalate a run to a full-window fetch; persisted coverage spans are capped (`MAX_COVERAGE_SPANS`); a re-verifying run rewrites its shard even when the candles are identical because the moved verification time is the news, while a pure-reuse run still writes nothing. The timestamped refresh is capped at `TAIL_REFRESH_HOURS`: an old coverage hole (span compaction, an undatable shard, a hand-written file) would otherwise drag the boundary back weeks and re-query settled history on every run - without the cap a 30-day window with a mid-window hole re-fetched ~20 days per run, with it the worst case is the legacy 48h. Tests cover the incremental tail, the 48h ceiling, per-gap pruning, span compaction, and sub-range gap merging (`market_adapter/inputs/window_cache.ts`, `market_adapter/README.md`, `tests/test_window_cache.ts`).
|
|
52
|
+
|
|
53
|
+
- **Tune(range)**: widen the orange tight zone, `suizidal` starts below 1.4x - `RANGE_QUALITY` `ORANGE_MIN`/`RED_MAX` 1.45 → 1.4, so the orange tight zone is 1.4x-1.55x and a range below 1.4x flags red (suizidal); single-sourced via `RANGE_QUALITY`, the bot-editor legend and live range coloring follow automatically (`modules/constants.ts`).
|
|
54
|
+
|
|
55
|
+
- **Fix(clear)**: make the `dexbot clear*` scripts warn when the runtime is live, and sweep the rotated audit trail - `clear` reads like a harmless log wipe but is not: a running bot re-persists its grid within seconds, a running adapter rewrites both its state file and `market_adapter.lock` (deleting that lock is exactly what lets a second adapter start), and open log file descriptors mean the deleted space is only reclaimed on restart, so every wipe issued against a live fleet was silently cosmetic. `scripts/lib/dexbot-paths.sh` gains five helpers shared by all four `clear-*` scripts: `live_pid_from_file` (pid liveness by file), `runtime_processes` (the monolithic pid files, plus this install's online PM2 apps via `pm2 jlist` - filtered to `cwd`/`script_path` under the project or profiles root, and probed only when the daemon pid file is alive, so a cleanup script can never spawn a PM2 daemon as a side effect), `warn_if_runtime_running` (a warning block listing every hit with the reason it matters; advisory by construction - the prompt still runs, the deletion still happens, no exit code changes), `log_files` (one predicate - `*.log`, rotated `*.log.*`, `*.jsonl*` - now used by the count, the preview, the delete and the verification in both `clear-logs.sh` and `clear-all.sh`, so those four can no longer disagree) and `note_audit_included`. The predicate change is a fix, not cosmetics: `daemon-audit.jsonl.1` and `.2`, produced by the credential daemon's own rotation, match neither `*.jsonl` nor `*.log.*`, so `clear` used to delete the live audit file and leave its rotated history behind - a half-wiped trail that reads like tampering without being it. The audit trail is still deleted along with the rest of the logs, deliberately, with no opt-in flag and no second prompt: it is named in the preview (`Includes the credential audit trail: daemon-audit.jsonl*`) and the operator answers the same single `y`, since an explicit y/n confirmation is the right place for that decision. The published descriptions were wrong in the same direction - the README comment implied `clear` also performed the other three commands, and nothing said these are offline-only - so `dexbot help`, the CLI reference table, the onboarding troubleshooting guide, `scripts/README.md` and the README now state each command's exact scope, that the credential audit trail goes with the logs, and what deliberately survives every `clear*`: `bots.json`, `keys.json`, the generated settings files and `credit_runtime/` (`dexbot default` remains the separate settings reset) (`scripts/lib/dexbot-paths.sh`, `scripts/clear-logs.sh`, `scripts/clear-orders.sh`, `scripts/clear-market-adapter.sh`, `scripts/clear-all.sh`, `dexbot.ts`, `README.md`, `docs/WORKFLOW.md`, `docs/BITSHARES_ONBOARDING.md`, `scripts/README.md`).
|
|
56
|
+
|
|
57
|
+
- **Docs**: currency sweep over the published docs - `CHANGELOG.md` re-verified against the 12 commits since v1.6.7 (no gaps, nothing to add), then the drift that accumulated around it is closed. `docs/EVOLUTION.md`'s headline numbers are reconciled with the repository: the executive summary claimed 2,277 commits while its own footer said 2,300 (`git rev-list --count HEAD` = 2,300), the test count said 298 against 305 files in `tests/`, and every era row in the version-history table was recomputed from the current history - the first two rows were badly off (v0.1.0→v0.6.0 1,217 → 998, v0.6.0→v1.0.0 309 → 650) and the later rows drifted by 10-25% because each was written when its era closed and never refreshed; the table now states that its counts are `git rev-list --count` over the current history so the next reader does not have to guess which convention a number used. `docs/DEXBOT_COMPARISON.md`'s testing-depth row moves 256 → 305. `docs/README.md` gains source-map entries for `order/genesis_policy.ts` and `version_notice.ts`, and stops calling the untagged 1.6.8 "released". `docs/WORKFLOW.md`'s `start` feature list no longer advertises auto-update as a default, because `UPDATER.ACTIVE` is default-off by design, and the broken `#version-notice` anchor it introduced is dropped (no such section exists in that file; the behaviour is release-noted, not documented there). `modules/README.md`'s layout tree gains the modules and `order/utils/` files it had drifted past (`version_notice`, `cli_start_onboarding`, `cli_start_output`, `cli_colors`, `credit_pricing`, `grid_price_source`, `node_connect_policy`, `order/genesis_policy`, `utils/text_width`, `utils/chain_logs`; no stale entries were found, only missing ones), and `tests/README.md` points at `npm run test:legacy` and the `test_missing_genesis_policy.ts` / `test_last_fill_pivot_persistence.ts` / `test_version_notice.ts` suites. Verified alongside the sweep: the CLI table in `docs/WORKFLOW.md` matches every command and alias in `dexbot.ts`; the `GRID_PRICE_INVARIANT.md` key-constant table matches `modules/constants.ts` value-for-value; `RANGE_QUALITY` (1.4/1.55/2.0) and `DYNAMIC_WEIGHT_KALMAN_MAX_SLOPE_PCT` (1.11) match the constants and the research doc; every relative markdown link in the repo resolves; and no doc still references a removed symbol (`ORPHAN_ADOPTION_TOLERANCE_MULTIPLIER`, `PRICE_DRIFT_TOLERANCE_MULTIPLIER`, `findMatchingGridOrderByOpenOrder`, `price-drift-orphan`, `printVersionNotice`, the `dexbot whitelist` command) outside the changelog's historical and removal-tombstone entries. Documentation only, no runtime change (`docs/EVOLUTION.md`, `docs/DEXBOT_COMPARISON.md`, `docs/README.md`, `docs/WORKFLOW.md`, `modules/README.md`, `tests/README.md`).
|
|
58
|
+
|
|
59
|
+
## [1.6.7] - 2026-09-26 - Native Session Recovery, Start Onboarding, Keys UX, Guard Pivot Persistence
|
|
60
|
+
|
|
61
|
+
### 2026-09-26
|
|
62
|
+
|
|
63
|
+
- **Feat(guard)**: persist/restore the LAST-FILL-GUARD pivot with the grid snapshot — the guard was fully disabled after every restart (in-memory `_lastFilledPrice`/`_lastFilledType` reset to null) precisely while the boundary was still being rebuilt, and the book seed (`seedLastFilledPricesFromBook`) that re-armed it is only a proxy (max resting buy / min resting sell) that goes wrong whenever the book isn't adjacent to the last fill (partials, rotations, reserve shelf, dust). `persistGridSnapshot` now builds a `{price, type, fillsAt, genesisHash}` row (`buildLastFillPivotPayload`) and passes it as `storeMasterGrid`'s 10th param; `grid.loadGrid` restores it via `restoreLastFillPivot` right after `_restoreBoundary` — with genesis applied and the grid re-typed, before the first reconcile/broadcast — so startup, price-match resume, and the recovery reload all inherit it from one call site. The row carries the CURRENT live genesis hash, so a regenerated/re-derived grid refuses a pivot from a dead generation. Restore validation runs TTL → genesis binding → on-grid: the TTL is 24h (`GRID_LIMITS.LAST_FILL_PIVOT_TTL_MS`) with the ORIGINAL `fillsAt` preserved through `setLastFillPivot`'s `atMs`, so it keeps meaning "age of the last fill", not "time since last restart"; the on-grid check reuses the runtime's own `resolveOnGridPivot` ladder validator (lazily required from `utils/system.ts` so one increment fallback chain and one drift rule serve both the per-probe live guard and the restore; the snapped ladder level is restored, never the raw float; an off-ladder row falls back to the book seed). TTL and genesis-mismatch verdicts erase the stored row through one shared drop path (`AccountOrders.clearPersistedLastFillPivot`, so no half-invalid row can re-arm the same verdict next boot). The fill-ledger reconstruction alternative was rejected: a snapshot mirror invalidates in lockstep with the boundary instead of maintaining a second source of truth (`modules/account_orders.ts`, `modules/order/utils/system.ts`, `modules/order/grid.ts`, `modules/constants.ts`).
|
|
64
|
+
|
|
65
|
+
- **Refactor(guard)**: centralize LAST-FILL-GUARD pivot mutation behind one provenance-tagged writer — fills persist, heuristics don't. New shared `setLastFillPivot(type, price, 'fill'|'book', atMs?)` in `utils/system.ts` sets `_lastFilledPrice`/`_lastFilledType`/`_lastFilledAt`, a `lastFillPivotSource` flag, and the per-side `_lastFilledBuyPrice`/`_lastFilledSellPrice` mirror in one place; `OrderManager._setLastFillPivot` delegates to it and cow_runtime's queued-fill refresh calls it directly, replacing three hand-rolled scalar-mutation sites. Only `'fill'` provenance is persist-eligible, so a book seed never fossilizes as market truth. The row shape is validated by one shared gate (`normalizeLastFillPivot`) used by both the `storeMasterGrid` sanitizer and the loader, so the two checks cannot drift (`modules/order/manager.ts`, `modules/dexbot_cow_runtime.ts`, `modules/order/utils/system.ts`, `modules/account_orders.ts`).
|
|
66
|
+
|
|
67
|
+
- **Fix(guard)**: invalidate the pivot with the grid generation so a rebuilt grid cannot inherit a pivot validated against wiped geometry — `initializeGrid` and `rejectCorruptedGridSnapshot` reset the in-memory pivot via `resetLastFillPivot` (exposed as `OrderManager._resetLastFillPivot`), which clears the FULL scalar family including the per-side mirrors so `seedLastFilledPricesFromBook`'s cold gate is not silently suppressed by stale mirrors after a rebuild; `AccountOrders.clearGrid` wipes the persisted row with the snapshot (`modules/order/grid.ts`, `modules/dexbot_state_recovery.ts`, `modules/order/utils/system.ts`, `modules/account_orders.ts`).
|
|
68
|
+
|
|
69
|
+
- **Test(guard)**: add `tests/test_last_fill_pivot_persistence.ts` (LFP-1..8) covering the store/load round-trip shape gates, null-clears vs undefined-no-op, the provenance gate, the restore validation chain (`fillsAt` preservation, TTL, genesis-mismatch erase, off-ladder refusal), and full-family reset; `test_stale_guard_pivot_fixes` and `test_dexbot_maintenance_runtime_dynamic_weights` updated for the shared writer (`tests/test_last_fill_pivot_persistence.ts`, `tests/test_stale_guard_pivot_fixes.ts`, `tests/test_dexbot_maintenance_runtime_dynamic_weights.ts`).
|
|
70
|
+
|
|
71
|
+
### 2026-09-25
|
|
72
|
+
|
|
73
|
+
- **Fix(native)**: harden fill-channel watchdog recovery and accounting — follow-up to dead-but-open session recovery: the mechanisms were sound but had gaps that could still leave a wedged fill channel silently unchecked or attribute node health to the wrong cause. `subscriptions` keeps escalating while the channel stays dead (drops the `_channelDegraded` latch — the shared per-client cooldown is the only rate bound) and routes the fast retry-ladder scan through the same re-entrancy guards (`_processingHistory`/reconnecting/pendingScans) as every other scan so it cannot race a poll/notice/resubscribe scan; `chain_client` extracts one `createForcedReconnectGate` per client returning `issued|coalesced|unavailable`, so a coalesced request (another escalation already spent the cooldown) still counts as a recovery cycle — the operator alert and node strike are not starved by the stale-api path — while `unavailable` (no live socket) neither counts nor burns the cooldown; the retry ladder refills only on a genuinely new `issued` teardown and the recovered "after N" clause emits only when N > 0; `warnSubscription` uses per-category throttle keys so callback errors and channel errors cannot mask each other's suppressed counts; the superseded `CHANNEL_RECONNECT_COOLDOWN_MS` is dropped. Behavioral impact: a wedged channel keeps requesting recovery instead of disarming after one attempt, and the unrecoverable-channel alert and fill-channel-unrecoverable node strike fire even when the stale-api escalation holds the cooldown — no forced reconnect alone costs a node a persistent strike (`modules/bitshares-native/chain_client.ts`, `modules/bitshares-native/subscriptions.ts`, `modules/bitshares-native/transport.ts`, `modules/bitshares_client.ts`, `modules/constants.ts`, `docs/LOGGING.md`).
|
|
74
|
+
|
|
75
|
+
- **Fix(native)**: recover dead-but-open sessions and stop stale COW re-broadcasts — two independent stale-bot failure modes a restart alone did not resolve. (1) A server-side login-session swap left cached api ids rejected with `Assert Exception: _local_apis.size() > api_id` while the socket still read "connected", so the normal close/keep-alive recovery never fired, the fill-history scan and its polling loop died, and fills went undetected for hours (the error log took ~95k identical lines). (2) A COW batch validated its plan before the single-flight broadcast wait, so if the slot-holding batch committed a master-grid advance during that wait the deferred batch still shipped its now-stale plan, placing duplicate on-chain orders that had to be cancelled. New `transport.forceReconnect()` reports the active node failed, detaches the old close handler, tears the socket down synchronously (an unresponsive peer may never send its close frame) and reconnects with `wasReconnect` set so the node-failure ledger prefers a different node; both chain clients window stale-id errors (3 within 60s → `forceReconnect`, a single reconnect-race stale id still recovers in place); the fill-channel watchdog trips a cooldown-debounced forced reconnect after 3 consecutive history-scan failures with per-account throttled logs ("+N suppressed") while excluding callback/processing errors so a downstream bug cannot reconnect-storm; COW re-validates the plan after winning the broadcast slot and re-plans from the fresh master if it went stale during the wait (only when it was fresh before the wait, so an already-stale plan cannot double the structural-resync request) (`modules/bitshares-native/transport.ts`, `modules/bitshares-native/chain_client.ts`, `modules/bitshares-native/subscriptions.ts`, `modules/constants.ts`, `modules/dexbot_cow_runtime.ts`, `docs/LOGGING.md`).
|
|
76
|
+
|
|
77
|
+
- **Fix(update)**: regenerate ecosystem config in a clean process — the updater imports `dist/modules/paths.js` at startup and Node's ESM registry is keyed by resolved URL for the process lifetime, so `npm run build` rewrites `dist/` on disk but the pre-pull modules stay cached; importing the freshly built `dist/pm2.js` in-process then linked against the stale cached `paths.js` and failed with "does not provide an export named 'printRelocationNotices'" even though the bundle freshness check passed, and the warning handler swallowed it so `profiles/ecosystem.config.cjs` was never regenerated (the same latent bug would have broken the PM2-managed restart path). Both post-build consumers of `dist/pm2.js` — `generateEcosystemConfig()` and `needsMarketAdapter()` — now run in a child process with an empty module registry (new `resolvePm2ModuleUrl()`/`pm2NeedsMarketAdapter()`), and the build script prints a "tsc is compiling ..." notice so the silent window while tsc runs is explained (`scripts/update.ts`, `package.json`).
|
|
78
|
+
|
|
79
|
+
- **Fix(native)**: self-heal stale api_id in the native chain client — the client cached `_dbApiId`/`_historyApiId`/`_broadcastApiId` across websocket reconnects, so a reconnect that swapped the server-side login session without the client observing a `closed` status event left those ids pointing past the new session's `_local_apis` map and every call returned `Assert Exception: _local_apis.size() > api_id`, wedging the fill-history channel (including the periodic fill poll) until a process restart. `login()` (run by `validateNode` on every (re)connect) now resets the cached ids, and `db`/`history`/`network_broadcast` route through `callWithApiRecovery()`, which re-registers the namespace on the current session and retries once when the node reports a stale api id — mirrored in `createReadOnlyClient` so the market adapter's read channel is covered too; `processObjects` failures raised by the fill poll are tagged `context: 'fill-poll'` so a dead poll is visible instead of swallowed as a generic error. Risk: one extra RPC round-trip only on a stale-id failure (bounded single retry); no happy-path change (`modules/bitshares-native/chain_client.ts`, `modules/bitshares-native/subscriptions.ts`, `tests/test_native_chain_client.ts`).
|
|
80
|
+
|
|
81
|
+
- **Feat(keys)**: show a BitShares onboarding link for empty vaults and make key/bot tables display-width-aware — a local-document-first onboarding link is printed after first-time vault setup or when authenticating into an empty key manager, with the hosted fallback derived from `UPDATER.REPOSITORY_URL`/`BRANCH` in `modules/constants.ts` instead of a second hardcoded repository URL; stored accounts (`modules/chain_keys.ts`) and configured bots (`modules/account_bots.ts`) render as display-width-aware columns so CJK/emoji and combining marks no longer misalign tables (new browser-safe `modules/utils/text_width.ts`). New `resolveOnboardingUrl()` exported and covered for local/remote selection plus the first-time and empty-vault notice paths (`modules/utils/text_width.ts`, `modules/chain_keys.ts`, `modules/account_bots.ts`, `README.md`, `tests/test_chain_keys_vault.ts`, `tests/test_text_width.ts`).
|
|
82
|
+
|
|
83
|
+
- **Fix(keys)**: signal key-manager cancellation explicitly — the interactive key manager conflated Escape with other exit paths: `authenticate()` returned the raw `'\x1b'` sentinel, which leaked into callers (`key_store`, `chain_orders`, `credential_daemon`, `dexbot_class`, `dexbot`) and was passed to decrypt/resolvePrivateKey as if it were a vault secret, and `main()` returned no status so the first-run flow always claimed the master password was configured even when setup was cancelled. New `MasterPasswordCancelledError` thrown on Escape; `isMasterPasswordFailure()` now recognizes cancellation so existing abort paths handle it; `main()` returns whether a usable vault exists, routes every close through one message, keeps submenu Escape local to the operation, and `selectKeyName()` returns null on cancel; `dexbot.ts` surfaces a cancellation message during first-run setup and honors `main()`'s return value in `runAccountManager` (`dexbot.ts`, `modules/chain_keys.ts`).
|
|
84
|
+
|
|
85
|
+
- **Feat(cli)**: route `dexbot start` through setup onboarding when configuration is incomplete — a bare `dexbot start` (and its `unlock` alias) on a fresh install previously failed downstream with confusing errors because neither a key vault nor bot definitions existed, forcing new users to discover `dexbot key`/`dexbot bot` on their own. Onboarding now runs at the unlock-launcher boundary (`unlock.ts`, shared by `dexbot start`, `dexbot unlock`, and direct `node unlock`, so the dexbot CLI only delegates) with the routing logic in a pure, unit-testable selector (`modules/cli_start_onboarding.ts`); `chain_keys.hasKeySetup()` requires a usable account entry (valid v2 encrypted key) so a cancelled key setup counts as incomplete instead of skipping onboarding; non-interactive `--headless`/`--dryrun` launches fail fast with a message instead of blocking on an interactive prompt; onboarding is opt-in via the direct-run bootstrap so programmatic `unlock.main()` callers (tests, embeds) never block on a password/key prompt; relocation notices are printed explicitly by `dexbot` (non-delegating commands), `unlock` (only when onboarding is not needed), and `pm2` (direct runs), with launcher-child `start`/`unlock`/`pm2` commands excluded to keep a single emission; yellow notice formatting is centralized in `modules/cli_start_output.ts`; README getting-started documents the auto-redirect (`dexbot.ts`, `unlock.ts`, `pm2.ts`, `modules/chain_keys.ts`, `modules/cli_start_onboarding.ts`, `modules/cli_start_output.ts`, `modules/paths.ts`, `README.md`).
|
|
86
|
+
|
|
87
|
+
## [1.6.6] - 2026-09-25 - Stale Cancellation Guard Hardening, Dead Code Sweep
|
|
6
88
|
|
|
7
89
|
### 2026-09-25
|
|
8
90
|
|
|
91
|
+
- **Docs**: align the published guides with v1.6.6 behavior — batching, dust handling, spread correction, and the reconciliation safeguards are re-documented to match the current runtime, with stale links and project metadata repaired; `docs/` index targets are added to the npm artifact and the affected file-level API tables and export docs are corrected to describe the actual implementation (`CHANGELOG.md`, `docs/COW_INVARIANTS.md`, `docs/DEXBOT_COMPARISON.md`, `docs/EVOLUTION.md`, `docs/GRID_PRICE_INVARIANT.md`, `docs/GRID_RECONCILE.md`, `docs/architecture.md`, `docs/developer_guide.md`, `modules/README.md`, `package.json`).
|
|
92
|
+
|
|
93
|
+
- **Fix(cleanup)**: remove stale module helpers left behind by browser-portability work, the credit-pricing and COW-runtime extractions, and incomplete determinism plumbing — unused class methods and helper wrappers in accounting, grid, working-grid, export, credit-runtime, and the native crypto browser shim are dropped along with their now-unused imports. Behavioral impact: none — the active accounting, pricing, execution, and shutdown paths are unchanged; the surface is narrower (`modules/bitshares-native/crypto/ecc.browser.ts`, `modules/credit_runtime.ts`, `modules/dexbot_class.ts`, `modules/order/accounting.ts`, `modules/order/export.ts`, `modules/order/grid.ts`, `modules/order/manager.ts`, `modules/order/working_grid.ts`).
|
|
94
|
+
|
|
95
|
+
- **Refactor(analysis)**: drop stale and dead analysis tooling — the grid checker's documentation and output are realigned with LAST-FILL-GUARD semantics, no-op lookup flags are removed from the fill-based tools, zero-consumer module exports are narrowed (`account_resolver`, `fills_source`), and the dependency-free nested AMA-fitting manifests are retired so the analysis surface reflects its actual callers and supported workflows (`analysis/README.md`, `analysis/account_resolver.ts`, `analysis/ama_fitting/package-lock.json`, `analysis/ama_fitting/package.json`, `analysis/bot_usage/kibana_bot_queries.ts`, `analysis/chain_pool.ts`, `analysis/derivative_chart_generator.ts`, `analysis/fills_source.ts`, `analysis/grid_correction_check.ts`, `analysis/resolve_source.ts`, `analysis/trade_profitability.ts`, `scripts/sync-version.ts`).
|
|
96
|
+
|
|
9
97
|
- **Fix(update)**: make the dist freshness check honor the build's `tsconfig.json` exclude — the updater derived expected `dist/` outputs by walking every `.ts` under the compiled roots, so the archived `analysis/legacy/tests` (compiled only by `tsconfig.tests.json`) was read as a missing production output and the post-build check aborted with `Build left dist/ incomplete or stale (is missing dist/analysis/legacy/tests/test_derivative_chart.js)` after a successful build, blocking the restart. `collectCompiledSources` now reads the root `tsconfig.json` `exclude` directory prefixes and skips them, mirroring the compiler; regression in `tests/test_update_dist_freshness.ts` (`scripts/update_dist_freshness.ts`, `tests/test_update_dist_freshness.ts`).
|
|
10
98
|
|
|
11
99
|
- **Refactor(analysis)**: archive the legacy SMA/MACD/RSI derivative analyzer — the classic-indicator tool (superseded by the live Kalman/Hurst/PE stack, with no production importer since `modules/` and `market_adapter/core/` hold none of its symbols) moves to `analysis/legacy/` with a local README. It loses its `analysis:derivatives` npm script, is scrubbed from the centralized docs (`analysis/README.md`, `analysis/trend_detection/README.md`, `scripts/README.md`, `docs/README.md`, `docs/architecture.md`, `docs/developer_guide.md`, `docs/DEXBOT_COMPARISON.md`), and is excluded from the published npm package (`!analysis/legacy` + `!dist/analysis/legacy`). Its four regression tests move under `analysis/legacy/tests/` out of the default `npm test` glob, with a new opt-in `npm run test:legacy`; the production build excludes that path while `tsconfig.tests.json` still typechecks it. Full suite 296/296 pass (`analysis/legacy/`, `package.json`, `tsconfig.json`, `tsconfig.tests.json`, docs).
|
package/README.md
CHANGED
|
@@ -188,7 +188,9 @@ Keep the default settings first, and tune these:
|
|
|
188
188
|
section. Boolean prompts accept `y`/`yes`/`true` and `n`/`no`/`false`;
|
|
189
189
|
Enter keeps the current value.
|
|
190
190
|
|
|
191
|
-
5. **Start DEXBot2** with `dexbot start`.
|
|
191
|
+
5. **Start DEXBot2** with `dexbot start`. If setup is incomplete, `start`
|
|
192
|
+
automatically opens `dexbot key` when no usable account key is configured,
|
|
193
|
+
or `dexbot bot` when a valid key exists but no bot is configured.
|
|
192
194
|
|
|
193
195
|
6. **Tune `minPrice` / `maxPrice`** around the market's volatility range. Once
|
|
194
196
|
AMA is active, tighten them around the maximum expected market volatility
|
|
@@ -327,7 +329,7 @@ First-run details and common mistakes are covered in the [BitShares Onboarding T
|
|
|
327
329
|
|
|
328
330
|
```bash
|
|
329
331
|
dexbot key # Master password/keyring
|
|
330
|
-
dexbot bot # Interactive bot configurator
|
|
332
|
+
dexbot bot # Interactive bot configurator
|
|
331
333
|
|
|
332
334
|
dexbot reset {all|<bot>} # Regenerate grid
|
|
333
335
|
dexbot disable {all|<bot>} # Disable bot in config
|
|
@@ -336,15 +338,16 @@ dexbot enable {all|<bot>} # Enable bot in config
|
|
|
336
338
|
dexbot stat # Runtime status (unlock or PM2)
|
|
337
339
|
dexbot order [<bot>] # Analyze order grids (--export → HTML to analysis/charts/)
|
|
338
340
|
dexbot tv <bot|pool|A/B> # TradingView 1h chart with AMA overlay (default: 3 months)
|
|
339
|
-
dexbot credit [<bot>] # Live summed MPA + borrowed-credit positions
|
|
341
|
+
dexbot credit [<bot>] # Live summed MPA + borrowed-credit positions
|
|
340
342
|
dexbot export <bot> # Export trades + settings (CSV/JSON) for analysis/
|
|
341
343
|
|
|
342
344
|
dexbot update # Update DEXBot2
|
|
343
|
-
dexbot clear #
|
|
345
|
+
dexbot clear # Delete log files in <profiles>/logs
|
|
344
346
|
dexbot default # Reset settings to defaults
|
|
347
|
+
dexbot help # Grouped command reference
|
|
345
348
|
```
|
|
346
349
|
|
|
347
|
-
##
|
|
350
|
+
## 🎯 PM2 Process Management
|
|
348
351
|
|
|
349
352
|
PM2 is optional — `dexbot start` is the native solution.
|
|
350
353
|
|
package/analysis/README.md
CHANGED
|
@@ -306,7 +306,7 @@ node dist/analysis/analyze_trade_heatmap.js \
|
|
|
306
306
|
|
|
307
307
|
### TradingView Chart (`tradingview/analyze_tradingview.ts`)
|
|
308
308
|
|
|
309
|
-
Generates a standalone TradingView-style HTML chart with candle OHLC, SMA, AMA, VWMA, and volume panel. See [tradingview/README.md](tradingview/README.md) for full documentation.
|
|
309
|
+
Generates a standalone TradingView-style HTML chart with candle OHLC, SMA, AMA, VWMA, and volume panel. For AMA-grid bots it also replays the market adapter's grid resets (AMA-price Δ / AMA-slope Δ) using the thresholds resolved from `general.settings` / `market_adapter_settings` — see [tradingview/README.md](tradingview/README.md#grid-reset-simulation) and [docs/GRID_RECALCULATION.md](../docs/GRID_RECALCULATION.md). See [tradingview/README.md](tradingview/README.md) for full documentation.
|
|
310
310
|
|
|
311
311
|
# Recommended one-step: bot, pool, or pair (fetches candles + renders, default 3 months)
|
|
312
312
|
dexbot tv <bot-key>
|
|
@@ -411,8 +411,7 @@ Shared analyzers and chart renderers for the dynamic-weight signal path. Core en
|
|
|
411
411
|
**Tests:**
|
|
412
412
|
|
|
413
413
|
```bash
|
|
414
|
-
|
|
415
|
-
node dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.js
|
|
414
|
+
npm run test:legacy
|
|
416
415
|
```
|
|
417
416
|
|
|
418
417
|
**Note:** `trend_detection/` has no external dependencies — runs directly from the compiled build (`node dist/...`).
|
|
@@ -39,6 +39,7 @@ The sections below cover manual usage (explicit candle files, direct runner flag
|
|
|
39
39
|
- SMA overlay
|
|
40
40
|
- AMA preset buttons `1–4` (one-click AMA1–4, active preset highlighted); numeric inputs kept
|
|
41
41
|
- Bot-grid range highlight, off by default (the bot's min/max around AMA with live asymmetric tilt; red above AMA, green below)
|
|
42
|
+
- Grid-reset simulation (AMA bots, on by default): replays the market adapter's two recentering triggers over the candle history — the accepted grid center as a step line, the simulated grid range around it, and a marker per reset (`init` = first AMA snapshot, `Δ1` = AMA-price Δ, `Δs` = AMA-slope Δ). Thresholds come from the live config chain; a bottom-left panel shows the values, where they came from, and the reset counts (see [Grid-Reset Simulation](#grid-reset-simulation))
|
|
42
43
|
- Range-scale switch: fit the price axis to the range band
|
|
43
44
|
- VWMA overlay
|
|
44
45
|
- Order overlay for bot charts (active grid buys/sells as dashed levels, reserve line at the lowest grid buy, ceiling line at the highest grid sell, spread label; pair-aware, toggle in-chart)
|
|
@@ -193,6 +194,10 @@ market_adapter/data/lp/<pair>/lp_pool_<id>_<interval>.json
|
|
|
193
194
|
| `--range` | Enable range highlight (off by default; toggle in-chart) | off |
|
|
194
195
|
| `--no-range` | Disable range highlight | — |
|
|
195
196
|
| `--range-scale` | Range Scaling: size the band by AMA slope like the grid build + fit price axis to it | — |
|
|
197
|
+
| `--no-grid-reset` | Render without the grid-reset simulation (toggle it back in the chart) | on for AMA bots |
|
|
198
|
+
| `--grid-delta-pct <n>` | Override the AMA-price Δ threshold for the simulation (skips config resolution) | config |
|
|
199
|
+
| `--grid-slope-delta-pct <n>` | Override the AMA-slope Δ threshold for the simulation, in %/bar | config |
|
|
200
|
+
| `--grid-warmup <bars>` | Override the simulation start bar (skipped before the first accepted center) | AMA warmup |
|
|
196
201
|
| `--range-span <mult>` | x-range around AMA, 1.2–2 (default: bot grid setting) | bot grid |
|
|
197
202
|
| `--orders-file <path>` | Order-grid JSON override for the overlay (default: `profiles/orders/<botKey>.json`) | bot orders |
|
|
198
203
|
| `--no-orders` | Disable the order overlay (levels, reserve/ceiling lines, spread label) | — |
|
|
@@ -201,6 +206,78 @@ market_adapter/data/lp/<pair>/lp_pool_<id>_<interval>.json
|
|
|
201
206
|
| `--no-update-marker` | Suppress the update marker even when the candle file has stamped meta | — |
|
|
202
207
|
| `--quiet` | Suppress progress logs | — |
|
|
203
208
|
|
|
209
|
+
## Grid-Reset Simulation
|
|
210
|
+
|
|
211
|
+
Bot charts (`--bot-key <key>`, i.e. bots with `gridPrice: "ama"`) additionally
|
|
212
|
+
replay the market adapter's grid recentering over the candle history, so you can
|
|
213
|
+
see *when the grid would have moved* instead of only where it sits today. See
|
|
214
|
+
[docs/GRID_RECALCULATION.md](../../docs/GRID_RECALCULATION.md) for the runtime
|
|
215
|
+
mechanics; the chart mirrors §3 and §4 and nothing else.
|
|
216
|
+
|
|
217
|
+
**What it draws**
|
|
218
|
+
|
|
219
|
+
- **Grid center** (violet step line, legend `Grid`) — the accepted
|
|
220
|
+
`gridCenterPrice`. It only moves on a trigger, so the line is a staircase:
|
|
221
|
+
flat = "the grid would still be sitting here".
|
|
222
|
+
- **Simulated range** (violet band) — the grid bounds that center would own:
|
|
223
|
+
the bot's `minPrice`/`maxPrice` multipliers around the accepted center, tilted
|
|
224
|
+
by the *accepted* slope through `applyAsymmetricBounds` +
|
|
225
|
+
`applyNarrowingSideGuard` (the same functions the live grid build uses). It
|
|
226
|
+
re-tilts only at resets, exactly like the real thing.
|
|
227
|
+
- **Reset markers** — one vertical line per reset, colored and tagged by reason:
|
|
228
|
+
grey `init` (first accepted AMA snapshot, `market_adapter_bootstrap`),
|
|
229
|
+
amber `Δ1` (`market_adapter_delta_threshold`), cyan `Δs`
|
|
230
|
+
(`market_adapter_ama_slope_delta_threshold`).
|
|
231
|
+
- **Panel (bottom-left)** — effective `AMA Δ` and `Slope Δ` thresholds, the
|
|
232
|
+
layer each came from, reset counts, and the last reset.
|
|
233
|
+
|
|
234
|
+
**Where the thresholds come from**
|
|
235
|
+
|
|
236
|
+
Resolved through the same chain the running adapter uses, by
|
|
237
|
+
`analysis/tradingview/grid_reset_config.ts`:
|
|
238
|
+
|
|
239
|
+
1. `modules/constants.ts` (`MARKET_ADAPTER.AMA_DELTA_THRESHOLD_PERCENT`,
|
|
240
|
+
`AMA_SLOPE_DELTA_THRESHOLD_PERCENT` × `DYNAMIC_WEIGHT_AMA_MAX_SLOPE_PCT`)
|
|
241
|
+
2. `profiles/general.settings.json` → `MARKET_ADAPTER.AMA_DELTA_THRESHOLD_PERCENT`
|
|
242
|
+
and `MARKET_ADAPTER.AMA_SLOPE_DELTA_THRESHOLD_PERCENT` (the editor's
|
|
243
|
+
`AMA-Slope Δ`, applied to `amaSlope.deltaThresholdPct` by
|
|
244
|
+
`applyRuntimeDefaultsFromGeneralSettings`)
|
|
245
|
+
3. `profiles/market_adapter_settings.json` → `globals` → `pairs[].marketAdapterSettings` → `pairs[].botOverrides[<botName>]`
|
|
246
|
+
|
|
247
|
+
The effective numbers come from the production resolvers themselves
|
|
248
|
+
(`applyRuntimeDefaultsFromGeneralSettings`, `resolveBotCfg`,
|
|
249
|
+
`calculateBotThreshold`, `MarketAdapterService.resolveAmaSlopeDeltaThresholdPercent`),
|
|
250
|
+
so the chart cannot drift from the runtime. The panel labels the winning layer;
|
|
251
|
+
`--grid-delta-pct` / `--grid-slope-delta-pct` short-circuit the chain and report
|
|
252
|
+
`cli` as the source.
|
|
253
|
+
|
|
254
|
+
**Gates the replay honors**
|
|
255
|
+
|
|
256
|
+
- The `Δs` trigger only fires for AMA-grid bots whitelisted for
|
|
257
|
+
`asymmetricBounds` (range scaling) in
|
|
258
|
+
`profiles/market_adapter_whitelist.json` **and** carrying an explicit
|
|
259
|
+
`weightDistribution` — the adapter skips the slope signal otherwise.
|
|
260
|
+
When gated off, the panel shows the threshold with `off` and the slope
|
|
261
|
+
trigger is inert, like in production. A non-positive resolved threshold
|
|
262
|
+
disables the trigger too (it never means "fire every cycle").
|
|
263
|
+
- The replay starts at the AMA warmup point (`getAmaWarmupBars`), capped at half
|
|
264
|
+
the dataset so a short chart still shows something; the applied value is in
|
|
265
|
+
the panel and can be forced with `--grid-warmup`.
|
|
266
|
+
- Absolute `minPrice`/`maxPrice` pin the center like `clampGridPriceToBounds` —
|
|
267
|
+
drift is measured against the **clamped** center, so an AMA outside the
|
|
268
|
+
bounds does not emit a reset marker every bar; `"Nx"` multipliers travel with
|
|
269
|
+
the center and never clamp.
|
|
270
|
+
- Not simulated (out of scope for a candle chart): RMS structural divergence,
|
|
271
|
+
available-funds resizes, manual/legacy triggers, and the staleness / gap /
|
|
272
|
+
no-new-candle suppression gates. One evaluation per 1h bar.
|
|
273
|
+
|
|
274
|
+
The replay runs in the page, so the AMA series (and therefore the trigger
|
|
275
|
+
points) follows the AMA inputs and preset buttons; the gating parameters that
|
|
276
|
+
would come from config (`erPeriod`, lookback, warmup, clip percentile) are fixed
|
|
277
|
+
at generation time. The replay uses the canonical `simulateGridResetSeries()`
|
|
278
|
+
from `analysis/tradingview/grid_reset_sim.ts`, embedded verbatim via
|
|
279
|
+
`embedFunctionSources` — not a hand copy of the adapter logic.
|
|
280
|
+
|
|
204
281
|
## Notes
|
|
205
282
|
|
|
206
283
|
- The chart embeds the vendored `uPlot` runtime inline (no CDN, no sibling `uplot/` dir, no DEXBot2 install needed). Each export is a single self-contained HTML file that renders anywhere, even after being copied or mailed to a machine without DEXBot2.
|
|
@@ -216,7 +293,7 @@ market_adapter/data/lp/<pair>/lp_pool_<id>_<interval>.json
|
|
|
216
293
|
- The update marker falls back to `prevUpdateLastCandleSec` / `prevUpdateNewBars` stamped in the candle-file `meta` when the flags are absent; those fields are written by external incremental-fetch tooling, not by anything in this repo.
|
|
217
294
|
- `Ctrl+0` (or `Cmd+0`) resets the time-axis zoom to the full dataset.
|
|
218
295
|
- Mouse: drag the candles to pan time + price (price drag sets a manual range); wheel zooms time, except over the price axis where it zooms price. Shift+wheel zooms price anywhere over the price pane (cursor-anchored). Dragging the price-axis gutter scales price, dragging the time-axis gutter scales the timeframe; double-click the price axis to return to autofit. While the price range is manual, timeframe moves no longer refit it.
|
|
219
|
-
- Indicator, timeframe, scale, and overlay-visibility changes are persisted in browser `localStorage` per pool/pair chart (`dexbot2-tradingview-uplot-v3:<pool>:<A>_<B>:<baseSecs|base>`); cursor sync between the price/volume panes uses a separate constant key.
|
|
296
|
+
- Indicator, timeframe, scale, and overlay-visibility changes are persisted in browser `localStorage` per pool/pair chart (`dexbot2-tradingview-uplot-v3:<pool>:<A>_<B>:<baseSecs|base>`); cursor sync between the price/volume panes uses a separate constant key. The `Resets` toggle is persisted the same way, so a chart opened from a previous session keeps its simulation state.
|
|
220
297
|
- The price axis defaults to log base `10`, with a toolbar switch for `Log` / `Linear`.
|
|
221
298
|
- If you regenerate the HTML and then open it later, no CDN access is needed — the `uPlot` library (JS + CSS) is inlined into the file itself, so it renders fully offline and is independent of where the file lives on disk.
|
|
222
299
|
|
|
@@ -170,7 +170,7 @@ All panels share aligned vertical time grid lines, and the bottom output panel s
|
|
|
170
170
|
| **lb** | 1–32 | 9 | Logarithmic. Lookback bars for AMA slope calculation |
|
|
171
171
|
| **ema** | 0–32 | 0 | AMA input EMA span in bars (0 = off). Low-pass filters the AMA before the slope is taken; the gray dashed Raw‰ line shows the unfiltered slope for comparison |
|
|
172
172
|
| **amaS%** | 0.06–0.12 | 0.09 | Logarithmic. Gear ratio for average per-bar AMA slope saturation |
|
|
173
|
-
| **kalS%** | 0.5–1.5 | 1.
|
|
173
|
+
| **kalS%** | 0.5–1.5 | 1.11 | Logarithmic. Gear ratio for Kalman composite saturation |
|
|
174
174
|
| **clip%** | 0–55 | 10 | Percentile clip: filters extreme inputs (0 = off) |
|
|
175
175
|
|
|
176
176
|
### Output Controls
|
package/claw/package.json
CHANGED
|
@@ -23,6 +23,10 @@ declare function parseArgs(): {
|
|
|
23
23
|
rangeSpan: number | undefined;
|
|
24
24
|
ordersFile: string | null;
|
|
25
25
|
noOrders: boolean;
|
|
26
|
+
gridResetEnabled: boolean;
|
|
27
|
+
gridDeltaPct: number | undefined;
|
|
28
|
+
gridSlopeDeltaPct: number | undefined;
|
|
29
|
+
gridWarmupBars: number | undefined;
|
|
26
30
|
noUpdateMarker: boolean;
|
|
27
31
|
updateMarkerTsSec: number | null;
|
|
28
32
|
updateMarkerNewBars: number | null;
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
import fs from 'node:fs';
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import { generateHTML } from './tradingview_uplot_chart_generator.js';
|
|
6
|
+
import { resolveGridResetSimConfig, toGridSimPayload } from './grid_reset_config.js';
|
|
7
|
+
import { resolveAmaConfig } from '../bot_key_utils.js';
|
|
6
8
|
import { MARKET_ADAPTER } from '../../modules/constants.js';
|
|
7
9
|
import { loadCandleFile } from '../math_utils.js';
|
|
8
10
|
import { getErrorMessage } from '../../modules/utils/errors.js';
|
|
@@ -35,6 +37,10 @@ function parseArgs() {
|
|
|
35
37
|
rangeSpan: undefined,
|
|
36
38
|
ordersFile: null,
|
|
37
39
|
noOrders: false,
|
|
40
|
+
gridResetEnabled: true,
|
|
41
|
+
gridDeltaPct: undefined,
|
|
42
|
+
gridSlopeDeltaPct: undefined,
|
|
43
|
+
gridWarmupBars: undefined,
|
|
38
44
|
noUpdateMarker: false,
|
|
39
45
|
updateMarkerTsSec: null,
|
|
40
46
|
updateMarkerNewBars: null,
|
|
@@ -85,6 +91,31 @@ function parseArgs() {
|
|
|
85
91
|
config.ordersFile = String(args[++i] || '');
|
|
86
92
|
else if (arg === '--no-orders')
|
|
87
93
|
config.noOrders = true;
|
|
94
|
+
else if (arg === '--grid-reset')
|
|
95
|
+
config.gridResetEnabled = true;
|
|
96
|
+
else if (arg === '--no-grid-reset')
|
|
97
|
+
config.gridResetEnabled = false;
|
|
98
|
+
else if (arg === '--grid-delta-pct') {
|
|
99
|
+
const v = parseFloat(args[++i]);
|
|
100
|
+
if (Number.isFinite(v) && v > 0)
|
|
101
|
+
config.gridDeltaPct = Math.max(0.01, v);
|
|
102
|
+
else
|
|
103
|
+
console.warn('[TradingView] --grid-delta-pct requires a positive number; ignoring.');
|
|
104
|
+
}
|
|
105
|
+
else if (arg === '--grid-slope-delta-pct') {
|
|
106
|
+
const v = parseFloat(args[++i]);
|
|
107
|
+
if (Number.isFinite(v) && v > 0)
|
|
108
|
+
config.gridSlopeDeltaPct = Math.max(0.0001, v);
|
|
109
|
+
else
|
|
110
|
+
console.warn('[TradingView] --grid-slope-delta-pct requires a positive number; ignoring.');
|
|
111
|
+
}
|
|
112
|
+
else if (arg === '--grid-warmup') {
|
|
113
|
+
const v = parseFloat(args[++i]);
|
|
114
|
+
if (Number.isFinite(v) && v >= 0)
|
|
115
|
+
config.gridWarmupBars = Math.max(0, Math.round(v));
|
|
116
|
+
else
|
|
117
|
+
console.warn('[TradingView] --grid-warmup requires a non-negative bar count; ignoring.');
|
|
118
|
+
}
|
|
88
119
|
else if (arg === '--no-update-marker')
|
|
89
120
|
config.noUpdateMarker = true;
|
|
90
121
|
else if (arg === '--update-marker-ts')
|
|
@@ -234,6 +265,28 @@ async function main() {
|
|
|
234
265
|
const gridBounds = { low: ordersData.low, high: ordersData.high };
|
|
235
266
|
if (!config.quiet && ordersFile)
|
|
236
267
|
console.log(`[TradingView] Order overlay: ${orderBuys.length} buys + ${orderSells.length} sells from ${ordersFile}`);
|
|
268
|
+
// Grid-reset simulation (docs/GRID_RECALCULATION.md §3/§4): resolve the
|
|
269
|
+
// AMA-price and AMA-slope delta thresholds exactly like the running
|
|
270
|
+
// adapter does (constants → general.settings → market_adapter_settings
|
|
271
|
+
// globals/pair/bot), so the chart replays the real recentering points.
|
|
272
|
+
const simOverrides = {
|
|
273
|
+
priceDeltaThresholdPercent: config.gridDeltaPct,
|
|
274
|
+
slopeDeltaThresholdPercent: config.gridSlopeDeltaPct,
|
|
275
|
+
warmupBars: config.gridWarmupBars,
|
|
276
|
+
};
|
|
277
|
+
const gridSim = botKey
|
|
278
|
+
? toGridSimPayload(resolveGridResetSimConfig({
|
|
279
|
+
botKey,
|
|
280
|
+
bot: botMeta,
|
|
281
|
+
ama: resolveAmaConfig(botKey),
|
|
282
|
+
overrides: simOverrides,
|
|
283
|
+
}))
|
|
284
|
+
: null;
|
|
285
|
+
if (!config.quiet && gridSim) {
|
|
286
|
+
console.log(`[TradingView] Grid resets: AMA Δ ${gridSim.priceDeltaThresholdPercent}% (${gridSim.priceSource})`
|
|
287
|
+
+ ` | AMA-Slope Δ ${gridSim.slopeDeltaThresholdPercent}%/bar (${gridSim.slopeSource})`
|
|
288
|
+
+ ` | slope trigger ${gridSim.slopeEnabled ? 'on' : 'off'}`);
|
|
289
|
+
}
|
|
237
290
|
const html = generateHTML({
|
|
238
291
|
candles,
|
|
239
292
|
meta: jsonMeta || {
|
|
@@ -259,6 +312,8 @@ async function main() {
|
|
|
259
312
|
rangeScaleEnabled: config.rangeScaleEnabled,
|
|
260
313
|
rangeSpan: config.rangeSpan,
|
|
261
314
|
grid,
|
|
315
|
+
gridSim,
|
|
316
|
+
gridSimEnabled: config.gridResetEnabled,
|
|
262
317
|
priceScale: config.priceScale === 'linear' ? 'linear' : 'log',
|
|
263
318
|
defaultTimeframe: '1h',
|
|
264
319
|
marketAdapter: MARKET_ADAPTER,
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {Object} input
|
|
3
|
+
* @param {string|null} input.botKey Bot key from profiles/bots.json.
|
|
4
|
+
* @param {Object|null} input.bot Raw bots.json entry (for cfg layering).
|
|
5
|
+
* @param {Object|null} input.ama Resolved AMA config (er/fast/slow) the chart runs with.
|
|
6
|
+
* @param {Object} [input.overrides] CLI overrides {priceDeltaThresholdPercent, slopeDeltaThresholdPercent, enabled}.
|
|
7
|
+
*/
|
|
8
|
+
declare function resolveGridResetSimConfig({ botKey, bot, ama, overrides }?: any): {
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
botKey: any;
|
|
11
|
+
priceDeltaThresholdPercent: any;
|
|
12
|
+
priceSource: any;
|
|
13
|
+
slopeDeltaThresholdPercent: any;
|
|
14
|
+
slopeSource: any;
|
|
15
|
+
slopeEnabled: boolean;
|
|
16
|
+
dynamicWeightEnabled: boolean;
|
|
17
|
+
lookbackBars: any;
|
|
18
|
+
maxSlopePct: any;
|
|
19
|
+
neutralZonePct: number;
|
|
20
|
+
maxSlopeOffset: any;
|
|
21
|
+
clipPercentile: number;
|
|
22
|
+
maxAsymmetryFactor: any;
|
|
23
|
+
minScaleSlots: any;
|
|
24
|
+
incrementPercent: number | null;
|
|
25
|
+
erPeriod: number;
|
|
26
|
+
warmupBars: number;
|
|
27
|
+
warmupBarsOverride: number | null;
|
|
28
|
+
clampMin: number | null;
|
|
29
|
+
clampMax: number | null;
|
|
30
|
+
notes: string[];
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Flatten the resolved config for the chart payload, dropping anything the page
|
|
34
|
+
* must not see (e.g. Infinity from a disabled threshold).
|
|
35
|
+
*/
|
|
36
|
+
declare function toGridSimPayload(cfg: any): {
|
|
37
|
+
enabled: boolean;
|
|
38
|
+
botKey: any;
|
|
39
|
+
priceDeltaThresholdPercent: any;
|
|
40
|
+
priceSource: any;
|
|
41
|
+
slopeDeltaThresholdPercent: any;
|
|
42
|
+
slopeSource: any;
|
|
43
|
+
slopeEnabled: boolean;
|
|
44
|
+
dynamicWeightEnabled: boolean;
|
|
45
|
+
lookbackBars: any;
|
|
46
|
+
maxSlopePct: any;
|
|
47
|
+
neutralZonePct: any;
|
|
48
|
+
maxSlopeOffset: any;
|
|
49
|
+
clipPercentile: any;
|
|
50
|
+
maxAsymmetryFactor: any;
|
|
51
|
+
minScaleSlots: any;
|
|
52
|
+
incrementPercent: any;
|
|
53
|
+
erPeriod: any;
|
|
54
|
+
warmupBars: any;
|
|
55
|
+
warmupBarsOverride: any;
|
|
56
|
+
clampMin: any;
|
|
57
|
+
clampMax: any;
|
|
58
|
+
notes: any;
|
|
59
|
+
} | null;
|
|
60
|
+
export { resolveGridResetSimConfig, toGridSimPayload };
|
|
61
|
+
//# sourceMappingURL=grid_reset_config.d.ts.map
|