dexbot 1.3.3 → 1.4.1
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/dist/analysis/chart_utils.d.ts +11 -9
- package/dist/analysis/chart_utils.d.ts.map +1 -1
- package/dist/analysis/chart_utils.js +21 -16
- package/dist/analysis/chart_utils.js.map +1 -1
- package/dist/analysis/math_utils.d.ts +4 -13
- package/dist/analysis/math_utils.d.ts.map +1 -1
- package/dist/analysis/math_utils.js +16 -18
- package/dist/analysis/math_utils.js.map +1 -1
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.d.ts +3 -7
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.d.ts.map +1 -1
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js +38 -34
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js.map +1 -1
- package/dist/analysis/trend_detection/hurst_analyzer.d.ts +1 -4
- package/dist/analysis/trend_detection/hurst_analyzer.d.ts.map +1 -1
- package/dist/analysis/trend_detection/hurst_analyzer.js +10 -7
- package/dist/analysis/trend_detection/hurst_analyzer.js.map +1 -1
- package/dist/analysis/trend_detection/kalman_trend_analyzer.d.ts +6 -6
- package/dist/analysis/trend_detection/kalman_trend_analyzer.d.ts.map +1 -1
- package/dist/analysis/trend_detection/kalman_trend_analyzer.js +23 -15
- package/dist/analysis/trend_detection/kalman_trend_analyzer.js.map +1 -1
- package/dist/analysis/trend_detection/kalman_velocity_smoothing.d.ts +12 -13
- package/dist/analysis/trend_detection/kalman_velocity_smoothing.d.ts.map +1 -1
- package/dist/analysis/trend_detection/kalman_velocity_smoothing.js +16 -16
- package/dist/analysis/trend_detection/kalman_velocity_smoothing.js.map +1 -1
- package/dist/analysis/trend_detection/permutation_entropy_analyzer.d.ts +1 -4
- package/dist/analysis/trend_detection/permutation_entropy_analyzer.d.ts.map +1 -1
- package/dist/analysis/trend_detection/permutation_entropy_analyzer.js +10 -7
- package/dist/analysis/trend_detection/permutation_entropy_analyzer.js.map +1 -1
- package/dist/bot.d.ts.map +1 -1
- package/dist/bot.js +6 -13
- package/dist/bot.js.map +1 -1
- package/dist/credential-daemon.d.ts.map +1 -1
- package/dist/credential-daemon.js +21 -22
- package/dist/credential-daemon.js.map +1 -1
- package/dist/dexbot.d.ts.map +1 -1
- package/dist/dexbot.js +16 -15
- package/dist/dexbot.js.map +1 -1
- package/dist/market_adapter/ama_signal_runner.d.ts +1 -1
- package/dist/market_adapter/ama_signal_runner.d.ts.map +1 -1
- package/dist/market_adapter/ama_signal_runner.js +8 -20
- package/dist/market_adapter/ama_signal_runner.js.map +1 -1
- package/dist/market_adapter/candle_utils.d.ts +2 -10
- package/dist/market_adapter/candle_utils.d.ts.map +1 -1
- package/dist/market_adapter/candle_utils.js +7 -8
- package/dist/market_adapter/candle_utils.js.map +1 -1
- package/dist/market_adapter/core/asymmetric_bounds.d.ts +12 -7
- package/dist/market_adapter/core/asymmetric_bounds.d.ts.map +1 -1
- package/dist/market_adapter/core/asymmetric_bounds.js +4 -5
- package/dist/market_adapter/core/asymmetric_bounds.js.map +1 -1
- package/dist/market_adapter/core/config_normalizers.d.ts +4 -9
- package/dist/market_adapter/core/config_normalizers.d.ts.map +1 -1
- package/dist/market_adapter/core/config_normalizers.js +9 -9
- package/dist/market_adapter/core/config_normalizers.js.map +1 -1
- package/dist/market_adapter/core/kibana_candles.d.ts +16 -20
- package/dist/market_adapter/core/kibana_candles.d.ts.map +1 -1
- package/dist/market_adapter/core/kibana_candles.js +16 -15
- package/dist/market_adapter/core/kibana_candles.js.map +1 -1
- package/dist/market_adapter/core/kibana_client.d.ts +8 -11
- package/dist/market_adapter/core/kibana_client.d.ts.map +1 -1
- package/dist/market_adapter/core/kibana_client.js +13 -11
- package/dist/market_adapter/core/kibana_client.js.map +1 -1
- package/dist/market_adapter/core/kibana_market_candles.d.ts +5 -12
- package/dist/market_adapter/core/kibana_market_candles.d.ts.map +1 -1
- package/dist/market_adapter/core/kibana_market_candles.js +12 -21
- package/dist/market_adapter/core/kibana_market_candles.js.map +1 -1
- package/dist/market_adapter/core/market_adapter_service.d.ts +75 -53
- package/dist/market_adapter/core/market_adapter_service.d.ts.map +1 -1
- package/dist/market_adapter/core/market_adapter_service.js +102 -98
- package/dist/market_adapter/core/market_adapter_service.js.map +1 -1
- package/dist/market_adapter/core/strategies/ama.d.ts +21 -1
- package/dist/market_adapter/core/strategies/ama.d.ts.map +1 -1
- package/dist/market_adapter/core/strategies/ama.js +10 -10
- package/dist/market_adapter/core/strategies/ama.js.map +1 -1
- package/dist/market_adapter/core/strategies/ama_slope_model.d.ts +7 -11
- package/dist/market_adapter/core/strategies/ama_slope_model.d.ts.map +1 -1
- package/dist/market_adapter/core/strategies/ama_slope_model.js +23 -30
- package/dist/market_adapter/core/strategies/ama_slope_model.js.map +1 -1
- package/dist/market_adapter/core/strategies/atr/calculator.d.ts +5 -4
- package/dist/market_adapter/core/strategies/atr/calculator.d.ts.map +1 -1
- package/dist/market_adapter/core/strategies/atr/calculator.js +5 -3
- package/dist/market_adapter/core/strategies/atr/calculator.js.map +1 -1
- package/dist/market_adapter/core/strategies/collateral_manager.d.ts +4 -7
- package/dist/market_adapter/core/strategies/collateral_manager.d.ts.map +1 -1
- package/dist/market_adapter/core/strategies/collateral_manager.js +5 -4
- package/dist/market_adapter/core/strategies/collateral_manager.js.map +1 -1
- package/dist/market_adapter/core/strategies/regime_gate.d.ts +11 -19
- package/dist/market_adapter/core/strategies/regime_gate.d.ts.map +1 -1
- package/dist/market_adapter/core/strategies/regime_gate.js +22 -22
- package/dist/market_adapter/core/strategies/regime_gate.js.map +1 -1
- package/dist/market_adapter/index.d.ts +24 -2
- package/dist/market_adapter/index.d.ts.map +1 -1
- package/dist/market_adapter/index.js +82 -56
- package/dist/market_adapter/index.js.map +1 -1
- package/dist/market_adapter/inputs/fetch_cex_synthetic_data.js +26 -37
- package/dist/market_adapter/inputs/fetch_cex_synthetic_data.js.map +1 -1
- package/dist/market_adapter/inputs/fetch_lp_data.d.ts +4 -12
- package/dist/market_adapter/inputs/fetch_lp_data.d.ts.map +1 -1
- package/dist/market_adapter/inputs/fetch_lp_data.js +100 -66
- package/dist/market_adapter/inputs/fetch_lp_data.js.map +1 -1
- package/dist/market_adapter/inputs/kibana_source.d.ts +4 -9
- package/dist/market_adapter/inputs/kibana_source.d.ts.map +1 -1
- package/dist/market_adapter/inputs/kibana_source.js +17 -18
- package/dist/market_adapter/inputs/kibana_source.js.map +1 -1
- package/dist/market_adapter/interval_utils.d.ts +1 -4
- package/dist/market_adapter/interval_utils.d.ts.map +1 -1
- package/dist/market_adapter/interval_utils.js +2 -3
- package/dist/market_adapter/interval_utils.js.map +1 -1
- package/dist/market_adapter/log_format.d.ts +1 -9
- package/dist/market_adapter/log_format.d.ts.map +1 -1
- package/dist/market_adapter/log_format.js +7 -8
- package/dist/market_adapter/log_format.js.map +1 -1
- package/dist/market_adapter/lp_chart_core.d.ts +1 -4
- package/dist/market_adapter/lp_chart_core.d.ts.map +1 -1
- package/dist/market_adapter/lp_chart_core.js +22 -20
- package/dist/market_adapter/lp_chart_core.js.map +1 -1
- package/dist/market_adapter/lp_chart_runner.d.ts +13 -24
- package/dist/market_adapter/lp_chart_runner.d.ts.map +1 -1
- package/dist/market_adapter/lp_chart_runner.js +58 -56
- package/dist/market_adapter/lp_chart_runner.js.map +1 -1
- package/dist/market_adapter/lp_chart_strategy_loader.d.ts +4 -17
- package/dist/market_adapter/lp_chart_strategy_loader.d.ts.map +1 -1
- package/dist/market_adapter/lp_chart_strategy_loader.js +36 -36
- package/dist/market_adapter/lp_chart_strategy_loader.js.map +1 -1
- package/dist/market_adapter/market_adapter.d.ts +51 -72
- package/dist/market_adapter/market_adapter.d.ts.map +1 -1
- package/dist/market_adapter/market_adapter.js +227 -192
- package/dist/market_adapter/market_adapter.js.map +1 -1
- package/dist/market_adapter/merge_lp_data.js +17 -16
- package/dist/market_adapter/merge_lp_data.js.map +1 -1
- package/dist/market_adapter/test_helpers.d.ts +9 -13
- package/dist/market_adapter/test_helpers.d.ts.map +1 -1
- package/dist/market_adapter/test_helpers.js +14 -14
- package/dist/market_adapter/test_helpers.js.map +1 -1
- package/dist/market_adapter/utils/adapter_client.d.ts +6 -14
- package/dist/market_adapter/utils/adapter_client.d.ts.map +1 -1
- package/dist/market_adapter/utils/adapter_client.js +16 -15
- package/dist/market_adapter/utils/adapter_client.js.map +1 -1
- package/dist/market_adapter/utils/atomic_write.d.ts +2 -5
- package/dist/market_adapter/utils/atomic_write.d.ts.map +1 -1
- package/dist/market_adapter/utils/atomic_write.js +5 -5
- package/dist/market_adapter/utils/atomic_write.js.map +1 -1
- package/dist/market_adapter/utils/chain.d.ts +19 -21
- package/dist/market_adapter/utils/chain.d.ts.map +1 -1
- package/dist/market_adapter/utils/chain.js +15 -16
- package/dist/market_adapter/utils/chain.js.map +1 -1
- package/dist/market_adapter/utils/data_discovery.d.ts +1 -4
- package/dist/market_adapter/utils/data_discovery.d.ts.map +1 -1
- package/dist/market_adapter/utils/data_discovery.js +10 -10
- package/dist/market_adapter/utils/data_discovery.js.map +1 -1
- package/dist/market_adapter/utils/dynamic_grid_snapshot.d.ts +1 -6
- package/dist/market_adapter/utils/dynamic_grid_snapshot.d.ts.map +1 -1
- package/dist/market_adapter/utils/dynamic_grid_snapshot.js +14 -14
- package/dist/market_adapter/utils/dynamic_grid_snapshot.js.map +1 -1
- package/dist/market_adapter/utils/file_lock.d.ts +1 -7
- package/dist/market_adapter/utils/file_lock.d.ts.map +1 -1
- package/dist/market_adapter/utils/file_lock.js +21 -25
- package/dist/market_adapter/utils/file_lock.js.map +1 -1
- package/dist/market_adapter/utils/native_history.d.ts +12 -12
- package/dist/market_adapter/utils/native_history.d.ts.map +1 -1
- package/dist/market_adapter/utils/native_history.js +15 -15
- package/dist/market_adapter/utils/native_history.js.map +1 -1
- package/dist/market_adapter/utils/paths.d.ts +2 -4
- package/dist/market_adapter/utils/paths.d.ts.map +1 -1
- package/dist/market_adapter/utils/paths.js +6 -5
- package/dist/market_adapter/utils/paths.js.map +1 -1
- package/dist/modules/account_bots.d.ts +7 -8
- package/dist/modules/account_bots.d.ts.map +1 -1
- package/dist/modules/account_bots.js +92 -114
- package/dist/modules/account_bots.js.map +1 -1
- package/dist/modules/account_orders.d.ts +5 -9
- package/dist/modules/account_orders.d.ts.map +1 -1
- package/dist/modules/account_orders.js +69 -32
- package/dist/modules/account_orders.js.map +1 -1
- package/dist/modules/authority_resolver.d.ts +32 -1
- package/dist/modules/authority_resolver.d.ts.map +1 -1
- package/dist/modules/authority_resolver.js +18 -12
- package/dist/modules/authority_resolver.js.map +1 -1
- package/dist/modules/bitshares-native/chain_client.d.ts +3 -8
- package/dist/modules/bitshares-native/chain_client.d.ts.map +1 -1
- package/dist/modules/bitshares-native/chain_client.js +21 -16
- package/dist/modules/bitshares-native/chain_client.js.map +1 -1
- package/dist/modules/bitshares-native/crypto/ecc.browser.d.ts +21 -29
- package/dist/modules/bitshares-native/crypto/ecc.browser.d.ts.map +1 -1
- package/dist/modules/bitshares-native/crypto/ecc.browser.js +72 -38
- package/dist/modules/bitshares-native/crypto/ecc.browser.js.map +1 -1
- package/dist/modules/bitshares-native/crypto/ecc.d.ts +9 -36
- package/dist/modules/bitshares-native/crypto/ecc.d.ts.map +1 -1
- package/dist/modules/bitshares-native/crypto/ecc.js +40 -83
- package/dist/modules/bitshares-native/crypto/ecc.js.map +1 -1
- package/dist/modules/bitshares-native/crypto/ecc_selector.d.ts +14 -1
- package/dist/modules/bitshares-native/crypto/ecc_selector.d.ts.map +1 -1
- package/dist/modules/bitshares-native/crypto/ecc_selector.js +5 -3
- package/dist/modules/bitshares-native/crypto/ecc_selector.js.map +1 -1
- package/dist/modules/bitshares-native/index.d.ts +10 -2
- package/dist/modules/bitshares-native/index.d.ts.map +1 -1
- package/dist/modules/bitshares-native/index.js +68 -31
- package/dist/modules/bitshares-native/index.js.map +1 -1
- package/dist/modules/bitshares-native/lru_cache.d.ts +1 -4
- package/dist/modules/bitshares-native/lru_cache.d.ts.map +1 -1
- package/dist/modules/bitshares-native/lru_cache.js +6 -3
- package/dist/modules/bitshares-native/lru_cache.js.map +1 -1
- package/dist/modules/bitshares-native/resolvers.d.ts +3 -6
- package/dist/modules/bitshares-native/resolvers.d.ts.map +1 -1
- package/dist/modules/bitshares-native/resolvers.js +11 -9
- package/dist/modules/bitshares-native/resolvers.js.map +1 -1
- package/dist/modules/bitshares-native/serial/chain_constants.d.ts +53 -55
- package/dist/modules/bitshares-native/serial/chain_constants.d.ts.map +1 -1
- package/dist/modules/bitshares-native/serial/chain_constants.js +28 -27
- package/dist/modules/bitshares-native/serial/chain_constants.js.map +1 -1
- package/dist/modules/bitshares-native/serial/index.d.ts +5 -9
- package/dist/modules/bitshares-native/serial/index.d.ts.map +1 -1
- package/dist/modules/bitshares-native/serial/index.js +46 -12
- package/dist/modules/bitshares-native/serial/index.js.map +1 -1
- package/dist/modules/bitshares-native/serial/operations.d.ts +102 -100
- package/dist/modules/bitshares-native/serial/operations.d.ts.map +1 -1
- package/dist/modules/bitshares-native/serial/operations.js +473 -471
- package/dist/modules/bitshares-native/serial/operations.js.map +1 -1
- package/dist/modules/bitshares-native/serial/serializer.d.ts +2 -7
- package/dist/modules/bitshares-native/serial/serializer.d.ts.map +1 -1
- package/dist/modules/bitshares-native/serial/serializer.js +8 -3
- package/dist/modules/bitshares-native/serial/serializer.js.map +1 -1
- package/dist/modules/bitshares-native/serial/types.d.ts +26 -41
- package/dist/modules/bitshares-native/serial/types.d.ts.map +1 -1
- package/dist/modules/bitshares-native/serial/types.js +76 -42
- package/dist/modules/bitshares-native/serial/types.js.map +1 -1
- package/dist/modules/bitshares-native/signing_client.d.ts +1 -5
- package/dist/modules/bitshares-native/signing_client.d.ts.map +1 -1
- package/dist/modules/bitshares-native/signing_client.js +49 -11
- package/dist/modules/bitshares-native/signing_client.js.map +1 -1
- package/dist/modules/bitshares-native/subscriptions.d.ts +1 -4
- package/dist/modules/bitshares-native/subscriptions.d.ts.map +1 -1
- package/dist/modules/bitshares-native/subscriptions.js +47 -84
- package/dist/modules/bitshares-native/subscriptions.js.map +1 -1
- package/dist/modules/bitshares-native/transport.d.ts +1 -8
- package/dist/modules/bitshares-native/transport.d.ts.map +1 -1
- package/dist/modules/bitshares-native/transport.js +22 -15
- package/dist/modules/bitshares-native/transport.js.map +1 -1
- package/dist/modules/bitshares-native/tx/builder.d.ts +3 -8
- package/dist/modules/bitshares-native/tx/builder.d.ts.map +1 -1
- package/dist/modules/bitshares-native/tx/builder.js +61 -23
- package/dist/modules/bitshares-native/tx/builder.js.map +1 -1
- package/dist/modules/bitshares-native/tx/tx_cache.d.ts +1 -8
- package/dist/modules/bitshares-native/tx/tx_cache.d.ts.map +1 -1
- package/dist/modules/bitshares-native/tx/tx_cache.js +21 -17
- package/dist/modules/bitshares-native/tx/tx_cache.js.map +1 -1
- package/dist/modules/bitshares_client.d.ts +12 -23
- package/dist/modules/bitshares_client.d.ts.map +1 -1
- package/dist/modules/bitshares_client.js +109 -56
- package/dist/modules/bitshares_client.js.map +1 -1
- package/dist/modules/bot_settings.d.ts +1 -13
- package/dist/modules/bot_settings.d.ts.map +1 -1
- package/dist/modules/bot_settings.js +34 -34
- package/dist/modules/bot_settings.js.map +1 -1
- package/dist/modules/bots_file_lock.d.ts +3 -9
- package/dist/modules/bots_file_lock.d.ts.map +1 -1
- package/dist/modules/bots_file_lock.js +8 -9
- package/dist/modules/bots_file_lock.js.map +1 -1
- package/dist/modules/chain_keys.d.ts +7 -39
- package/dist/modules/chain_keys.d.ts.map +1 -1
- package/dist/modules/chain_keys.js +126 -90
- package/dist/modules/chain_keys.js.map +1 -1
- package/dist/modules/chain_orders.d.ts +46 -52
- package/dist/modules/chain_orders.d.ts.map +1 -1
- package/dist/modules/chain_orders.js +152 -104
- package/dist/modules/chain_orders.js.map +1 -1
- package/dist/modules/config.d.ts +50 -57
- package/dist/modules/config.d.ts.map +1 -1
- package/dist/modules/config.js +28 -24
- package/dist/modules/config.js.map +1 -1
- package/dist/modules/constants.d.ts +492 -494
- package/dist/modules/constants.d.ts.map +1 -1
- package/dist/modules/constants.js +69 -39
- package/dist/modules/constants.js.map +1 -1
- package/dist/modules/cr_planner.d.ts +1 -13
- package/dist/modules/cr_planner.d.ts.map +1 -1
- package/dist/modules/cr_planner.js +28 -28
- package/dist/modules/cr_planner.js.map +1 -1
- package/dist/modules/credential_policy.d.ts +18 -33
- package/dist/modules/credential_policy.d.ts.map +1 -1
- package/dist/modules/credential_policy.js +114 -87
- package/dist/modules/credential_policy.js.map +1 -1
- package/dist/modules/credential_runtime.d.ts +11 -21
- package/dist/modules/credential_runtime.d.ts.map +1 -1
- package/dist/modules/credential_runtime.js +40 -40
- package/dist/modules/credential_runtime.js.map +1 -1
- package/dist/modules/credential_session_cache.d.ts +8 -8
- package/dist/modules/credential_session_cache.d.ts.map +1 -1
- package/dist/modules/credential_session_cache.js +41 -8
- package/dist/modules/credential_session_cache.js.map +1 -1
- package/dist/modules/credit_runtime.d.ts +51 -316
- package/dist/modules/credit_runtime.d.ts.map +1 -1
- package/dist/modules/credit_runtime.js +257 -183
- package/dist/modules/credit_runtime.js.map +1 -1
- package/dist/modules/crypto/browser_provider.js +6 -6
- package/dist/modules/crypto/browser_provider.js.map +1 -1
- package/dist/modules/crypto/index.d.ts.map +1 -1
- package/dist/modules/crypto/index.js +2 -0
- package/dist/modules/crypto/index.js.map +1 -1
- package/dist/modules/crypto/sync.js +3 -3
- package/dist/modules/crypto/sync.js.map +1 -1
- package/dist/modules/dexbot_class.d.ts +262 -81
- package/dist/modules/dexbot_class.d.ts.map +1 -1
- package/dist/modules/dexbot_class.js +156 -123
- package/dist/modules/dexbot_class.js.map +1 -1
- package/dist/modules/dexbot_cow_runtime.d.ts +12 -9
- package/dist/modules/dexbot_cow_runtime.d.ts.map +1 -1
- package/dist/modules/dexbot_cow_runtime.js +144 -63
- package/dist/modules/dexbot_cow_runtime.js.map +1 -1
- package/dist/modules/dexbot_credential_client.d.ts +5 -11
- package/dist/modules/dexbot_credential_client.d.ts.map +1 -1
- package/dist/modules/dexbot_credential_client.js +32 -30
- package/dist/modules/dexbot_credential_client.js.map +1 -1
- package/dist/modules/dexbot_fill_runtime.d.ts +5 -20
- package/dist/modules/dexbot_fill_runtime.d.ts.map +1 -1
- package/dist/modules/dexbot_fill_runtime.js +55 -116
- package/dist/modules/dexbot_fill_runtime.js.map +1 -1
- package/dist/modules/dexbot_maintenance_runtime.d.ts +12 -12
- package/dist/modules/dexbot_maintenance_runtime.d.ts.map +1 -1
- package/dist/modules/dexbot_maintenance_runtime.js +55 -45
- package/dist/modules/dexbot_maintenance_runtime.js.map +1 -1
- package/dist/modules/dexbot_startup_runtime.d.ts +2 -6
- package/dist/modules/dexbot_startup_runtime.d.ts.map +1 -1
- package/dist/modules/dexbot_startup_runtime.js +122 -91
- package/dist/modules/dexbot_startup_runtime.js.map +1 -1
- package/dist/modules/dexbot_state_recovery.d.ts +11 -24
- package/dist/modules/dexbot_state_recovery.d.ts.map +1 -1
- package/dist/modules/dexbot_state_recovery.js +62 -28
- package/dist/modules/dexbot_state_recovery.js.map +1 -1
- package/dist/modules/fund_registry.d.ts +1 -13
- package/dist/modules/fund_registry.d.ts.map +1 -1
- package/dist/modules/fund_registry.js +23 -21
- package/dist/modules/fund_registry.js.map +1 -1
- package/dist/modules/general_settings.d.ts +3 -7
- package/dist/modules/general_settings.d.ts.map +1 -1
- package/dist/modules/general_settings.js +15 -14
- package/dist/modules/general_settings.js.map +1 -1
- package/dist/modules/graceful_shutdown.d.ts +1 -6
- package/dist/modules/graceful_shutdown.d.ts.map +1 -1
- package/dist/modules/graceful_shutdown.js +19 -16
- package/dist/modules/graceful_shutdown.js.map +1 -1
- package/dist/modules/key_store.d.ts.map +1 -1
- package/dist/modules/key_store.js +53 -19
- package/dist/modules/key_store.js.map +1 -1
- package/dist/modules/launcher/bot_supervisor.d.ts +23 -66
- package/dist/modules/launcher/bot_supervisor.d.ts.map +1 -1
- package/dist/modules/launcher/bot_supervisor.js +115 -107
- package/dist/modules/launcher/bot_supervisor.js.map +1 -1
- package/dist/modules/launcher/child_env.d.ts +2 -5
- package/dist/modules/launcher/child_env.d.ts.map +1 -1
- package/dist/modules/launcher/child_env.js +4 -4
- package/dist/modules/launcher/child_env.js.map +1 -1
- package/dist/modules/launcher/credential_bootstrap.d.ts +4 -8
- package/dist/modules/launcher/credential_bootstrap.d.ts.map +1 -1
- package/dist/modules/launcher/credential_bootstrap.js +30 -26
- package/dist/modules/launcher/credential_bootstrap.js.map +1 -1
- package/dist/modules/launcher/credential_daemon.d.ts +8 -15
- package/dist/modules/launcher/credential_daemon.d.ts.map +1 -1
- package/dist/modules/launcher/credential_daemon.js +72 -41
- package/dist/modules/launcher/credential_daemon.js.map +1 -1
- package/dist/modules/launcher/credential_secret.d.ts +1 -4
- package/dist/modules/launcher/credential_secret.d.ts.map +1 -1
- package/dist/modules/launcher/credential_secret.js +36 -4
- package/dist/modules/launcher/credential_secret.js.map +1 -1
- package/dist/modules/launcher/foreign_cred_daemon.d.ts +32 -1
- package/dist/modules/launcher/foreign_cred_daemon.d.ts.map +1 -1
- package/dist/modules/launcher/foreign_cred_daemon.js +25 -28
- package/dist/modules/launcher/foreign_cred_daemon.js.map +1 -1
- package/dist/modules/launcher/headless_password.d.ts +1 -4
- package/dist/modules/launcher/headless_password.d.ts.map +1 -1
- package/dist/modules/launcher/headless_password.js +11 -11
- package/dist/modules/launcher/headless_password.js.map +1 -1
- package/dist/modules/launcher/launch_modes.d.ts +15 -14
- package/dist/modules/launcher/launch_modes.d.ts.map +1 -1
- package/dist/modules/launcher/launch_modes.js +8 -8
- package/dist/modules/launcher/launch_modes.js.map +1 -1
- package/dist/modules/launcher/market_adapter_runtime.d.ts +10 -19
- package/dist/modules/launcher/market_adapter_runtime.d.ts.map +1 -1
- package/dist/modules/launcher/market_adapter_runtime.js +33 -33
- package/dist/modules/launcher/market_adapter_runtime.js.map +1 -1
- package/dist/modules/launcher/market_adapter_watchdog.d.ts +10 -17
- package/dist/modules/launcher/market_adapter_watchdog.d.ts.map +1 -1
- package/dist/modules/launcher/market_adapter_watchdog.js +42 -38
- package/dist/modules/launcher/market_adapter_watchdog.js.map +1 -1
- package/dist/modules/launcher/monolithic_runtime.d.ts +28 -57
- package/dist/modules/launcher/monolithic_runtime.d.ts.map +1 -1
- package/dist/modules/launcher/monolithic_runtime.js +135 -108
- package/dist/modules/launcher/monolithic_runtime.js.map +1 -1
- package/dist/modules/launcher/runtime_entry.d.ts +5 -10
- package/dist/modules/launcher/runtime_entry.d.ts.map +1 -1
- package/dist/modules/launcher/runtime_entry.js +14 -14
- package/dist/modules/launcher/runtime_entry.js.map +1 -1
- package/dist/modules/launcher/status_reporting.d.ts +17 -37
- package/dist/modules/launcher/status_reporting.d.ts.map +1 -1
- package/dist/modules/launcher/status_reporting.js +35 -34
- package/dist/modules/launcher/status_reporting.js.map +1 -1
- package/dist/modules/launcher/supervisor_control.d.ts +1 -4
- package/dist/modules/launcher/supervisor_control.d.ts.map +1 -1
- package/dist/modules/launcher/supervisor_control.js +9 -4
- package/dist/modules/launcher/supervisor_control.js.map +1 -1
- package/dist/modules/logger.d.ts +3 -1
- package/dist/modules/logger.d.ts.map +1 -1
- package/dist/modules/logger.js +38 -28
- package/dist/modules/logger.js.map +1 -1
- package/dist/modules/market_adapter_whitelist.d.ts +2 -10
- package/dist/modules/market_adapter_whitelist.d.ts.map +1 -1
- package/dist/modules/market_adapter_whitelist.js +18 -16
- package/dist/modules/market_adapter_whitelist.js.map +1 -1
- package/dist/modules/node_health_cache.d.ts +2 -12
- package/dist/modules/node_health_cache.d.ts.map +1 -1
- package/dist/modules/node_health_cache.js +24 -24
- package/dist/modules/node_health_cache.js.map +1 -1
- package/dist/modules/node_manager.d.ts +1 -1
- package/dist/modules/node_manager.d.ts.map +1 -1
- package/dist/modules/node_manager.js +44 -38
- package/dist/modules/node_manager.js.map +1 -1
- package/dist/modules/order/accounting.d.ts +12 -12
- package/dist/modules/order/accounting.d.ts.map +1 -1
- package/dist/modules/order/accounting.js +111 -76
- package/dist/modules/order/accounting.js.map +1 -1
- package/dist/modules/order/async_lock.d.ts +1 -2
- package/dist/modules/order/async_lock.d.ts.map +1 -1
- package/dist/modules/order/async_lock.js +4 -4
- package/dist/modules/order/async_lock.js.map +1 -1
- package/dist/modules/order/export.d.ts +8 -14
- package/dist/modules/order/export.d.ts.map +1 -1
- package/dist/modules/order/export.js +77 -42
- package/dist/modules/order/export.js.map +1 -1
- package/dist/modules/order/format.d.ts +17 -22
- package/dist/modules/order/format.d.ts.map +1 -1
- package/dist/modules/order/format.js +25 -31
- package/dist/modules/order/format.js.map +1 -1
- package/dist/modules/order/grid.d.ts +18 -104
- package/dist/modules/order/grid.d.ts.map +1 -1
- package/dist/modules/order/grid.js +346 -212
- package/dist/modules/order/grid.js.map +1 -1
- package/dist/modules/order/grid_reconcile.d.ts +8 -8
- package/dist/modules/order/grid_reconcile.d.ts.map +1 -1
- package/dist/modules/order/grid_reconcile.js +80 -23
- package/dist/modules/order/grid_reconcile.js.map +1 -1
- package/dist/modules/order/grid_reconcile_internal.d.ts +224 -1
- package/dist/modules/order/grid_reconcile_internal.d.ts.map +1 -1
- package/dist/modules/order/grid_reconcile_internal.js +159 -73
- package/dist/modules/order/grid_reconcile_internal.js.map +1 -1
- package/dist/modules/order/index.d.ts +1 -1
- package/dist/modules/order/index.d.ts.map +1 -1
- package/dist/modules/order/index.js +42 -7
- package/dist/modules/order/index.js.map +1 -1
- package/dist/modules/order/logger.d.ts +6 -16
- package/dist/modules/order/logger.d.ts.map +1 -1
- package/dist/modules/order/logger.js +76 -53
- package/dist/modules/order/logger.js.map +1 -1
- package/dist/modules/order/logger_state.d.ts +4 -4
- package/dist/modules/order/logger_state.d.ts.map +1 -1
- package/dist/modules/order/logger_state.js +3 -1
- package/dist/modules/order/logger_state.js.map +1 -1
- package/dist/modules/order/manager.d.ts +160 -37
- package/dist/modules/order/manager.d.ts.map +1 -1
- package/dist/modules/order/manager.js +166 -128
- package/dist/modules/order/manager.js.map +1 -1
- package/dist/modules/order/processed_fill_store.d.ts +6 -10
- package/dist/modules/order/processed_fill_store.d.ts.map +1 -1
- package/dist/modules/order/processed_fill_store.js +10 -9
- package/dist/modules/order/processed_fill_store.js.map +1 -1
- package/dist/modules/order/strategy.d.ts +3 -3
- package/dist/modules/order/strategy.d.ts.map +1 -1
- package/dist/modules/order/strategy.js +29 -27
- package/dist/modules/order/strategy.js.map +1 -1
- package/dist/modules/order/sync_engine.d.ts +9 -19
- package/dist/modules/order/sync_engine.d.ts.map +1 -1
- package/dist/modules/order/sync_engine.js +176 -126
- package/dist/modules/order/sync_engine.js.map +1 -1
- package/dist/modules/order/utils/math.d.ts +55 -85
- package/dist/modules/order/utils/math.d.ts.map +1 -1
- package/dist/modules/order/utils/math.js +155 -88
- package/dist/modules/order/utils/math.js.map +1 -1
- package/dist/modules/order/utils/order.d.ts +27 -72
- package/dist/modules/order/utils/order.d.ts.map +1 -1
- package/dist/modules/order/utils/order.js +144 -105
- package/dist/modules/order/utils/order.js.map +1 -1
- package/dist/modules/order/utils/system.d.ts +103 -45
- package/dist/modules/order/utils/system.d.ts.map +1 -1
- package/dist/modules/order/utils/system.js +271 -150
- package/dist/modules/order/utils/system.js.map +1 -1
- package/dist/modules/order/utils/validate.d.ts +35 -47
- package/dist/modules/order/utils/validate.d.ts.map +1 -1
- package/dist/modules/order/utils/validate.js +233 -116
- package/dist/modules/order/utils/validate.js.map +1 -1
- package/dist/modules/order/working_grid.d.ts +1 -4
- package/dist/modules/order/working_grid.d.ts.map +1 -1
- package/dist/modules/order/working_grid.js +9 -7
- package/dist/modules/order/working_grid.js.map +1 -1
- package/dist/modules/path_api.js +2 -2
- package/dist/modules/path_api.js.map +1 -1
- package/dist/modules/paths.d.ts +50 -56
- package/dist/modules/paths.d.ts.map +1 -1
- package/dist/modules/paths.js +66 -57
- package/dist/modules/paths.js.map +1 -1
- package/dist/modules/process_discovery.d.ts +1 -1
- package/dist/modules/process_discovery.d.ts.map +1 -1
- package/dist/modules/process_discovery.js +7 -7
- package/dist/modules/process_discovery.js.map +1 -1
- package/dist/modules/runtime.d.ts +1 -1
- package/dist/modules/runtime.d.ts.map +1 -1
- package/dist/modules/runtime.js +4 -4
- package/dist/modules/runtime.js.map +1 -1
- package/dist/modules/runtime_settings.d.ts +1 -0
- package/dist/modules/runtime_settings.d.ts.map +1 -1
- package/dist/modules/runtime_settings.js +15 -10
- package/dist/modules/runtime_settings.js.map +1 -1
- package/dist/modules/settings_merge.d.ts +1 -4
- package/dist/modules/settings_merge.d.ts.map +1 -1
- package/dist/modules/settings_merge.js +2 -1
- package/dist/modules/settings_merge.js.map +1 -1
- package/dist/modules/storage/browser_adapter.d.ts +7 -3
- package/dist/modules/storage/browser_adapter.d.ts.map +1 -1
- package/dist/modules/storage/browser_adapter.js +2 -0
- package/dist/modules/storage/browser_adapter.js.map +1 -1
- package/dist/modules/storage/index.d.ts +2 -2
- package/dist/modules/storage/index.d.ts.map +1 -1
- package/dist/modules/storage/index.js +2 -5
- package/dist/modules/storage/index.js.map +1 -1
- package/dist/modules/storage/node_adapter.d.ts +3 -3
- package/dist/modules/storage/node_adapter.d.ts.map +1 -1
- package/dist/modules/storage/node_adapter.js +9 -7
- package/dist/modules/storage/node_adapter.js.map +1 -1
- package/dist/modules/storage/types.d.ts +13 -10
- package/dist/modules/storage/types.d.ts.map +1 -1
- package/dist/modules/types.d.ts +0 -2
- package/dist/modules/types.d.ts.map +1 -1
- package/dist/modules/utils/base58check.d.ts +1 -9
- package/dist/modules/utils/base58check.d.ts.map +1 -1
- package/dist/modules/utils/base58check.js +14 -16
- package/dist/modules/utils/base58check.js.map +1 -1
- package/dist/modules/utils/build_dir.d.ts +2 -5
- package/dist/modules/utils/build_dir.d.ts.map +1 -1
- package/dist/modules/utils/build_dir.js +6 -3
- package/dist/modules/utils/build_dir.js.map +1 -1
- package/dist/modules/utils/errors.d.ts +2 -0
- package/dist/modules/utils/errors.d.ts.map +1 -0
- package/dist/modules/utils/errors.js +12 -0
- package/dist/modules/utils/errors.js.map +1 -0
- package/dist/modules/utils/fs_utils.d.ts +1 -8
- package/dist/modules/utils/fs_utils.d.ts.map +1 -1
- package/dist/modules/utils/fs_utils.js +8 -3
- package/dist/modules/utils/fs_utils.js.map +1 -1
- package/dist/modules/utils/math_utils.d.ts +2 -6
- package/dist/modules/utils/math_utils.d.ts.map +1 -1
- package/dist/modules/utils/math_utils.js +6 -2
- package/dist/modules/utils/math_utils.js.map +1 -1
- package/dist/modules/validate_profiles.d.ts +1 -11
- package/dist/modules/validate_profiles.d.ts.map +1 -1
- package/dist/modules/validate_profiles.js +25 -27
- package/dist/modules/validate_profiles.js.map +1 -1
- package/dist/pm2.d.ts +7 -6
- package/dist/pm2.d.ts.map +1 -1
- package/dist/pm2.js +132 -106
- package/dist/pm2.js.map +1 -1
- package/dist/scripts/analyze-git.d.ts.map +1 -1
- package/dist/scripts/analyze-git.js +15 -11
- package/dist/scripts/analyze-git.js.map +1 -1
- package/dist/scripts/analyze-orders.d.ts +146 -1
- package/dist/scripts/analyze-orders.d.ts.map +1 -1
- package/dist/scripts/analyze-orders.js +81 -105
- package/dist/scripts/analyze-orders.js.map +1 -1
- package/dist/scripts/diagnose-pool-history.d.ts.map +1 -1
- package/dist/scripts/diagnose-pool-history.js +9 -8
- package/dist/scripts/diagnose-pool-history.js.map +1 -1
- package/dist/scripts/divergence-calc.d.ts.map +1 -1
- package/dist/scripts/divergence-calc.js +11 -8
- package/dist/scripts/divergence-calc.js.map +1 -1
- package/dist/scripts/fix-err-message.d.ts +3 -0
- package/dist/scripts/fix-err-message.d.ts.map +1 -0
- package/dist/scripts/fix-err-message.js +198 -0
- package/dist/scripts/fix-err-message.js.map +1 -0
- package/dist/scripts/generate_lp_chart.d.ts +2 -9
- package/dist/scripts/generate_lp_chart.d.ts.map +1 -1
- package/dist/scripts/generate_lp_chart.js +14 -10
- package/dist/scripts/generate_lp_chart.js.map +1 -1
- package/dist/scripts/generate_mainnet_corpus_report.js +4 -4
- package/dist/scripts/generate_mainnet_corpus_report.js.map +1 -1
- package/dist/scripts/generate_market_adapter_whitelist.d.ts +17 -1
- package/dist/scripts/generate_market_adapter_whitelist.d.ts.map +1 -1
- package/dist/scripts/generate_market_adapter_whitelist.js +23 -20
- package/dist/scripts/generate_market_adapter_whitelist.js.map +1 -1
- package/dist/scripts/migrate_bot_keys.d.ts +1 -4
- package/dist/scripts/migrate_bot_keys.d.ts.map +1 -1
- package/dist/scripts/migrate_bot_keys.js +48 -124
- package/dist/scripts/migrate_bot_keys.js.map +1 -1
- package/dist/scripts/native_release_gates.d.ts.map +1 -1
- package/dist/scripts/native_release_gates.js +18 -14
- package/dist/scripts/native_release_gates.js.map +1 -1
- package/dist/scripts/print_grid.js +1 -1
- package/dist/scripts/print_grid.js.map +1 -1
- package/dist/scripts/run-tests.js +1 -0
- package/dist/scripts/run-tests.js.map +1 -1
- package/dist/scripts/runner.d.ts +1 -11
- package/dist/scripts/runner.d.ts.map +1 -1
- package/dist/scripts/runner.js +21 -19
- package/dist/scripts/runner.js.map +1 -1
- package/dist/scripts/test-credit-renewal.d.ts.map +1 -1
- package/dist/scripts/test-credit-renewal.js +2 -1
- package/dist/scripts/test-credit-renewal.js.map +1 -1
- package/dist/scripts/update.d.ts.map +1 -1
- package/dist/scripts/update.js +85 -79
- package/dist/scripts/update.js.map +1 -1
- package/dist/scripts/validate_bots.js +2 -2
- package/dist/scripts/validate_bots.js.map +1 -1
- package/dist/unlock.d.ts +4 -17
- package/dist/unlock.d.ts.map +1 -1
- package/dist/unlock.js +141 -108
- package/dist/unlock.js.map +1 -1
- package/package.json +1 -1
- package/dist/analysis/ama_fitting/analyze_ama_price_changes.d.ts +0 -3
- package/dist/analysis/ama_fitting/analyze_ama_price_changes.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/analyze_ama_price_changes.js +0 -149
- package/dist/analysis/ama_fitting/analyze_ama_price_changes.js.map +0 -1
- package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.d.ts +0 -3
- package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.js +0 -387
- package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.js.map +0 -1
- package/dist/analysis/ama_fitting/calibrate_convergence_er.d.ts +0 -3
- package/dist/analysis/ama_fitting/calibrate_convergence_er.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/calibrate_convergence_er.js +0 -200
- package/dist/analysis/ama_fitting/calibrate_convergence_er.js.map +0 -1
- package/dist/analysis/ama_fitting/fetch_lp_candles.d.ts +0 -3
- package/dist/analysis/ama_fitting/fetch_lp_candles.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/fetch_lp_candles.js +0 -212
- package/dist/analysis/ama_fitting/fetch_lp_candles.js.map +0 -1
- package/dist/analysis/ama_fitting/generate_unified_comparison_chart.d.ts +0 -31
- package/dist/analysis/ama_fitting/generate_unified_comparison_chart.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/generate_unified_comparison_chart.js +0 -249
- package/dist/analysis/ama_fitting/generate_unified_comparison_chart.js.map +0 -1
- package/dist/analysis/ama_fitting/optimizer_high_resolution.d.ts +0 -2
- package/dist/analysis/ama_fitting/optimizer_high_resolution.d.ts.map +0 -1
- package/dist/analysis/ama_fitting/optimizer_high_resolution.js +0 -782
- package/dist/analysis/ama_fitting/optimizer_high_resolution.js.map +0 -1
- package/dist/analysis/analyze_derivatives.d.ts +0 -95
- package/dist/analysis/analyze_derivatives.d.ts.map +0 -1
- package/dist/analysis/analyze_derivatives.js +0 -295
- package/dist/analysis/analyze_derivatives.js.map +0 -1
- package/dist/analysis/analyze_dynamic_weight.d.ts +0 -14
- package/dist/analysis/analyze_dynamic_weight.d.ts.map +0 -1
- package/dist/analysis/analyze_dynamic_weight.js +0 -207
- package/dist/analysis/analyze_dynamic_weight.js.map +0 -1
- package/dist/analysis/analyze_kalman.d.ts +0 -13
- package/dist/analysis/analyze_kalman.d.ts.map +0 -1
- package/dist/analysis/analyze_kalman.js +0 -123
- package/dist/analysis/analyze_kalman.js.map +0 -1
- package/dist/analysis/analyze_regime.d.ts +0 -20
- package/dist/analysis/analyze_regime.d.ts.map +0 -1
- package/dist/analysis/analyze_regime.js +0 -139
- package/dist/analysis/analyze_regime.js.map +0 -1
- package/dist/analysis/analyze_regime_windows.d.ts +0 -19
- package/dist/analysis/analyze_regime_windows.d.ts.map +0 -1
- package/dist/analysis/analyze_regime_windows.js +0 -413
- package/dist/analysis/analyze_regime_windows.js.map +0 -1
- package/dist/analysis/analyze_risk_profile.d.ts +0 -3
- package/dist/analysis/analyze_risk_profile.d.ts.map +0 -1
- package/dist/analysis/analyze_risk_profile.js +0 -159
- package/dist/analysis/analyze_risk_profile.js.map +0 -1
- package/dist/analysis/analyze_trade_heatmap.d.ts +0 -3
- package/dist/analysis/analyze_trade_heatmap.d.ts.map +0 -1
- package/dist/analysis/analyze_trade_heatmap.js +0 -367
- package/dist/analysis/analyze_trade_heatmap.js.map +0 -1
- package/dist/analysis/analyze_volatility.d.ts +0 -22
- package/dist/analysis/analyze_volatility.d.ts.map +0 -1
- package/dist/analysis/analyze_volatility.js +0 -172
- package/dist/analysis/analyze_volatility.js.map +0 -1
- package/dist/analysis/bot_fitting/backtest_ama_sweep.d.ts +0 -99
- package/dist/analysis/bot_fitting/backtest_ama_sweep.d.ts.map +0 -1
- package/dist/analysis/bot_fitting/backtest_ama_sweep.js +0 -804
- package/dist/analysis/bot_fitting/backtest_ama_sweep.js.map +0 -1
- package/dist/analysis/bot_fitting/backtest_bot_fitting.d.ts +0 -2
- package/dist/analysis/bot_fitting/backtest_bot_fitting.d.ts.map +0 -1
- package/dist/analysis/bot_fitting/backtest_bot_fitting.js +0 -347
- package/dist/analysis/bot_fitting/backtest_bot_fitting.js.map +0 -1
- package/dist/analysis/bot_fitting/shared_utils.d.ts +0 -15
- package/dist/analysis/bot_fitting/shared_utils.d.ts.map +0 -1
- package/dist/analysis/bot_fitting/shared_utils.js +0 -48
- package/dist/analysis/bot_fitting/shared_utils.js.map +0 -1
- package/dist/analysis/bot_key_utils.d.ts +0 -22
- package/dist/analysis/bot_key_utils.d.ts.map +0 -1
- package/dist/analysis/bot_key_utils.js +0 -162
- package/dist/analysis/bot_key_utils.js.map +0 -1
- package/dist/analysis/bot_usage/discover_bot_accounts.d.ts +0 -3
- package/dist/analysis/bot_usage/discover_bot_accounts.d.ts.map +0 -1
- package/dist/analysis/bot_usage/discover_bot_accounts.js +0 -498
- package/dist/analysis/bot_usage/discover_bot_accounts.js.map +0 -1
- package/dist/analysis/bot_usage/kibana_bot_queries.d.ts +0 -546
- package/dist/analysis/bot_usage/kibana_bot_queries.d.ts.map +0 -1
- package/dist/analysis/bot_usage/kibana_bot_queries.js +0 -427
- package/dist/analysis/bot_usage/kibana_bot_queries.js.map +0 -1
- package/dist/analysis/derivative_chart_generator.d.ts +0 -18
- package/dist/analysis/derivative_chart_generator.d.ts.map +0 -1
- package/dist/analysis/derivative_chart_generator.js +0 -896
- package/dist/analysis/derivative_chart_generator.js.map +0 -1
- package/dist/analysis/price_sources.d.ts +0 -34
- package/dist/analysis/price_sources.d.ts.map +0 -1
- package/dist/analysis/price_sources.js +0 -103
- package/dist/analysis/price_sources.js.map +0 -1
- package/dist/analysis/trade_profitability.d.ts +0 -115
- package/dist/analysis/trade_profitability.d.ts.map +0 -1
- package/dist/analysis/trade_profitability.js +0 -1247
- package/dist/analysis/trade_profitability.js.map +0 -1
- package/dist/analysis/tradingview/analyze_tradingview.d.ts +0 -36
- package/dist/analysis/tradingview/analyze_tradingview.d.ts.map +0 -1
- package/dist/analysis/tradingview/analyze_tradingview.js +0 -172
- package/dist/analysis/tradingview/analyze_tradingview.js.map +0 -1
- package/dist/analysis/trend_detection/derivative_analyzer.d.ts +0 -250
- package/dist/analysis/trend_detection/derivative_analyzer.d.ts.map +0 -1
- package/dist/analysis/trend_detection/derivative_analyzer.js +0 -903
- package/dist/analysis/trend_detection/derivative_analyzer.js.map +0 -1
- package/dist/analysis/trend_detection/dynamic_weight_chart_generator.d.ts +0 -6
- package/dist/analysis/trend_detection/dynamic_weight_chart_generator.d.ts.map +0 -1
- package/dist/analysis/trend_detection/dynamic_weight_chart_generator.js +0 -1450
- package/dist/analysis/trend_detection/dynamic_weight_chart_generator.js.map +0 -1
- package/dist/analysis/trend_detection/kalman_chart_generator.d.ts +0 -6
- package/dist/analysis/trend_detection/kalman_chart_generator.d.ts.map +0 -1
- package/dist/analysis/trend_detection/kalman_chart_generator.js +0 -408
- package/dist/analysis/trend_detection/kalman_chart_generator.js.map +0 -1
- package/dist/analysis/trend_detection/regime_chart_generator.d.ts +0 -6
- package/dist/analysis/trend_detection/regime_chart_generator.d.ts.map +0 -1
- package/dist/analysis/trend_detection/regime_chart_generator.js +0 -345
- 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 -130
- 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 -38
- package/dist/analysis/trend_detection/tests/test_kalman_velocity_smoothing.js.map +0 -1
- package/dist/analysis/trend_detection/volatility_chart_generator.d.ts +0 -6
- package/dist/analysis/trend_detection/volatility_chart_generator.d.ts.map +0 -1
- package/dist/analysis/trend_detection/volatility_chart_generator.js +0 -732
- package/dist/analysis/trend_detection/volatility_chart_generator.js.map +0 -1
|
@@ -53,28 +53,66 @@
|
|
|
53
53
|
*
|
|
54
54
|
* ===============================================================================
|
|
55
55
|
*/
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
56
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
57
|
+
if (k2 === undefined) k2 = k;
|
|
58
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
59
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
60
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
61
|
+
}
|
|
62
|
+
Object.defineProperty(o, k2, desc);
|
|
63
|
+
}) : (function(o, m, k, k2) {
|
|
64
|
+
if (k2 === undefined) k2 = k;
|
|
65
|
+
o[k2] = m[k];
|
|
66
|
+
}));
|
|
67
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
68
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
69
|
+
}) : function(o, v) {
|
|
70
|
+
o["default"] = v;
|
|
71
|
+
});
|
|
72
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
73
|
+
var ownKeys = function(o) {
|
|
74
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
75
|
+
var ar = [];
|
|
76
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
77
|
+
return ar;
|
|
78
|
+
};
|
|
79
|
+
return ownKeys(o);
|
|
80
|
+
};
|
|
81
|
+
return function (mod) {
|
|
82
|
+
if (mod && mod.__esModule) return mod;
|
|
83
|
+
var result = {};
|
|
84
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
85
|
+
__setModuleDefault(result, mod);
|
|
86
|
+
return result;
|
|
87
|
+
};
|
|
88
|
+
})();
|
|
89
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
90
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
91
|
+
};
|
|
92
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
93
|
+
const client = __importStar(require("./bitshares_client"));
|
|
94
|
+
const { BitShares } = client;
|
|
95
|
+
const chainKeys = __importStar(require("./chain_keys"));
|
|
96
|
+
const chainOrders = __importStar(require("./chain_orders"));
|
|
97
|
+
const fundRegistry = __importStar(require("./fund_registry"));
|
|
98
|
+
const DexbotFillRuntime = __importStar(require("./dexbot_fill_runtime"));
|
|
99
|
+
const dexbot_maintenance_runtime_1 = __importDefault(require("./dexbot_maintenance_runtime"));
|
|
100
|
+
const DexbotStateRecovery = __importStar(require("./dexbot_state_recovery"));
|
|
101
|
+
const DexbotStartupRuntime = __importStar(require("./dexbot_startup_runtime"));
|
|
102
|
+
const credit_runtime_1 = __importDefault(require("./credit_runtime"));
|
|
103
|
+
const paths_1 = require("./paths");
|
|
104
|
+
const Format = __importStar(require("./order/format"));
|
|
105
|
+
const dexbot_cow_runtime_1 = __importDefault(require("./dexbot_cow_runtime"));
|
|
106
|
+
const processed_fill_store_1 = require("./order/processed_fill_store");
|
|
107
|
+
const constants_1 = require("./constants");
|
|
108
|
+
const bot_settings_1 = require("./bot_settings");
|
|
109
|
+
const errors_1 = require("./utils/errors");
|
|
70
110
|
function waitForConnected(...args) { return require('./bitshares_client').waitForConnected(...args); }
|
|
71
111
|
function getKeyStore(...args) { return require('./key_store').getKeyStore(...args); }
|
|
72
112
|
function hasExecutableActions(...args) { return require('./order/utils/validate').hasExecutableActions(...args); }
|
|
73
113
|
function getRecalculateTriggerFile(...args) { return require('./paths').getRecalculateTriggerFile(...args); }
|
|
74
114
|
function cloneWeightDistribution(...args) { return require('./order/utils/math').cloneWeightDistribution(...args); }
|
|
75
115
|
function resolveBotRuntimeSettings(...args) { return require('./runtime_settings').resolveBotRuntimeSettings(...args); }
|
|
76
|
-
const PROFILES_BOTS_FILE = PATHS.PROFILES.BOTS_JSON;
|
|
77
|
-
const PROFILES_DIR = PATHS.PROFILES_DIR;
|
|
78
116
|
class DEXBot {
|
|
79
117
|
config;
|
|
80
118
|
_baseWeightDistribution;
|
|
@@ -131,8 +169,7 @@ class DEXBot {
|
|
|
131
169
|
_reconnectUnregister;
|
|
132
170
|
_credentialRecoveryDeferredTimer;
|
|
133
171
|
_structuralGridResyncTimer;
|
|
134
|
-
_structuralGridResyncRunning;
|
|
135
|
-
_ghostOrderCancelAttempted;
|
|
172
|
+
_structuralGridResyncRunning = false;
|
|
136
173
|
_dustHealthCheckTimer;
|
|
137
174
|
_lastBroadcastHeartbeatAt;
|
|
138
175
|
_lastDeferredDustCount;
|
|
@@ -164,9 +201,9 @@ class DEXBot {
|
|
|
164
201
|
this.config.logging = rs.logging;
|
|
165
202
|
this._fillDedupeWindowMs = this.config.timing.FILL_DEDUPE_WINDOW_MS;
|
|
166
203
|
this._fillRecordRetentionMs = this.config.timing.FILL_RECORD_RETENTION_MS;
|
|
167
|
-
this._processedFillPersistBatchMs = TIMING.PROCESSED_FILL_PERSIST_BATCH_MS;
|
|
168
|
-
this._processedFillPersistBatchSize = TIMING.PROCESSED_FILL_PERSIST_BATCH_SIZE;
|
|
169
|
-
this._processedFillStore = new ProcessedFillStore({
|
|
204
|
+
this._processedFillPersistBatchMs = constants_1.TIMING.PROCESSED_FILL_PERSIST_BATCH_MS;
|
|
205
|
+
this._processedFillPersistBatchSize = constants_1.TIMING.PROCESSED_FILL_PERSIST_BATCH_SIZE;
|
|
206
|
+
this._processedFillStore = new processed_fill_store_1.ProcessedFillStore({
|
|
170
207
|
batchMs: this._processedFillPersistBatchMs,
|
|
171
208
|
batchSize: this._processedFillPersistBatchSize,
|
|
172
209
|
warn: (message) => this._warn(message)
|
|
@@ -220,10 +257,6 @@ class DEXBot {
|
|
|
220
257
|
this._currentCycleId = 0;
|
|
221
258
|
this._autoCancelOrphanCycleMarker = null;
|
|
222
259
|
this._autoCancelOrphanSubCount = 0;
|
|
223
|
-
// Per-session guard: ghost order IDs successfully cancelled
|
|
224
|
-
// (avoids spamming the chain with repeated cancel attempts for the same
|
|
225
|
-
// orphan residual on every fill cycle).
|
|
226
|
-
this._ghostOrderCancelAttempted = null;
|
|
227
260
|
// Dust cancellation uses immediate on-chain cancel — no maps or timers needed.
|
|
228
261
|
this._dustHealthCheckTimer = null;
|
|
229
262
|
// Fill consumer watchdog: consecutive failure tracking.
|
|
@@ -266,7 +299,7 @@ class DEXBot {
|
|
|
266
299
|
}
|
|
267
300
|
// Throw all validation errors at once
|
|
268
301
|
if (errors.length > 0) {
|
|
269
|
-
throw new Error(`Config validation failed:\n${errors.map(e => ` - ${e}`).join('\n')}`);
|
|
302
|
+
throw new Error(`Config validation failed:\n${errors.map((e) => ` - ${e}`).join('\n')}`);
|
|
270
303
|
}
|
|
271
304
|
}
|
|
272
305
|
/**
|
|
@@ -334,7 +367,7 @@ class DEXBot {
|
|
|
334
367
|
* @returns {{incomingFillQueueLength: number, shadowLocks: number, batchInFlight: boolean, recoveryInFlight: boolean, broadcasting: boolean}}
|
|
335
368
|
*/
|
|
336
369
|
_getPipelineSignals() {
|
|
337
|
-
return
|
|
370
|
+
return dexbot_maintenance_runtime_1.default.getPipelineSignals(this);
|
|
338
371
|
}
|
|
339
372
|
/**
|
|
340
373
|
* Mark that grid activity occurred (updates idle timer).
|
|
@@ -342,7 +375,7 @@ class DEXBot {
|
|
|
342
375
|
* @returns {void}
|
|
343
376
|
*/
|
|
344
377
|
_markGridActivity(reason = 'activity') {
|
|
345
|
-
return
|
|
378
|
+
return dexbot_maintenance_runtime_1.default.markGridActivity(this, reason);
|
|
346
379
|
}
|
|
347
380
|
/**
|
|
348
381
|
* Trigger a full state recovery sync (fetch chain + sync from open orders + persist).
|
|
@@ -525,7 +558,7 @@ class DEXBot {
|
|
|
525
558
|
* @param {boolean} [options.allowOrphanFallbackKey=false]
|
|
526
559
|
* @returns {Promise<import('./types').ReplaySafeFillResult>}
|
|
527
560
|
*/
|
|
528
|
-
async _applyReplaySafeFillAccounting(fill, fillOp, { missingKeyMessage, fallbackKeyMessage, replayMessage, errorMessage, logger = this.manager?.logger, missingKeyLevel = 'warn', fallbackKeyLevel = 'warn', replayLevel = 'debug', persistenceMode = PROCESSED_FILL_PERSISTENCE_MODES.IMMEDIATE, allowOrphanFallbackKey = false } = {}) {
|
|
561
|
+
async _applyReplaySafeFillAccounting(fill, fillOp, { missingKeyMessage, fallbackKeyMessage, replayMessage, errorMessage, logger = this.manager?.logger, missingKeyLevel = 'warn', fallbackKeyLevel = 'warn', replayLevel = 'debug', persistenceMode = processed_fill_store_1.PROCESSED_FILL_PERSISTENCE_MODES.IMMEDIATE, allowOrphanFallbackKey = false } = {}) {
|
|
529
562
|
return DexbotFillRuntime.applyReplaySafeFillAccounting(this, fill, fillOp, {
|
|
530
563
|
missingKeyMessage,
|
|
531
564
|
fallbackKeyMessage,
|
|
@@ -550,7 +583,7 @@ class DEXBot {
|
|
|
550
583
|
* @param {string} [options.persistenceMode='batched']
|
|
551
584
|
* @returns {Promise<import('./types').ReplaySafeFillResult>}
|
|
552
585
|
*/
|
|
553
|
-
async _applyReplaySafeTrackedFillAccounting(fill, fillOp, { context, logger = this.manager?.logger, replayMessage, persistenceMode = PROCESSED_FILL_PERSISTENCE_MODES.BATCHED } = {}) {
|
|
586
|
+
async _applyReplaySafeTrackedFillAccounting(fill, fillOp, { context, logger = this.manager?.logger, replayMessage, persistenceMode = processed_fill_store_1.PROCESSED_FILL_PERSISTENCE_MODES.BATCHED } = {}) {
|
|
554
587
|
return DexbotFillRuntime.applyReplaySafeTrackedFillAccounting(this, fill, fillOp, {
|
|
555
588
|
context,
|
|
556
589
|
logger,
|
|
@@ -569,7 +602,7 @@ class DEXBot {
|
|
|
569
602
|
* @param {string} [options.persistenceMode='batched']
|
|
570
603
|
* @returns {Promise<import('./types').ReplaySafeFillResult>}
|
|
571
604
|
*/
|
|
572
|
-
async _applyReplaySafeOrphanFillAccounting(fill, fillOp, { context, logger = this.manager?.logger, replayMessage, persistenceMode = PROCESSED_FILL_PERSISTENCE_MODES.BATCHED } = {}) {
|
|
605
|
+
async _applyReplaySafeOrphanFillAccounting(fill, fillOp, { context, logger = this.manager?.logger, replayMessage, persistenceMode = processed_fill_store_1.PROCESSED_FILL_PERSISTENCE_MODES.BATCHED } = {}) {
|
|
573
606
|
return DexbotFillRuntime.applyReplaySafeOrphanFillAccounting(this, fill, fillOp, {
|
|
574
607
|
context,
|
|
575
608
|
logger,
|
|
@@ -583,7 +616,7 @@ class DEXBot {
|
|
|
583
616
|
* @returns {import('./types').DynamicWeightRefreshResult|null}
|
|
584
617
|
*/
|
|
585
618
|
_refreshDynamicWeightDistribution(context = 'runtime') {
|
|
586
|
-
return
|
|
619
|
+
return dexbot_maintenance_runtime_1.default.refreshDynamicWeightDistribution(this, context);
|
|
587
620
|
}
|
|
588
621
|
/**
|
|
589
622
|
* Finalize the bot startup after account and initial grid sync are complete.
|
|
@@ -611,7 +644,7 @@ class DEXBot {
|
|
|
611
644
|
* @returns {Promise<{syncResult: Object|null, aborted: boolean, hasUnmatched: number, openOrders: Array|null}>}
|
|
612
645
|
*/
|
|
613
646
|
async _syncOpenOrdersAndProcessFills(tag) {
|
|
614
|
-
return
|
|
647
|
+
return dexbot_maintenance_runtime_1.default.syncOpenOrdersAndProcessFills(this, tag);
|
|
615
648
|
}
|
|
616
649
|
_maxConsecutiveFillConsumerFailures() {
|
|
617
650
|
return DexbotFillRuntime.maxConsecutiveFillConsumerFailures(this);
|
|
@@ -691,7 +724,7 @@ class DEXBot {
|
|
|
691
724
|
* @throws {Error} If initialization fails or preferredAccount is missing.
|
|
692
725
|
*/
|
|
693
726
|
async initialize(vaultSecret = null) {
|
|
694
|
-
await waitForConnected(TIMING.CONNECTION_TIMEOUT_MS);
|
|
727
|
+
await waitForConnected(constants_1.TIMING.CONNECTION_TIMEOUT_MS);
|
|
695
728
|
if (this.config && this.config.preferredAccount) {
|
|
696
729
|
try {
|
|
697
730
|
let privateKey = null;
|
|
@@ -701,7 +734,7 @@ class DEXBot {
|
|
|
701
734
|
catch (err) {
|
|
702
735
|
if (vaultSecret)
|
|
703
736
|
throw err;
|
|
704
|
-
this._warn(`Credential daemon probe failed: ${err
|
|
737
|
+
this._warn(`Credential daemon probe failed: ${(0, errors_1.getErrorMessage)(err)}. Falling back to interactive authentication.`);
|
|
705
738
|
}
|
|
706
739
|
if (!privateKey) {
|
|
707
740
|
const unlockSecret = await chainKeys.authenticate();
|
|
@@ -714,7 +747,7 @@ class DEXBot {
|
|
|
714
747
|
if (chainKeys.isMasterPasswordFailure(err)) {
|
|
715
748
|
throw err;
|
|
716
749
|
}
|
|
717
|
-
this._warn(`Auto-selection of preferredAccount failed: ${err
|
|
750
|
+
this._warn(`Auto-selection of preferredAccount failed: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
718
751
|
// dexbot.ts has fallback to selectAccount, bot.ts throws
|
|
719
752
|
if (typeof chainOrders.selectAccount === 'function') {
|
|
720
753
|
const accountData = await chainOrders.selectAccount();
|
|
@@ -743,7 +776,7 @@ class DEXBot {
|
|
|
743
776
|
* @returns {Array<Array<Object>>} Grouped order arrays
|
|
744
777
|
*/
|
|
745
778
|
_buildOutsideInPairGroupsForOrders(orders) {
|
|
746
|
-
return
|
|
779
|
+
return dexbot_cow_runtime_1.default.buildOutsideInPairGroupsForOrders(orders);
|
|
747
780
|
}
|
|
748
781
|
/**
|
|
749
782
|
* Build outside-in pair groups for create entry contexts.
|
|
@@ -751,14 +784,14 @@ class DEXBot {
|
|
|
751
784
|
* @returns {Array<Array<Object>>} Grouped entry arrays
|
|
752
785
|
*/
|
|
753
786
|
_buildOutsideInPairGroupsForCreateEntries(createEntries) {
|
|
754
|
-
return
|
|
787
|
+
return dexbot_cow_runtime_1.default.buildOutsideInPairGroupsForCreateEntries(createEntries);
|
|
755
788
|
}
|
|
756
789
|
/**
|
|
757
790
|
* Resolve the centralized fill batch cap.
|
|
758
791
|
* @returns {number} Positive maximum number of fill-driven rotations per broadcast cycle
|
|
759
792
|
*/
|
|
760
793
|
_getMaxFillBatchSize() {
|
|
761
|
-
return Math.max(1, this.config.fillProcessing?.MAX_FILL_BATCH_SIZE ?? FILL_PROCESSING.MAX_FILL_BATCH_SIZE);
|
|
794
|
+
return Math.max(1, this.config.fillProcessing?.MAX_FILL_BATCH_SIZE ?? constants_1.FILL_PROCESSING.MAX_FILL_BATCH_SIZE);
|
|
762
795
|
}
|
|
763
796
|
/**
|
|
764
797
|
* Extract operation results from a batch transaction result.
|
|
@@ -767,7 +800,7 @@ class DEXBot {
|
|
|
767
800
|
* @returns {Array} Array of operation result entries
|
|
768
801
|
*/
|
|
769
802
|
_extractOperationResults(result, warnContext = '') {
|
|
770
|
-
return
|
|
803
|
+
return dexbot_cow_runtime_1.default.extractOperationResults(result, warnContext, this.manager?.logger?.log?.bind(this.manager?.logger));
|
|
771
804
|
}
|
|
772
805
|
/**
|
|
773
806
|
* Find CREATE operation contexts whose broadcast result did not include a chain order id.
|
|
@@ -777,7 +810,7 @@ class DEXBot {
|
|
|
777
810
|
* @returns {Array<{index:number, ctx:Object}>} Missing create result contexts.
|
|
778
811
|
*/
|
|
779
812
|
_findMissingCreateResultContexts(operationResults, opContexts) {
|
|
780
|
-
return
|
|
813
|
+
return dexbot_cow_runtime_1.default.findMissingCreateResultContexts(operationResults, opContexts);
|
|
781
814
|
}
|
|
782
815
|
/**
|
|
783
816
|
* Run an immediate chain sync after a successful CREATE broadcast returned incomplete ids.
|
|
@@ -791,7 +824,7 @@ class DEXBot {
|
|
|
791
824
|
* @returns {Promise<void>}
|
|
792
825
|
*/
|
|
793
826
|
async _recoverAfterMissingCreateResults(reason = 'missing create operation results') {
|
|
794
|
-
return
|
|
827
|
+
return dexbot_cow_runtime_1.default.recoverAfterMissingCreateResults(this, reason);
|
|
795
828
|
}
|
|
796
829
|
/**
|
|
797
830
|
* Restore unresolved missing-create blockers after recovery if sync did not adopt them.
|
|
@@ -801,7 +834,7 @@ class DEXBot {
|
|
|
801
834
|
* @returns {void}
|
|
802
835
|
*/
|
|
803
836
|
_preserveMissingCreateBlockersAfterRecovery(blockers, recoveryResult) {
|
|
804
|
-
return
|
|
837
|
+
return dexbot_cow_runtime_1.default.preserveMissingCreateBlockersAfterRecovery(this, blockers, recoveryResult);
|
|
805
838
|
}
|
|
806
839
|
/**
|
|
807
840
|
* Merge missing CREATE result contexts into manager._lastUnmatchedChainOrders.
|
|
@@ -815,7 +848,7 @@ class DEXBot {
|
|
|
815
848
|
* @returns {void}
|
|
816
849
|
*/
|
|
817
850
|
_markMissingCreateResultsAsStructuralBlocker(missingCreateResults) {
|
|
818
|
-
return
|
|
851
|
+
return dexbot_cow_runtime_1.default.markMissingCreateResultsAsStructuralBlocker(this, missingCreateResults);
|
|
819
852
|
}
|
|
820
853
|
/**
|
|
821
854
|
* Format an unmatched chain order/blocker for COW logs.
|
|
@@ -824,7 +857,7 @@ class DEXBot {
|
|
|
824
857
|
* @returns {string} Compact human-readable diagnostic.
|
|
825
858
|
*/
|
|
826
859
|
_formatUnmatchedChainOrderForLog(order) {
|
|
827
|
-
return
|
|
860
|
+
return dexbot_cow_runtime_1.default.formatUnmatchedChainOrderForLog(order);
|
|
828
861
|
}
|
|
829
862
|
/**
|
|
830
863
|
* Record a pending CREATE broadcast on the manager.
|
|
@@ -847,7 +880,7 @@ class DEXBot {
|
|
|
847
880
|
* @returns {void}
|
|
848
881
|
*/
|
|
849
882
|
_recordPendingBroadcast(entry) {
|
|
850
|
-
return
|
|
883
|
+
return dexbot_cow_runtime_1.default.recordPendingBroadcast(this, entry);
|
|
851
884
|
}
|
|
852
885
|
/**
|
|
853
886
|
* Clear the pending-broadcast cache.
|
|
@@ -858,7 +891,7 @@ class DEXBot {
|
|
|
858
891
|
* _reconcileAfterUncertainBroadcast before calling this).
|
|
859
892
|
*/
|
|
860
893
|
_clearPendingBroadcasts() {
|
|
861
|
-
return
|
|
894
|
+
return dexbot_cow_runtime_1.default.clearPendingBroadcasts(this.manager?._pendingBroadcasts);
|
|
862
895
|
}
|
|
863
896
|
/**
|
|
864
897
|
* Build a fingerprint for an on-chain order so it can be matched against
|
|
@@ -869,7 +902,7 @@ class DEXBot {
|
|
|
869
902
|
* @returns {string|null} Fingerprint or null on bad input
|
|
870
903
|
*/
|
|
871
904
|
_buildChainOrderFingerprint(chainOrder, slotId) {
|
|
872
|
-
return
|
|
905
|
+
return dexbot_cow_runtime_1.default.buildChainOrderFingerprint(this, chainOrder, slotId);
|
|
873
906
|
}
|
|
874
907
|
/**
|
|
875
908
|
* Normalize raw BitShares limit_order_object data into the integer tuple
|
|
@@ -883,7 +916,7 @@ class DEXBot {
|
|
|
883
916
|
* @returns {{side: string, assetA: string, assetB: string, sellInt: number, receiveInt: number}|null}
|
|
884
917
|
*/
|
|
885
918
|
_normalizeChainOrderForPendingMatch(chainOrder) {
|
|
886
|
-
return
|
|
919
|
+
return dexbot_cow_runtime_1.default.normalizeChainOrderForPendingMatch(this, chainOrder);
|
|
887
920
|
}
|
|
888
921
|
/**
|
|
889
922
|
* Find a chain order that matches a planned slot using price+size proximity.
|
|
@@ -901,7 +934,7 @@ class DEXBot {
|
|
|
901
934
|
* @returns {Object|null} Matching chain order, or null
|
|
902
935
|
*/
|
|
903
936
|
_findChainOrderForSlot(chainOrders, slotId, planned) {
|
|
904
|
-
return
|
|
937
|
+
return dexbot_cow_runtime_1.default.findChainOrderForSlot(this, chainOrders, slotId, planned);
|
|
905
938
|
}
|
|
906
939
|
/**
|
|
907
940
|
* Reconcile a broadcast whose chain state is unknown.
|
|
@@ -930,10 +963,10 @@ class DEXBot {
|
|
|
930
963
|
* @returns {Promise<Object>} Result object compatible with batch return shape
|
|
931
964
|
*/
|
|
932
965
|
async _reconcileAfterUncertainBroadcast(err, opContexts, options = {}) {
|
|
933
|
-
return
|
|
966
|
+
return dexbot_cow_runtime_1.default.reconcileAfterUncertainBroadcast(this, err, opContexts, options);
|
|
934
967
|
}
|
|
935
968
|
async _reconcileAfterUncertainBroadcastImpl(err, opContexts, options) {
|
|
936
|
-
return
|
|
969
|
+
return dexbot_cow_runtime_1.default.reconcileAfterUncertainBroadcastImpl(this, err, opContexts, options);
|
|
937
970
|
}
|
|
938
971
|
/**
|
|
939
972
|
* Auto-cancel a price-drift orphan from the unmatched-order snapshot.
|
|
@@ -961,7 +994,7 @@ class DEXBot {
|
|
|
961
994
|
* @returns {Promise<{cancelled: boolean, orderId?: string, reason?: string}>}
|
|
962
995
|
*/
|
|
963
996
|
async _autoCancelOneUnmatchedOrphan() {
|
|
964
|
-
return
|
|
997
|
+
return dexbot_cow_runtime_1.default.autoCancelOneUnmatchedOrphan(this);
|
|
965
998
|
}
|
|
966
999
|
// Pair mode applies only when create contexts include both BUY and SELL.
|
|
967
1000
|
// Single-side create batches intentionally remain a single executeBatch.
|
|
@@ -971,7 +1004,7 @@ class DEXBot {
|
|
|
971
1004
|
* @returns {boolean} True if pair mode should be used
|
|
972
1005
|
*/
|
|
973
1006
|
_shouldExecuteCreatePairMode(opContexts) {
|
|
974
|
-
return
|
|
1007
|
+
return dexbot_cow_runtime_1.default.shouldExecuteCreatePairMode(this, opContexts);
|
|
975
1008
|
}
|
|
976
1009
|
/**
|
|
977
1010
|
* Execute operations with retry on BroadcastUncertainError.
|
|
@@ -983,7 +1016,7 @@ class DEXBot {
|
|
|
983
1016
|
* the full operations array would duplicate those creates on chain.
|
|
984
1017
|
*/
|
|
985
1018
|
async _executeWithRetryOnUncertain(operations, opContexts) {
|
|
986
|
-
return
|
|
1019
|
+
return dexbot_cow_runtime_1.default.executeWithRetryOnUncertain(this, operations, opContexts);
|
|
987
1020
|
}
|
|
988
1021
|
/**
|
|
989
1022
|
* Execute blockchain operations with appropriate strategy (single batch or pair mode).
|
|
@@ -992,7 +1025,7 @@ class DEXBot {
|
|
|
992
1025
|
* @returns {Promise<{result: Object, opContexts: Array}>} Execution result with contexts
|
|
993
1026
|
*/
|
|
994
1027
|
async _executeOperationsWithStrategy(operations, opContexts) {
|
|
995
|
-
return
|
|
1028
|
+
return dexbot_cow_runtime_1.default.executeOperationsWithStrategy(this, operations, opContexts);
|
|
996
1029
|
}
|
|
997
1030
|
/**
|
|
998
1031
|
* Validate that operations can be executed with available funds before broadcasting.
|
|
@@ -1004,7 +1037,7 @@ class DEXBot {
|
|
|
1004
1037
|
* @private
|
|
1005
1038
|
*/
|
|
1006
1039
|
_validateOperationFunds(operations, assetA, assetB) {
|
|
1007
|
-
return
|
|
1040
|
+
return dexbot_cow_runtime_1.default.validateOperationFunds(this, operations, assetA, assetB);
|
|
1008
1041
|
}
|
|
1009
1042
|
/**
|
|
1010
1043
|
* Resolve the ideal size from an order-like object with fallback.
|
|
@@ -1013,7 +1046,7 @@ class DEXBot {
|
|
|
1013
1046
|
* @returns {number|null} Resolved size or null
|
|
1014
1047
|
*/
|
|
1015
1048
|
_resolveIdealSizeForValidation(orderLike, fallbackSize = null) {
|
|
1016
|
-
return
|
|
1049
|
+
return dexbot_cow_runtime_1.default.resolveIdealSizeForValidation(this, orderLike, fallbackSize);
|
|
1017
1050
|
}
|
|
1018
1051
|
/**
|
|
1019
1052
|
* Validate that an order size is safe to execute (above minimum dust thresholds).
|
|
@@ -1024,7 +1057,7 @@ class DEXBot {
|
|
|
1024
1057
|
* @returns {import('./types').OrderValidationResult}
|
|
1025
1058
|
*/
|
|
1026
1059
|
_validateOrderSizeForExecution(size, type, orderLike = null, fallbackSize = null) {
|
|
1027
|
-
return
|
|
1060
|
+
return dexbot_cow_runtime_1.default.validateOrderSizeForExecution(this, size, type, orderLike, fallbackSize);
|
|
1028
1061
|
}
|
|
1029
1062
|
/**
|
|
1030
1063
|
* Execute a batch of order operations if the rebalance result has executable actions.
|
|
@@ -1096,12 +1129,12 @@ class DEXBot {
|
|
|
1096
1129
|
const batchEnd = Math.min(i + currentBatchSize, totalFills);
|
|
1097
1130
|
const fillBatch = fills.slice(i, batchEnd);
|
|
1098
1131
|
i = batchEnd;
|
|
1099
|
-
const batchIds = fillBatch.map(f => f.id).join(', ');
|
|
1132
|
+
const batchIds = fillBatch.map((f) => f.id).join(', ');
|
|
1100
1133
|
const label = `${contextLabel} [${batchIds}]`;
|
|
1101
1134
|
managerLog(`>>> Processing fill set ${label} (${i}/${totalFills})`, 'info');
|
|
1102
1135
|
let fullExcludeSet = excl || new Set();
|
|
1103
1136
|
if (!useUnifiedPlan) {
|
|
1104
|
-
const batchIdSet = new Set(fillBatch.map(f => f.id));
|
|
1137
|
+
const batchIdSet = new Set(fillBatch.map((f) => f.id));
|
|
1105
1138
|
fullExcludeSet = new Set(excl || []);
|
|
1106
1139
|
for (const other of fills) {
|
|
1107
1140
|
if (batchIdSet.has(other.id))
|
|
@@ -1175,17 +1208,17 @@ class DEXBot {
|
|
|
1175
1208
|
}
|
|
1176
1209
|
try {
|
|
1177
1210
|
if (this.privateKey && getKeyStore().isDaemonSigningKey(this.privateKey)) {
|
|
1178
|
-
await chainKeys.pingDaemon(this.privateKey.accountName, Math.min(TIMING.DAEMON_PING_TIMEOUT_MS, TIMING.DAEMON_STARTUP_TIMEOUT_MS), { socketPath: this.privateKey.socketPath });
|
|
1211
|
+
await chainKeys.pingDaemon(this.privateKey.accountName, Math.min(constants_1.TIMING.DAEMON_PING_TIMEOUT_MS, constants_1.TIMING.DAEMON_STARTUP_TIMEOUT_MS), { socketPath: this.privateKey.socketPath });
|
|
1179
1212
|
}
|
|
1180
1213
|
}
|
|
1181
1214
|
catch (err) {
|
|
1182
|
-
const message = `Credential daemon unavailable before ${contextLabel}: ${err
|
|
1215
|
+
const message = `Credential daemon unavailable before ${contextLabel}: ${(0, errors_1.getErrorMessage)(err)}`;
|
|
1183
1216
|
this._credentialDaemonDown = true;
|
|
1184
1217
|
this._credentialRecoveryNeeded = true;
|
|
1185
1218
|
this._suspendGridPersistenceForCredentialOutage(message);
|
|
1186
1219
|
this.manager?.logger?.log?.(`[CREDENTIAL] ${message}. Write operations paused; re-unlock with dexbot pm2.`, 'error');
|
|
1187
1220
|
const wrapped = new Error(message);
|
|
1188
|
-
wrapped.code = DAEMON_CODES.CREDENTIAL_DAEMON_UNAVAILABLE;
|
|
1221
|
+
wrapped.code = constants_1.DAEMON_CODES.CREDENTIAL_DAEMON_UNAVAILABLE;
|
|
1189
1222
|
wrapped.cause = err;
|
|
1190
1223
|
throw wrapped;
|
|
1191
1224
|
}
|
|
@@ -1198,9 +1231,9 @@ class DEXBot {
|
|
|
1198
1231
|
_isCredentialDaemonError(err) {
|
|
1199
1232
|
if (!err)
|
|
1200
1233
|
return false;
|
|
1201
|
-
if (err.code === DAEMON_CODES.CREDENTIAL_DAEMON_UNAVAILABLE)
|
|
1234
|
+
if (err.code === constants_1.DAEMON_CODES.CREDENTIAL_DAEMON_UNAVAILABLE)
|
|
1202
1235
|
return true;
|
|
1203
|
-
const message = String(err
|
|
1236
|
+
const message = String((0, errors_1.getErrorMessage)(err) || '');
|
|
1204
1237
|
return /Credential daemon|Daemon connection failed|daemon .*unavailable|dexbot-cred-daemon\.sock|ECONNREFUSED|ENOENT/.test(message);
|
|
1205
1238
|
}
|
|
1206
1239
|
/**
|
|
@@ -1216,8 +1249,8 @@ class DEXBot {
|
|
|
1216
1249
|
this.manager?.logger?.log?.('[CREDENTIAL] Deferring credential recovery until startup/broadcast activity is idle.', 'info');
|
|
1217
1250
|
this._credentialRecoveryDeferredTimer = setTimeout(() => {
|
|
1218
1251
|
this._credentialRecoveryDeferredTimer = null;
|
|
1219
|
-
this._runCredentialRecoveryAfterDaemonRestored().catch(err => {
|
|
1220
|
-
this.manager?.logger?.log?.(`[CREDENTIAL] Deferred recovery failed: ${err
|
|
1252
|
+
this._runCredentialRecoveryAfterDaemonRestored().catch((err) => {
|
|
1253
|
+
this.manager?.logger?.log?.(`[CREDENTIAL] Deferred recovery failed: ${(0, errors_1.getErrorMessage)(err)}`, 'error');
|
|
1221
1254
|
if (this.manager) {
|
|
1222
1255
|
this.manager._recoveryState = { ...this.manager._recoveryState, lastFailureAt: Date.now() };
|
|
1223
1256
|
}
|
|
@@ -1245,8 +1278,8 @@ class DEXBot {
|
|
|
1245
1278
|
}
|
|
1246
1279
|
catch (err) {
|
|
1247
1280
|
this._credentialRecoveryNeeded = true;
|
|
1248
|
-
this._suspendGridPersistenceForCredentialOutage(`credential recovery failed: ${err
|
|
1249
|
-
this.manager?.logger?.log?.(`[CREDENTIAL] Credential recovery sync failed: ${err
|
|
1281
|
+
this._suspendGridPersistenceForCredentialOutage(`credential recovery failed: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
1282
|
+
this.manager?.logger?.log?.(`[CREDENTIAL] Credential recovery sync failed: ${(0, errors_1.getErrorMessage)(err)}. Writes remain guarded by preflight.`, 'error');
|
|
1250
1283
|
}
|
|
1251
1284
|
finally {
|
|
1252
1285
|
this._credentialRecoveryInFlight = false;
|
|
@@ -1265,7 +1298,7 @@ class DEXBot {
|
|
|
1265
1298
|
this._credentialDaemonDown = false;
|
|
1266
1299
|
return;
|
|
1267
1300
|
}
|
|
1268
|
-
const intervalMs = Math.max(TIMING.DAEMON_PING_TIMEOUT_MS, TIMING.CREDENTIAL_DAEMON_WATCHDOG_MS);
|
|
1301
|
+
const intervalMs = Math.max(constants_1.TIMING.DAEMON_PING_TIMEOUT_MS, constants_1.TIMING.CREDENTIAL_DAEMON_WATCHDOG_MS);
|
|
1269
1302
|
const probe = async () => {
|
|
1270
1303
|
if (this._shuttingDown || !this._isCredentialDaemonWriteRequired())
|
|
1271
1304
|
return;
|
|
@@ -1289,7 +1322,7 @@ class DEXBot {
|
|
|
1289
1322
|
}
|
|
1290
1323
|
catch (err) {
|
|
1291
1324
|
if (!this._credentialDaemonDown) {
|
|
1292
|
-
const errMsg = String(err
|
|
1325
|
+
const errMsg = String((0, errors_1.getErrorMessage)(err) || '');
|
|
1293
1326
|
let hint = '';
|
|
1294
1327
|
if (errMsg.includes('ENOENT')) {
|
|
1295
1328
|
hint = `Socket file missing at ${token.socketPath}. The credential daemon process may have been killed (e.g. by stray Ctrl-C). Restart it with: dexbot pm2 restart dexbot-cred. If the problem persists, check the daemon log: profiles/logs/dexbot-cred.log`;
|
|
@@ -1303,10 +1336,10 @@ class DEXBot {
|
|
|
1303
1336
|
else {
|
|
1304
1337
|
hint = `Write operations will remain paused until re-unlocked with dexbot pm2.`;
|
|
1305
1338
|
}
|
|
1306
|
-
this.manager?.logger?.log?.(`[CREDENTIAL] Credential daemon watchdog failed: ${err
|
|
1339
|
+
this.manager?.logger?.log?.(`[CREDENTIAL] Credential daemon watchdog failed: ${(0, errors_1.getErrorMessage)(err)}. ${hint}`, 'error');
|
|
1307
1340
|
}
|
|
1308
1341
|
this._credentialDaemonDown = true;
|
|
1309
|
-
this._suspendGridPersistenceForCredentialOutage(`credential daemon watchdog failed: ${err
|
|
1342
|
+
this._suspendGridPersistenceForCredentialOutage(`credential daemon watchdog failed: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
1310
1343
|
}
|
|
1311
1344
|
}
|
|
1312
1345
|
finally {
|
|
@@ -1314,15 +1347,15 @@ class DEXBot {
|
|
|
1314
1347
|
}
|
|
1315
1348
|
};
|
|
1316
1349
|
this._credentialDaemonWatchdogInterval = setInterval(() => {
|
|
1317
|
-
probe().catch(err => {
|
|
1318
|
-
this.manager?.logger?.log?.(`[CREDENTIAL] Credential daemon watchdog error: ${err
|
|
1350
|
+
probe().catch((err) => {
|
|
1351
|
+
this.manager?.logger?.log?.(`[CREDENTIAL] Credential daemon watchdog error: ${(0, errors_1.getErrorMessage)(err)}`, 'warn');
|
|
1319
1352
|
});
|
|
1320
1353
|
}, intervalMs);
|
|
1321
1354
|
if (typeof this._credentialDaemonWatchdogInterval.unref === 'function') {
|
|
1322
1355
|
this._credentialDaemonWatchdogInterval.unref();
|
|
1323
1356
|
}
|
|
1324
1357
|
void probe();
|
|
1325
|
-
this._log(`Credential daemon watchdog started (${Math.round(intervalMs / TIMING.MILLISECONDS_PER_SECOND)}s interval)`);
|
|
1358
|
+
this._log(`Credential daemon watchdog started (${Math.round(intervalMs / constants_1.TIMING.MILLISECONDS_PER_SECOND)}s interval)`);
|
|
1326
1359
|
}
|
|
1327
1360
|
/**
|
|
1328
1361
|
* Stop the credential daemon watchdog interval.
|
|
@@ -1364,7 +1397,7 @@ class DEXBot {
|
|
|
1364
1397
|
* @returns {Array<{type: string, id: string, order?: Object, orderId?: string, newSize?: number, newPrice?: number, newGridId?: string}>}
|
|
1365
1398
|
*/
|
|
1366
1399
|
_buildActionsFromPlan(plan) {
|
|
1367
|
-
return
|
|
1400
|
+
return dexbot_cow_runtime_1.default.buildActionsFromPlan(this, plan);
|
|
1368
1401
|
}
|
|
1369
1402
|
/**
|
|
1370
1403
|
* Build a COW result object (workingGrid + actions) from a simple plan.
|
|
@@ -1372,7 +1405,7 @@ class DEXBot {
|
|
|
1372
1405
|
* @returns {{workingGrid: import('./types').WorkingGrid, workingIndexes: Object, workingBoundary: number, actions: Array}}
|
|
1373
1406
|
*/
|
|
1374
1407
|
_buildCowResultFromPlan(plan) {
|
|
1375
|
-
return
|
|
1408
|
+
return dexbot_cow_runtime_1.default.buildCowResultFromPlan(this, plan);
|
|
1376
1409
|
}
|
|
1377
1410
|
/**
|
|
1378
1411
|
* Restore skipped update slots in the working grid to master state.
|
|
@@ -1382,7 +1415,7 @@ class DEXBot {
|
|
|
1382
1415
|
* @returns {void}
|
|
1383
1416
|
*/
|
|
1384
1417
|
_restoreSkippedUpdateSlotsInWorkingGrid(workingGrid, skippedSlotIds, skippedCount = 0) {
|
|
1385
|
-
return
|
|
1418
|
+
return dexbot_cow_runtime_1.default.restoreSkippedUpdateSlotsInWorkingGrid(this, workingGrid, skippedSlotIds, skippedCount);
|
|
1386
1419
|
}
|
|
1387
1420
|
/**
|
|
1388
1421
|
* COW broadcast: Execute blockchain operations and commit working grid on success.
|
|
@@ -1392,10 +1425,10 @@ class DEXBot {
|
|
|
1392
1425
|
* @private
|
|
1393
1426
|
*/
|
|
1394
1427
|
async _updateOrdersOnChainBatchCOW(cowResult) {
|
|
1395
|
-
return
|
|
1428
|
+
return dexbot_cow_runtime_1.default.updateOrdersOnChainBatchCOW(this, cowResult);
|
|
1396
1429
|
}
|
|
1397
1430
|
async _processBatchResults(result, opContexts) {
|
|
1398
|
-
return
|
|
1431
|
+
return dexbot_cow_runtime_1.default.processBatchResults(this, result, opContexts);
|
|
1399
1432
|
}
|
|
1400
1433
|
/**
|
|
1401
1434
|
* Perform grid recalculation triggered by trigger file.
|
|
@@ -1406,7 +1439,7 @@ class DEXBot {
|
|
|
1406
1439
|
* @private
|
|
1407
1440
|
*/
|
|
1408
1441
|
async _performGridResync(options = {}) {
|
|
1409
|
-
return
|
|
1442
|
+
return dexbot_maintenance_runtime_1.default.performGridResync(this, options);
|
|
1410
1443
|
}
|
|
1411
1444
|
/**
|
|
1412
1445
|
* Handle any pending trigger file reset at startup.
|
|
@@ -1415,7 +1448,7 @@ class DEXBot {
|
|
|
1415
1448
|
* @private
|
|
1416
1449
|
*/
|
|
1417
1450
|
async _handlePendingTriggerReset() {
|
|
1418
|
-
return
|
|
1451
|
+
return dexbot_maintenance_runtime_1.default.handlePendingTriggerReset(this);
|
|
1419
1452
|
}
|
|
1420
1453
|
/**
|
|
1421
1454
|
* Setup trigger file detection for grid reset.
|
|
@@ -1423,7 +1456,7 @@ class DEXBot {
|
|
|
1423
1456
|
* @private
|
|
1424
1457
|
*/
|
|
1425
1458
|
async _setupTriggerFileDetection() {
|
|
1426
|
-
return
|
|
1459
|
+
return dexbot_maintenance_runtime_1.default.setupTriggerFileDetection(this);
|
|
1427
1460
|
}
|
|
1428
1461
|
/**
|
|
1429
1462
|
* Starts the bot's operation.
|
|
@@ -1442,14 +1475,14 @@ class DEXBot {
|
|
|
1442
1475
|
*/
|
|
1443
1476
|
async startWithPrivateKey(privateKey) {
|
|
1444
1477
|
// Initialize account data with provided private key
|
|
1445
|
-
await waitForConnected(TIMING.CONNECTION_TIMEOUT_MS);
|
|
1478
|
+
await waitForConnected(constants_1.TIMING.CONNECTION_TIMEOUT_MS);
|
|
1446
1479
|
if (this.config && this.config.preferredAccount) {
|
|
1447
1480
|
try {
|
|
1448
1481
|
this.privateKey = privateKey;
|
|
1449
1482
|
await this._setupAccountContext(this.config.preferredAccount);
|
|
1450
1483
|
}
|
|
1451
1484
|
catch (err) {
|
|
1452
|
-
this._warn(`Auto-selection of preferredAccount failed: ${err
|
|
1485
|
+
this._warn(`Auto-selection of preferredAccount failed: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
1453
1486
|
throw err;
|
|
1454
1487
|
}
|
|
1455
1488
|
}
|
|
@@ -1472,7 +1505,7 @@ class DEXBot {
|
|
|
1472
1505
|
await this._finishStartupSequence(startupState);
|
|
1473
1506
|
}
|
|
1474
1507
|
catch (err) {
|
|
1475
|
-
this._warn(`Error during grid initialization: ${err
|
|
1508
|
+
this._warn(`Error during grid initialization: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
1476
1509
|
await this.shutdown();
|
|
1477
1510
|
throw err;
|
|
1478
1511
|
}
|
|
@@ -1495,10 +1528,10 @@ class DEXBot {
|
|
|
1495
1528
|
* @private
|
|
1496
1529
|
*/
|
|
1497
1530
|
async _performPeriodicGridChecks() {
|
|
1498
|
-
return
|
|
1531
|
+
return dexbot_maintenance_runtime_1.default.performPeriodicGridChecks(this);
|
|
1499
1532
|
}
|
|
1500
1533
|
_isOpenOrdersSyncLoopEnabled() {
|
|
1501
|
-
return
|
|
1534
|
+
return dexbot_maintenance_runtime_1.default.isOpenOrdersSyncLoopEnabled(this);
|
|
1502
1535
|
}
|
|
1503
1536
|
/**
|
|
1504
1537
|
* Start the open-orders watchdog sync loop.
|
|
@@ -1506,14 +1539,14 @@ class DEXBot {
|
|
|
1506
1539
|
* @private
|
|
1507
1540
|
*/
|
|
1508
1541
|
_startOpenOrdersSyncLoop() {
|
|
1509
|
-
return
|
|
1542
|
+
return dexbot_maintenance_runtime_1.default.startOpenOrdersSyncLoop(this);
|
|
1510
1543
|
}
|
|
1511
1544
|
/**
|
|
1512
1545
|
* Stop the open-orders watchdog sync loop.
|
|
1513
1546
|
* @private
|
|
1514
1547
|
*/
|
|
1515
1548
|
async _stopOpenOrdersSyncLoop() {
|
|
1516
|
-
return
|
|
1549
|
+
return dexbot_maintenance_runtime_1.default.stopOpenOrdersSyncLoop(this);
|
|
1517
1550
|
}
|
|
1518
1551
|
/**
|
|
1519
1552
|
* Set up periodic blockchain account balance fetch interval.
|
|
@@ -1521,17 +1554,17 @@ class DEXBot {
|
|
|
1521
1554
|
* @private
|
|
1522
1555
|
*/
|
|
1523
1556
|
_setupBlockchainFetchInterval() {
|
|
1524
|
-
return
|
|
1557
|
+
return dexbot_maintenance_runtime_1.default.setupBlockchainFetchInterval(this);
|
|
1525
1558
|
}
|
|
1526
1559
|
/**
|
|
1527
1560
|
* Stop the periodic blockchain fetch interval.
|
|
1528
1561
|
* @private
|
|
1529
1562
|
*/
|
|
1530
1563
|
_stopBlockchainFetchInterval() {
|
|
1531
|
-
return
|
|
1564
|
+
return dexbot_maintenance_runtime_1.default.stopBlockchainFetchInterval(this);
|
|
1532
1565
|
}
|
|
1533
1566
|
async _releaseMarketAdapterRuntime(context = 'shutdown') {
|
|
1534
|
-
return
|
|
1567
|
+
return dexbot_maintenance_runtime_1.default.releaseMarketAdapterRuntime(this, this.config?.botKey || this.config?.name, context);
|
|
1535
1568
|
}
|
|
1536
1569
|
/**
|
|
1537
1570
|
* Get or create the credit runtime for debt policy management.
|
|
@@ -1547,8 +1580,8 @@ class DEXBot {
|
|
|
1547
1580
|
return null;
|
|
1548
1581
|
}
|
|
1549
1582
|
if (!this._creditRuntime) {
|
|
1550
|
-
this._creditRuntime = new
|
|
1551
|
-
stateDir: PATHS.CREDIT_RUNTIME_DIR,
|
|
1583
|
+
this._creditRuntime = new credit_runtime_1.default(this, {
|
|
1584
|
+
stateDir: paths_1.PATHS.CREDIT_RUNTIME_DIR,
|
|
1552
1585
|
});
|
|
1553
1586
|
}
|
|
1554
1587
|
return this._creditRuntime;
|
|
@@ -1577,7 +1610,7 @@ class DEXBot {
|
|
|
1577
1610
|
await runtime.refreshState();
|
|
1578
1611
|
}
|
|
1579
1612
|
catch (err) {
|
|
1580
|
-
this._warn(`Credit runtime refresh/sync failed: ${err
|
|
1613
|
+
this._warn(`Credit runtime refresh/sync failed: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
1581
1614
|
}
|
|
1582
1615
|
}
|
|
1583
1616
|
/**
|
|
@@ -1602,7 +1635,7 @@ class DEXBot {
|
|
|
1602
1635
|
if (!runtime) {
|
|
1603
1636
|
return;
|
|
1604
1637
|
}
|
|
1605
|
-
const intervalMin = Number(this.config?.TIMING?.CREDIT_DEAL_CHECK_INTERVAL_MIN ?? TIMING.CREDIT_DEAL_CHECK_INTERVAL_MIN);
|
|
1638
|
+
const intervalMin = Number(this.config?.TIMING?.CREDIT_DEAL_CHECK_INTERVAL_MIN ?? constants_1.TIMING.CREDIT_DEAL_CHECK_INTERVAL_MIN);
|
|
1606
1639
|
if (!Number.isFinite(intervalMin) || intervalMin <= 0) {
|
|
1607
1640
|
this._log('Credit deal watchdog disabled by configuration (TIMING.CREDIT_DEAL_CHECK_INTERVAL_MIN <= 0)');
|
|
1608
1641
|
return;
|
|
@@ -1611,13 +1644,13 @@ class DEXBot {
|
|
|
1611
1644
|
clearInterval(this._creditWatchdogInterval);
|
|
1612
1645
|
this._creditWatchdogInterval = null;
|
|
1613
1646
|
}
|
|
1614
|
-
const intervalMs = intervalMin * 60 * TIMING.MILLISECONDS_PER_SECOND;
|
|
1647
|
+
const intervalMs = intervalMin * 60 * constants_1.TIMING.MILLISECONDS_PER_SECOND;
|
|
1615
1648
|
this._creditWatchdogInterval = setInterval(async () => {
|
|
1616
1649
|
try {
|
|
1617
1650
|
await runtime.runCreditWatchdog();
|
|
1618
1651
|
}
|
|
1619
1652
|
catch (err) {
|
|
1620
|
-
this._warn(`Credit watchdog error: ${err
|
|
1653
|
+
this._warn(`Credit watchdog error: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
1621
1654
|
}
|
|
1622
1655
|
}, intervalMs);
|
|
1623
1656
|
if (typeof this._creditWatchdogInterval?.unref === 'function') {
|
|
@@ -1636,17 +1669,17 @@ class DEXBot {
|
|
|
1636
1669
|
}
|
|
1637
1670
|
}
|
|
1638
1671
|
async requestGridReset(reason = 'structural change', options = {}) {
|
|
1639
|
-
return
|
|
1672
|
+
return dexbot_maintenance_runtime_1.default.requestGridReset(this, reason, options);
|
|
1640
1673
|
}
|
|
1641
1674
|
_wireStructuralGridResyncRequest() {
|
|
1642
|
-
return
|
|
1675
|
+
return dexbot_maintenance_runtime_1.default.wireStructuralGridResyncRequest(this);
|
|
1643
1676
|
}
|
|
1644
1677
|
/**
|
|
1645
1678
|
* Get current metrics for monitoring and debugging.
|
|
1646
1679
|
* @returns {Object} Metrics snapshot
|
|
1647
1680
|
*/
|
|
1648
1681
|
getMetrics() {
|
|
1649
|
-
return
|
|
1682
|
+
return dexbot_maintenance_runtime_1.default.getMetrics(this);
|
|
1650
1683
|
}
|
|
1651
1684
|
/**
|
|
1652
1685
|
* Execute grid maintenance checks in strict order with pipeline consensus.
|
|
@@ -1680,7 +1713,7 @@ class DEXBot {
|
|
|
1680
1713
|
* @private
|
|
1681
1714
|
*/
|
|
1682
1715
|
async _executeMaintenanceLogic(context) {
|
|
1683
|
-
return
|
|
1716
|
+
return dexbot_maintenance_runtime_1.default.executeMaintenanceLogic(this, context);
|
|
1684
1717
|
}
|
|
1685
1718
|
/**
|
|
1686
1719
|
* Cancel dust partial orders immediately — no maps, no timers, no delay.
|
|
@@ -1691,7 +1724,7 @@ class DEXBot {
|
|
|
1691
1724
|
* @private
|
|
1692
1725
|
*/
|
|
1693
1726
|
async _cancelDustOrders({ buy: buyDust = [], sell: sellDust = [] } = {}) {
|
|
1694
|
-
return
|
|
1727
|
+
return dexbot_maintenance_runtime_1.default.cancelDustOrders(this, { buy: buyDust, sell: sellDust });
|
|
1695
1728
|
}
|
|
1696
1729
|
/**
|
|
1697
1730
|
* Run a single dust health check cycle: inspect grid for partials below the
|
|
@@ -1701,7 +1734,7 @@ class DEXBot {
|
|
|
1701
1734
|
* @private
|
|
1702
1735
|
*/
|
|
1703
1736
|
async _runDustHealthCheck() {
|
|
1704
|
-
return
|
|
1737
|
+
return dexbot_maintenance_runtime_1.default.runDustHealthCheck(this);
|
|
1705
1738
|
}
|
|
1706
1739
|
/**
|
|
1707
1740
|
* Set up the periodic dust health check interval.
|
|
@@ -1711,7 +1744,7 @@ class DEXBot {
|
|
|
1711
1744
|
* @private
|
|
1712
1745
|
*/
|
|
1713
1746
|
_setupDustHealthCheckInterval() {
|
|
1714
|
-
return
|
|
1747
|
+
return dexbot_maintenance_runtime_1.default.setupDustHealthCheckInterval(this);
|
|
1715
1748
|
}
|
|
1716
1749
|
/**
|
|
1717
1750
|
* Perform grid maintenance: fund thresholds, spread condition, grid health, divergence.
|
|
@@ -1738,7 +1771,7 @@ class DEXBot {
|
|
|
1738
1771
|
* @private
|
|
1739
1772
|
*/
|
|
1740
1773
|
async _runGridMaintenance(context = 'periodic', options = {}) {
|
|
1741
|
-
return
|
|
1774
|
+
return dexbot_maintenance_runtime_1.default.runGridMaintenance(this, context, options);
|
|
1742
1775
|
}
|
|
1743
1776
|
/**
|
|
1744
1777
|
* Gracefully shutdown the bot.
|
|
@@ -1795,7 +1828,7 @@ class DEXBot {
|
|
|
1795
1828
|
await this._creditRuntime.shutdown();
|
|
1796
1829
|
}
|
|
1797
1830
|
catch (err) {
|
|
1798
|
-
this._warn(`Failed to persist credit runtime state: ${err
|
|
1831
|
+
this._warn(`Failed to persist credit runtime state: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
1799
1832
|
}
|
|
1800
1833
|
}
|
|
1801
1834
|
if (this._triggerWatcher && typeof this._triggerWatcher.close === 'function') {
|
|
@@ -1803,7 +1836,7 @@ class DEXBot {
|
|
|
1803
1836
|
this._triggerWatcher.close();
|
|
1804
1837
|
}
|
|
1805
1838
|
catch (err) {
|
|
1806
|
-
this._warn(`Failed to close trigger watcher: ${err
|
|
1839
|
+
this._warn(`Failed to close trigger watcher: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
1807
1840
|
}
|
|
1808
1841
|
finally {
|
|
1809
1842
|
this._triggerWatcher = null;
|
|
@@ -1814,7 +1847,7 @@ class DEXBot {
|
|
|
1814
1847
|
await this._fillsUnsubscribe();
|
|
1815
1848
|
}
|
|
1816
1849
|
catch (err) {
|
|
1817
|
-
this._warn(`Failed to unsubscribe fill listener: ${err
|
|
1850
|
+
this._warn(`Failed to unsubscribe fill listener: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
1818
1851
|
}
|
|
1819
1852
|
finally {
|
|
1820
1853
|
this._fillsUnsubscribe = null;
|
|
@@ -1825,7 +1858,7 @@ class DEXBot {
|
|
|
1825
1858
|
this._reconnectUnregister();
|
|
1826
1859
|
}
|
|
1827
1860
|
catch (err) {
|
|
1828
|
-
this._warn(`Error unregistering reconnect callback: ${err
|
|
1861
|
+
this._warn(`Error unregistering reconnect callback: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
1829
1862
|
}
|
|
1830
1863
|
this._reconnectUnregister = null;
|
|
1831
1864
|
}
|
|
@@ -1833,13 +1866,13 @@ class DEXBot {
|
|
|
1833
1866
|
await this._stopOpenOrdersSyncLoop();
|
|
1834
1867
|
}
|
|
1835
1868
|
catch (err) {
|
|
1836
|
-
this._warn(`Error while stopping open-orders sync loop: ${err
|
|
1869
|
+
this._warn(`Error while stopping open-orders sync loop: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
1837
1870
|
}
|
|
1838
1871
|
try {
|
|
1839
1872
|
await this._releaseMarketAdapterRuntime('shutdown');
|
|
1840
1873
|
}
|
|
1841
1874
|
catch (err) {
|
|
1842
|
-
this._warn(`Error while releasing market adapter runtime: ${err
|
|
1875
|
+
this._warn(`Error while releasing market adapter runtime: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
1843
1876
|
}
|
|
1844
1877
|
// Wait for current fill processing to complete
|
|
1845
1878
|
try {
|
|
@@ -1877,7 +1910,7 @@ class DEXBot {
|
|
|
1877
1910
|
this._log('Final grid snapshot persisted');
|
|
1878
1911
|
}
|
|
1879
1912
|
catch (err) {
|
|
1880
|
-
this._warn(`Failed to persist final state: ${err
|
|
1913
|
+
this._warn(`Failed to persist final state: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
1881
1914
|
}
|
|
1882
1915
|
}
|
|
1883
1916
|
}).then(() => 'acquired'),
|
|
@@ -1916,12 +1949,12 @@ class DEXBot {
|
|
|
1916
1949
|
this._log('Final grid snapshot persisted (best-effort, lock not held)');
|
|
1917
1950
|
}
|
|
1918
1951
|
catch (err) {
|
|
1919
|
-
this._warn(`Failed to persist final state (best-effort): ${err
|
|
1952
|
+
this._warn(`Failed to persist final state (best-effort): ${(0, errors_1.getErrorMessage)(err)}`);
|
|
1920
1953
|
}
|
|
1921
1954
|
}
|
|
1922
1955
|
}
|
|
1923
1956
|
catch (err) {
|
|
1924
|
-
this._warn(`Best-effort flush during shutdown failed: ${err
|
|
1957
|
+
this._warn(`Best-effort flush during shutdown failed: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
1925
1958
|
}
|
|
1926
1959
|
}
|
|
1927
1960
|
// Always reset the fill-consumer watchdog on shutdown completion,
|
|
@@ -1931,14 +1964,14 @@ class DEXBot {
|
|
|
1931
1964
|
}
|
|
1932
1965
|
}
|
|
1933
1966
|
catch (err) {
|
|
1934
|
-
this._warn(`Error during shutdown lock acquisition: ${err
|
|
1967
|
+
this._warn(`Error during shutdown lock acquisition: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
1935
1968
|
}
|
|
1936
1969
|
// Release fund registry allocation
|
|
1937
1970
|
if (this.config?.preferredAccount) {
|
|
1938
1971
|
const botName = this.config.botKey;
|
|
1939
1972
|
if (botName) {
|
|
1940
1973
|
fundRegistry.releaseAllocation(this.config.preferredAccount, botName).catch((err) => {
|
|
1941
|
-
this._warn(`Failed to release fund allocation for ${botName}: ${err
|
|
1974
|
+
this._warn(`Failed to release fund allocation for ${botName}: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
1942
1975
|
});
|
|
1943
1976
|
}
|
|
1944
1977
|
}
|
|
@@ -1955,7 +1988,7 @@ class DEXBot {
|
|
|
1955
1988
|
await this.manager?.logger?.flush();
|
|
1956
1989
|
}
|
|
1957
1990
|
}
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1991
|
+
DEXBot.normalizeBotEntry = bot_settings_1.normalizeBotEntry;
|
|
1992
|
+
exports.default = DEXBot;
|
|
1993
|
+
module.exports = DEXBot;
|
|
1961
1994
|
//# sourceMappingURL=dexbot_class.js.map
|