dexbot 1.3.2 → 1.4.0
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 +74 -35
- 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 -492
- package/dist/modules/constants.d.ts.map +1 -1
- package/dist/modules/constants.js +79 -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 +124 -73
- package/dist/modules/dexbot_class.d.ts.map +1 -1
- package/dist/modules/dexbot_class.js +198 -3577
- package/dist/modules/dexbot_class.js.map +1 -1
- package/dist/modules/dexbot_cow_runtime.d.ts +322 -0
- package/dist/modules/dexbot_cow_runtime.d.ts.map +1 -0
- package/dist/modules/dexbot_cow_runtime.js +1836 -0
- package/dist/modules/dexbot_cow_runtime.js.map +1 -0
- 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 +47 -15
- package/dist/modules/dexbot_fill_runtime.d.ts.map +1 -1
- package/dist/modules/dexbot_fill_runtime.js +565 -22
- package/dist/modules/dexbot_fill_runtime.js.map +1 -1
- package/dist/modules/dexbot_maintenance_runtime.d.ts +79 -10
- package/dist/modules/dexbot_maintenance_runtime.d.ts.map +1 -1
- package/dist/modules/dexbot_maintenance_runtime.js +294 -55
- package/dist/modules/dexbot_maintenance_runtime.js.map +1 -1
- package/dist/modules/dexbot_startup_runtime.d.ts +26 -0
- package/dist/modules/dexbot_startup_runtime.d.ts.map +1 -0
- package/dist/modules/dexbot_startup_runtime.js +575 -0
- package/dist/modules/dexbot_startup_runtime.js.map +1 -0
- package/dist/modules/dexbot_state_recovery.d.ts +115 -0
- package/dist/modules/dexbot_state_recovery.d.ts.map +1 -0
- package/dist/modules/dexbot_state_recovery.js +431 -0
- package/dist/modules/dexbot_state_recovery.js.map +1 -0
- 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 -22
- 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 -15
- 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 -20
- 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 -34
- 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 -39
- 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 +246 -188
- 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 +24 -24
- 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 +145 -72
- 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 +74 -44
- package/dist/modules/order/utils/system.d.ts.map +1 -1
- package/dist/modules/order/utils/system.js +188 -149
- package/dist/modules/order/utils/system.js.map +1 -1
- package/dist/modules/order/utils/validate.d.ts +21 -43
- package/dist/modules/order/utils/validate.d.ts.map +1 -1
- package/dist/modules/order/utils/validate.js +140 -110
- 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 +51 -55
- package/dist/modules/paths.d.ts.map +1 -1
- package/dist/modules/paths.js +72 -52
- 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/scripts/verify-browser-bundle.js +25 -1
- package/dist/scripts/verify-browser-bundle.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 +7 -2
- 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
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/** Fill processing runtime - handles order fill events and replay-safe accounting */
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.wireProcessedFillTracking = wireProcessedFillTracking;
|
|
5
|
+
exports.flushProcessedFillPersistence = flushProcessedFillPersistence;
|
|
6
|
+
exports.flushProcessedFillPersistenceForKeys = flushProcessedFillPersistenceForKeys;
|
|
7
|
+
exports.discardPendingProcessedFillPersistence = discardPendingProcessedFillPersistence;
|
|
8
|
+
exports.buildOrphanFillFallbackKey = buildOrphanFillFallbackKey;
|
|
9
|
+
exports.applyReplaySafeFillAccounting = applyReplaySafeFillAccounting;
|
|
10
|
+
exports.applyReplaySafeTrackedFillAccounting = applyReplaySafeTrackedFillAccounting;
|
|
11
|
+
exports.applyReplaySafeOrphanFillAccounting = applyReplaySafeOrphanFillAccounting;
|
|
12
|
+
exports.createFillCallback = createFillCallback;
|
|
13
|
+
exports.maxConsecutiveFillConsumerFailures = maxConsecutiveFillConsumerFailures;
|
|
14
|
+
exports.computeFillConsumerBackoffMs = computeFillConsumerBackoffMs;
|
|
15
|
+
exports.scheduleFillConsumerRestart = scheduleFillConsumerRestart;
|
|
16
|
+
exports.consumeFillQueue = consumeFillQueue;
|
|
17
|
+
exports.processFillsWithBootstrapMode = processFillsWithBootstrapMode;
|
|
18
|
+
const processed_fill_store_1 = require("./order/processed_fill_store");
|
|
19
|
+
const constants_1 = require("./constants");
|
|
20
|
+
const errors_1 = require("./utils/errors");
|
|
21
|
+
function buildFillKey(...args) { return require('./order/utils/order').buildFillKey(...args); }
|
|
22
|
+
function correctAllPriceMismatches(...args) { return require('./order/utils/order').correctAllPriceMismatches(...args); }
|
|
23
|
+
function retryPersistenceIfNeeded(...args) { return require('./order/utils/system').retryPersistenceIfNeeded(...args); }
|
|
6
24
|
/**
|
|
7
25
|
* Wire processed fill tracking into the manager and processed fill store.
|
|
8
26
|
* Establishes the bidirectional link between the runtime's processed fill store
|
|
@@ -99,7 +117,7 @@ function buildOrphanFillFallbackKey(bot, fill) {
|
|
|
99
117
|
* @param {boolean} [options.allowOrphanFallbackKey=false] - Allow degraded orphan fallback key
|
|
100
118
|
* @returns {Promise<import('./types').ReplaySafeFillResult>}
|
|
101
119
|
*/
|
|
102
|
-
async function applyReplaySafeFillAccounting(bot, fill, fillOp, { missingKeyMessage, fallbackKeyMessage, replayMessage, errorMessage, logger = bot.manager?.logger, missingKeyLevel = 'warn', fallbackKeyLevel = 'warn', replayLevel = 'debug', persistenceMode = PROCESSED_FILL_PERSISTENCE_MODES.IMMEDIATE, allowOrphanFallbackKey = false } = {}) {
|
|
120
|
+
async function applyReplaySafeFillAccounting(bot, fill, fillOp, { missingKeyMessage, fallbackKeyMessage, replayMessage, errorMessage, logger = bot.manager?.logger, missingKeyLevel = 'warn', fallbackKeyLevel = 'warn', replayLevel = 'debug', persistenceMode = processed_fill_store_1.PROCESSED_FILL_PERSISTENCE_MODES.IMMEDIATE, allowOrphanFallbackKey = false } = {}) {
|
|
103
121
|
let fillKey = buildFillKey(fill);
|
|
104
122
|
let usedFallbackKey = false;
|
|
105
123
|
if (!fillKey && allowOrphanFallbackKey) {
|
|
@@ -146,12 +164,12 @@ async function applyReplaySafeFillAccounting(bot, fill, fillOp, { missingKeyMess
|
|
|
146
164
|
* @param {string} [options.persistenceMode='batched'] - Processed fill persistence mode
|
|
147
165
|
* @returns {Promise<import('./types').ReplaySafeFillResult>}
|
|
148
166
|
*/
|
|
149
|
-
async function applyReplaySafeTrackedFillAccounting(bot, fill, fillOp, { context, logger = bot.manager?.logger, replayMessage, persistenceMode = PROCESSED_FILL_PERSISTENCE_MODES.BATCHED } = {}) {
|
|
167
|
+
async function applyReplaySafeTrackedFillAccounting(bot, fill, fillOp, { context, logger = bot.manager?.logger, replayMessage, persistenceMode = processed_fill_store_1.PROCESSED_FILL_PERSISTENCE_MODES.BATCHED } = {}) {
|
|
150
168
|
return applyReplaySafeFillAccounting(bot, fill, fillOp, {
|
|
151
169
|
logger,
|
|
152
170
|
missingKeyMessage: (op) => `[${context}] Missing fill history id for ${op.order_id}; deferring to open-orders sync`,
|
|
153
171
|
replayMessage,
|
|
154
|
-
errorMessage: (op, _fill, err) => `[${context}] Failed to process accounting for ${op.order_id}: ${err
|
|
172
|
+
errorMessage: (op, _fill, err) => `[${context}] Failed to process accounting for ${op.order_id}: ${(0, errors_1.getErrorMessage)(err)}`,
|
|
155
173
|
persistenceMode
|
|
156
174
|
});
|
|
157
175
|
}
|
|
@@ -168,13 +186,13 @@ async function applyReplaySafeTrackedFillAccounting(bot, fill, fillOp, { context
|
|
|
168
186
|
* @param {string} [options.persistenceMode='batched'] - Processed fill persistence mode
|
|
169
187
|
* @returns {Promise<import('./types').ReplaySafeFillResult>}
|
|
170
188
|
*/
|
|
171
|
-
async function applyReplaySafeOrphanFillAccounting(bot, fill, fillOp, { context, logger = bot.manager?.logger, replayMessage, persistenceMode = PROCESSED_FILL_PERSISTENCE_MODES.BATCHED } = {}) {
|
|
189
|
+
async function applyReplaySafeOrphanFillAccounting(bot, fill, fillOp, { context, logger = bot.manager?.logger, replayMessage, persistenceMode = processed_fill_store_1.PROCESSED_FILL_PERSISTENCE_MODES.BATCHED } = {}) {
|
|
172
190
|
return applyReplaySafeFillAccounting(bot, fill, fillOp, {
|
|
173
191
|
logger,
|
|
174
192
|
missingKeyMessage: (op) => `[${context}] Missing fill history id and orphan fallback key for ${op.order_id}; deferring to open-orders sync`,
|
|
175
193
|
fallbackKeyMessage: (op) => `[${context}] Missing fill history id for orphan fill ${op.order_id}; using degraded orphan replay key for proceeds-only accounting`,
|
|
176
194
|
replayMessage,
|
|
177
|
-
errorMessage: (op, _fill, err) => `[${context}] Failed to process accounting for ${op.order_id}: ${err
|
|
195
|
+
errorMessage: (op, _fill, err) => `[${context}] Failed to process accounting for ${op.order_id}: ${(0, errors_1.getErrorMessage)(err)}`,
|
|
178
196
|
persistenceMode,
|
|
179
197
|
allowOrphanFallbackKey: true
|
|
180
198
|
});
|
|
@@ -192,7 +210,7 @@ function createFillCallback(bot, chainOrders) {
|
|
|
192
210
|
return;
|
|
193
211
|
}
|
|
194
212
|
if (bot.manager && !bot.config.dryRun && Array.isArray(fills) && fills.length > 0) {
|
|
195
|
-
const maxQueueDepth = NATIVE_CLIENT.SUBSCRIPTIONS.MAX_INCOMING_FILL_QUEUE;
|
|
213
|
+
const maxQueueDepth = constants_1.NATIVE_CLIENT.SUBSCRIPTIONS.MAX_INCOMING_FILL_QUEUE;
|
|
196
214
|
if (bot._incomingFillQueue.length + fills.length > maxQueueDepth) {
|
|
197
215
|
const message = `Incoming fill queue back-pressure: ${bot._incomingFillQueue.length} queued + ${fills.length} incoming exceeds limit ${maxQueueDepth}`;
|
|
198
216
|
bot._warn(message);
|
|
@@ -200,21 +218,546 @@ function createFillCallback(bot, chainOrders) {
|
|
|
200
218
|
}
|
|
201
219
|
bot._markGridActivity?.('fill queued');
|
|
202
220
|
bot._incomingFillQueue.push(...fills);
|
|
203
|
-
bot._consumeFillQueue(chainOrders).catch(err => {
|
|
204
|
-
bot._warn(`Fill queue consume failed: ${err
|
|
221
|
+
bot._consumeFillQueue(chainOrders).catch((err) => {
|
|
222
|
+
bot._warn(`Fill queue consume failed: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
205
223
|
});
|
|
206
224
|
}
|
|
207
225
|
};
|
|
208
226
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
227
|
+
/**
|
|
228
|
+
* Returns the maximum consecutive fill consumer failures allowed before backoff.
|
|
229
|
+
* @param {import('./dexbot_class').DEXBot} bot
|
|
230
|
+
* @returns {number}
|
|
231
|
+
*/
|
|
232
|
+
function maxConsecutiveFillConsumerFailures(bot) {
|
|
233
|
+
return bot.config.fillProcessing?.MAX_CONSECUTIVE_CONSUMER_FAILURES ?? constants_1.FILL_PROCESSING.MAX_CONSECUTIVE_CONSUMER_FAILURES;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Compute the backoff delay for fill-consumer retries after the failure
|
|
237
|
+
* budget (MAX_CONSECUTIVE_CONSUMER_FAILURES) is exhausted. Each retry
|
|
238
|
+
* doubles the previous delay, capped at CONSUMER_BACKOFF_MAX_MS. The
|
|
239
|
+
* consumer NEVER permanently stops re-scheduling — it just slows down.
|
|
240
|
+
* @param {import('./dexbot_class').DEXBot} bot
|
|
241
|
+
* @param {number} failures The current consecutive-failure count.
|
|
242
|
+
* @returns {number} Delay in milliseconds before the next retry.
|
|
243
|
+
*/
|
|
244
|
+
function computeFillConsumerBackoffMs(bot, failures) {
|
|
245
|
+
const fp = bot.config.fillProcessing || constants_1.FILL_PROCESSING;
|
|
246
|
+
const initial = fp.CONSUMER_BACKOFF_INITIAL_MS;
|
|
247
|
+
const max = fp.CONSUMER_BACKOFF_MAX_MS;
|
|
248
|
+
const stepAfterMax = Math.max(0, failures - maxConsecutiveFillConsumerFailures(bot));
|
|
249
|
+
return Math.min(max, initial * Math.pow(2, stepAfterMax));
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Schedule a fill consumer restart with exponential backoff when the
|
|
253
|
+
* failure budget is exhausted, or immediate retry via setImmediate when
|
|
254
|
+
* within the budget. The consumer NEVER permanently stops re-scheduling.
|
|
255
|
+
* @param {import('./dexbot_class').DEXBot} bot
|
|
256
|
+
* @param {Object} chainOrders - Chain orders module
|
|
257
|
+
*/
|
|
258
|
+
function scheduleFillConsumerRestart(bot, chainOrders) {
|
|
259
|
+
const failures = bot._consecutiveConsumeFailures;
|
|
260
|
+
if (failures >= maxConsecutiveFillConsumerFailures(bot)) {
|
|
261
|
+
const backoffMs = computeFillConsumerBackoffMs(bot, failures);
|
|
262
|
+
const elapsedSec = bot._consumeFailureFirstAt
|
|
263
|
+
? Math.round((Date.now() - bot._consumeFailureFirstAt) / constants_1.TIMING.MILLISECONDS_PER_SECOND)
|
|
264
|
+
: null;
|
|
265
|
+
const elapsed = elapsedSec !== null ? `${elapsedSec}s` : 'unknown';
|
|
266
|
+
const sustainedLevel = (failures >= 20 || (elapsedSec !== null && elapsedSec >= 900))
|
|
267
|
+
? 'critical'
|
|
268
|
+
: (failures >= 10 || (elapsedSec !== null && elapsedSec >= 300))
|
|
269
|
+
? 'error'
|
|
270
|
+
: 'warn';
|
|
271
|
+
bot._log(`[FILL-QUEUE] Fill consumer has failed ${failures} consecutive times over ${elapsed}; ` +
|
|
272
|
+
`backing off ${Math.round(backoffMs / constants_1.TIMING.MILLISECONDS_PER_SECOND)}s before retry. ` +
|
|
273
|
+
`Queue: ${bot._incomingFillQueue.length} fills.`, sustainedLevel);
|
|
274
|
+
setTimeout(() => {
|
|
275
|
+
if (bot._shuttingDown)
|
|
276
|
+
return;
|
|
277
|
+
bot._consumeFillQueue(chainOrders).catch((err) => {
|
|
278
|
+
if (!bot._consumeFailureFirstAt) {
|
|
279
|
+
bot._consumeFailureFirstAt = Date.now();
|
|
280
|
+
}
|
|
281
|
+
bot._consecutiveConsumeFailures++;
|
|
282
|
+
const newFailures = bot._consecutiveConsumeFailures;
|
|
283
|
+
const newElapsedSec = bot._consumeFailureFirstAt
|
|
284
|
+
? Math.round((Date.now() - bot._consumeFailureFirstAt) / constants_1.TIMING.MILLISECONDS_PER_SECOND)
|
|
285
|
+
: null;
|
|
286
|
+
const resumeLevel = (newFailures >= 20 || (newElapsedSec !== null && newElapsedSec >= 900))
|
|
287
|
+
? 'critical'
|
|
288
|
+
: (newFailures >= 10 || (newElapsedSec !== null && newElapsedSec >= 300))
|
|
289
|
+
? 'error'
|
|
290
|
+
: 'warn';
|
|
291
|
+
bot._log(`Fill consumer resume after backoff failed ` +
|
|
292
|
+
`(${newFailures} total, ` +
|
|
293
|
+
`next backoff ${Math.round(computeFillConsumerBackoffMs(bot, newFailures) / constants_1.TIMING.MILLISECONDS_PER_SECOND)}s): ` +
|
|
294
|
+
`${(0, errors_1.getErrorMessage)(err)}`, resumeLevel);
|
|
295
|
+
bot._scheduleFillConsumerRestart(chainOrders);
|
|
296
|
+
});
|
|
297
|
+
}, backoffMs);
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
setImmediate(() => bot._consumeFillQueue(chainOrders).catch((err) => {
|
|
301
|
+
if (!bot._consumeFailureFirstAt) {
|
|
302
|
+
bot._consumeFailureFirstAt = Date.now();
|
|
303
|
+
}
|
|
304
|
+
bot._consecutiveConsumeFailures++;
|
|
305
|
+
const remaining = maxConsecutiveFillConsumerFailures(bot) - bot._consecutiveConsumeFailures;
|
|
306
|
+
bot._log(`Fill consumer failed (${bot._consecutiveConsumeFailures}/${maxConsecutiveFillConsumerFailures(bot)}, ` +
|
|
307
|
+
`${remaining} attempts remaining): ${(0, errors_1.getErrorMessage)(err)}`, bot._consecutiveConsumeFailures >= 3 ? 'warn' : 'error');
|
|
308
|
+
}));
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Process fills during bootstrap phase using the standard fill pipeline.
|
|
312
|
+
* Delegates to the same fill pipeline as the post-reset path.
|
|
313
|
+
* @param {import('./dexbot_class').DEXBot} bot
|
|
314
|
+
* @param {Object} chainOrders - Chain orders module for blockchain operations
|
|
315
|
+
* @returns {Promise<void>}
|
|
316
|
+
*/
|
|
317
|
+
async function processFillsWithBootstrapMode(bot, chainOrders) {
|
|
318
|
+
if (bot._incomingFillQueue.length === 0)
|
|
319
|
+
return;
|
|
320
|
+
const startTime = Date.now();
|
|
321
|
+
const fills = bot._incomingFillQueue.splice(0);
|
|
322
|
+
const validFills = [];
|
|
323
|
+
const processedFillKeys = new Set();
|
|
324
|
+
let requiresOpenOrdersSync = false;
|
|
325
|
+
for (const fill of fills) {
|
|
326
|
+
if (!fill || fill.op?.[0] !== 4)
|
|
327
|
+
continue;
|
|
328
|
+
const fillOp = fill.op[1];
|
|
329
|
+
const gridOrder = bot.manager.orders.get(fillOp.order_id) ||
|
|
330
|
+
Array.from(bot.manager.orders.values()).find((o) => o.orderId === fillOp.order_id);
|
|
331
|
+
if (!gridOrder) {
|
|
332
|
+
let orphanFillKey = buildFillKey(fill);
|
|
333
|
+
if (!orphanFillKey) {
|
|
334
|
+
orphanFillKey = bot._buildOrphanFillFallbackKey(fill);
|
|
335
|
+
}
|
|
336
|
+
if (orphanFillKey && !bot._isNewFillKey(orphanFillKey, processedFillKeys, '[BOOTSTRAP]', fillOp.order_id)) {
|
|
337
|
+
continue;
|
|
338
|
+
}
|
|
339
|
+
bot.manager.logger.log(`[BOOTSTRAP] Processing funds for unknown order ${fillOp.order_id} (not in grid but crediting proceeds)`, 'warn');
|
|
340
|
+
const accountingResult = await bot._applyReplaySafeOrphanFillAccounting(fill, fillOp, {
|
|
341
|
+
context: 'BOOTSTRAP'
|
|
342
|
+
});
|
|
343
|
+
if (accountingResult.status === 'missing_key') {
|
|
344
|
+
requiresOpenOrdersSync = true;
|
|
345
|
+
}
|
|
346
|
+
continue;
|
|
347
|
+
}
|
|
348
|
+
const trackedFillKey = buildFillKey(fill);
|
|
349
|
+
if (trackedFillKey && !bot._isNewFillKey(trackedFillKey, processedFillKeys, '[BOOTSTRAP]', fillOp.order_id)) {
|
|
350
|
+
continue;
|
|
351
|
+
}
|
|
352
|
+
bot.manager.lockOrders([gridOrder.id]);
|
|
353
|
+
try {
|
|
354
|
+
const accountingResult = await bot._applyReplaySafeTrackedFillAccounting(fill, fillOp, {
|
|
355
|
+
context: 'BOOTSTRAP',
|
|
356
|
+
replayMessage: (op) => `[BOOTSTRAP] Replay detected for ${op.order_id}; skipping duplicate bootstrap rebalance`
|
|
357
|
+
});
|
|
358
|
+
if (accountingResult.status === 'missing_key') {
|
|
359
|
+
requiresOpenOrdersSync = true;
|
|
360
|
+
continue;
|
|
361
|
+
}
|
|
362
|
+
if (accountingResult.status !== 'applied') {
|
|
363
|
+
continue;
|
|
364
|
+
}
|
|
365
|
+
validFills.push({ ...fill, gridOrder });
|
|
366
|
+
const fillType = gridOrder.type === constants_1.ORDER_TYPES.BUY ? 'BUY' : 'SELL';
|
|
367
|
+
bot._log(`[BOOTSTRAP] Fill detected: ${fillType} order (${fillOp.is_maker !== false ? 'maker' : 'taker'})`);
|
|
368
|
+
}
|
|
369
|
+
finally {
|
|
370
|
+
bot.manager.unlockOrders([gridOrder.id]);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
if (requiresOpenOrdersSync) {
|
|
374
|
+
bot._log('[BOOTSTRAP] Falling back to open-orders sync for fill(s) missing replay-safe history identifiers', 'warn');
|
|
375
|
+
const bootstrapChainOpenOrders = await chainOrders.readOpenOrders(bot.accountId);
|
|
376
|
+
const syncResult = await bot.manager.syncFromOpenOrders(bootstrapChainOpenOrders);
|
|
377
|
+
if (syncResult.filledOrders?.length > 0) {
|
|
378
|
+
const queuedOrderIds = new Set(validFills.map((fill) => fill?.gridOrder?.orderId).filter(Boolean));
|
|
379
|
+
for (const filledOrder of syncResult.filledOrders) {
|
|
380
|
+
if (!filledOrder?.orderId || queuedOrderIds.has(filledOrder.orderId))
|
|
381
|
+
continue;
|
|
382
|
+
validFills.push({ gridOrder: filledOrder });
|
|
383
|
+
queuedOrderIds.add(filledOrder.orderId);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
await bot._flushProcessedFillPersistence('bootstrap-batch');
|
|
388
|
+
if (validFills.length === 0)
|
|
389
|
+
return;
|
|
390
|
+
try {
|
|
391
|
+
bot._log(`[BOOTSTRAP] Processing ${validFills.length} fill(s) through standard pipeline`, 'info');
|
|
392
|
+
const filledOrders = validFills.map((f) => f.gridOrder);
|
|
393
|
+
const result = await bot._processFillsWithBatching(filledOrders, new Set(), '[BOOTSTRAP] fill processing');
|
|
394
|
+
if (result.aborted) {
|
|
395
|
+
bot._warn('[BOOTSTRAP] Aborted batch due to illegal state; skipping grid persistence this cycle');
|
|
396
|
+
}
|
|
397
|
+
bot._metrics.fillsProcessed += validFills.length;
|
|
398
|
+
bot._metrics.fillProcessingTimeMs += Date.now() - startTime;
|
|
399
|
+
}
|
|
400
|
+
catch (err) {
|
|
401
|
+
bot._warn(`[BOOTSTRAP] Error processing fills: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
402
|
+
bot.manager.logger.log(`[BOOTSTRAP] Fill error: ${(0, errors_1.getErrorMessage)(err)}`, 'error');
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Consume queued fills from incomingFillQueue and rebalance.
|
|
407
|
+
* Deduplicates fills against already-processed set (replay-safe), syncs filled
|
|
408
|
+
* orders from history or open orders mode, handles price mismatches, processes
|
|
409
|
+
* fills sequentially with interruptible rebalancing, and periodically cleans old
|
|
410
|
+
* fill records.
|
|
411
|
+
* @param {import('./dexbot_class').DEXBot} bot
|
|
412
|
+
* @param {Object} chainOrders - Chain orders module for blockchain operations
|
|
413
|
+
*/
|
|
414
|
+
async function consumeFillQueue(bot, chainOrders) {
|
|
415
|
+
const resetFailureWatchdogIfSet = () => {
|
|
416
|
+
if (bot._consecutiveConsumeFailures > 0 || bot._consumeFailureFirstAt > 0) {
|
|
417
|
+
bot._consecutiveConsumeFailures = 0;
|
|
418
|
+
bot._consumeFailureFirstAt = 0;
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
if (bot._incomingFillQueue.length === 0) {
|
|
422
|
+
resetFailureWatchdogIfSet();
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
if (bot._shuttingDown) {
|
|
426
|
+
bot._warn('Fill processing skipped: shutdown in progress');
|
|
427
|
+
resetFailureWatchdogIfSet();
|
|
428
|
+
return;
|
|
429
|
+
}
|
|
430
|
+
if (bot._batchInFlight || bot._recoverySyncInFlight) {
|
|
431
|
+
bot.manager?.logger?.log?.(`Fill processing deferred: order pipeline active (${bot._incomingFillQueue.length} queued)`, 'debug');
|
|
432
|
+
resetFailureWatchdogIfSet();
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
let pendingFillKeysForCurrentCycle = new Set();
|
|
436
|
+
try {
|
|
437
|
+
if (bot.manager.isBootstrapping()) {
|
|
438
|
+
let bootstrapSkipped = false;
|
|
439
|
+
await bot.manager._fillProcessingLock.acquire(async () => {
|
|
440
|
+
if (!bot.manager.isBootstrapping()) {
|
|
441
|
+
bootstrapSkipped = true;
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
await bot._processFillsWithBootstrapMode(chainOrders);
|
|
445
|
+
});
|
|
446
|
+
if (bootstrapSkipped) {
|
|
447
|
+
resetFailureWatchdogIfSet();
|
|
448
|
+
}
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
if (bot.manager._fillProcessingLock.getQueueLength() > 0) {
|
|
452
|
+
bot._metrics.lockContentionEvents++;
|
|
453
|
+
resetFailureWatchdogIfSet();
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
await bot.manager._fillProcessingLock.acquire(async () => {
|
|
457
|
+
bot.manager._orphanFillsCreditedAt = null;
|
|
458
|
+
while (bot._incomingFillQueue.length > 0) {
|
|
459
|
+
const batchStartTime = Date.now();
|
|
460
|
+
bot._metrics.maxQueueDepth = Math.max(bot._metrics.maxQueueDepth, bot._incomingFillQueue.length);
|
|
461
|
+
const allFills = bot._incomingFillQueue.splice(0);
|
|
462
|
+
const validFills = [];
|
|
463
|
+
const processedFillKeys = new Set();
|
|
464
|
+
pendingFillKeysForCurrentCycle = new Set();
|
|
465
|
+
let requiresOpenOrdersSync = false;
|
|
466
|
+
for (const fill of allFills) {
|
|
467
|
+
if (fill && fill.op && fill.op[0] === constants_1.FILL_PROCESSING.OPERATION_TYPE) {
|
|
468
|
+
const fillOp = fill.op[1];
|
|
469
|
+
const hasFillEconomics = fillOp?.pays?.asset_id && fillOp?.pays?.amount != null
|
|
470
|
+
&& fillOp?.receives?.asset_id && fillOp?.receives?.amount != null;
|
|
471
|
+
if (chainOrders && typeof chainOrders.wasRecentlyOwnCancelled === 'function'
|
|
472
|
+
&& chainOrders.wasRecentlyOwnCancelled(fillOp.order_id)
|
|
473
|
+
&& !hasFillEconomics) {
|
|
474
|
+
bot.manager.logger.log(`[SELF-CANCEL] Skipping non-economic fill artifact for order ${fillOp.order_id} (just cancelled by this bot)`, 'debug');
|
|
475
|
+
continue;
|
|
476
|
+
}
|
|
477
|
+
const gridOrder = bot.manager.orders.get(fillOp.order_id) ||
|
|
478
|
+
Array.from(bot.manager.orders.values()).find((o) => o.orderId === fillOp.order_id);
|
|
479
|
+
if (!gridOrder) {
|
|
480
|
+
const staleMarkedAt = bot._staleCleanedOrderIds.get(fillOp.order_id);
|
|
481
|
+
if (staleMarkedAt != null) {
|
|
482
|
+
const staleAgeMs = Date.now() - staleMarkedAt;
|
|
483
|
+
if (staleAgeMs <= bot._staleCleanupRetentionMs) {
|
|
484
|
+
bot.manager.logger.log(`[ORPHAN-FILL] Skipping double-credit for stale-cleaned order ${fillOp.order_id} ` +
|
|
485
|
+
`(funds already freed by batch cleanup, age=${staleAgeMs}ms)`, 'warn');
|
|
486
|
+
continue;
|
|
487
|
+
}
|
|
488
|
+
bot._staleCleanedOrderIds.delete(fillOp.order_id);
|
|
489
|
+
}
|
|
490
|
+
let orphanFillKey = buildFillKey(fill);
|
|
491
|
+
if (!orphanFillKey) {
|
|
492
|
+
orphanFillKey = bot._buildOrphanFillFallbackKey(fill);
|
|
493
|
+
}
|
|
494
|
+
if (orphanFillKey && !bot._isNewFillKey(orphanFillKey, processedFillKeys, '[ORPHAN-FILL]', fillOp.order_id)) {
|
|
495
|
+
continue;
|
|
496
|
+
}
|
|
497
|
+
bot.manager.logger.log(`[ORPHAN-FILL] Processing funds for unknown order ${fillOp.order_id} (not in grid but crediting proceeds)`, 'warn');
|
|
498
|
+
const accountingResult = await bot._applyReplaySafeOrphanFillAccounting(fill, fillOp, {
|
|
499
|
+
context: 'ORPHAN-FILL',
|
|
500
|
+
replayMessage: (op) => `[ORPHAN-FILL] Replay detected for ${op.order_id}; skipping duplicate credit`
|
|
501
|
+
});
|
|
502
|
+
if (accountingResult.status === 'missing_key') {
|
|
503
|
+
requiresOpenOrdersSync = true;
|
|
504
|
+
}
|
|
505
|
+
bot.manager._orphanFillsCreditedAt = Date.now();
|
|
506
|
+
continue;
|
|
507
|
+
}
|
|
508
|
+
const roleStr = fillOp.is_maker !== false ? 'maker' : 'taker';
|
|
509
|
+
bot.manager.logger.log(`Processing ${roleStr} fill for order ${fillOp.order_id}`, 'debug');
|
|
510
|
+
const fillKey = buildFillKey(fill);
|
|
511
|
+
if (!fillKey) {
|
|
512
|
+
bot.manager.logger.log(`[FILL] Missing history id for order ${fillOp.order_id} block ${fill.block_num}; deferring to open-orders sync`, 'warn');
|
|
513
|
+
requiresOpenOrdersSync = true;
|
|
514
|
+
continue;
|
|
515
|
+
}
|
|
516
|
+
if (!bot._isNewFillKey(fillKey, processedFillKeys, '[FILL]', fillOp.order_id)) {
|
|
517
|
+
continue;
|
|
518
|
+
}
|
|
519
|
+
validFills.push(fill);
|
|
520
|
+
const paysAmount = fillOp.pays ? fillOp.pays.amount : '?';
|
|
521
|
+
const receivesAmount = fillOp.receives ? fillOp.receives.amount : '?';
|
|
522
|
+
bot._log(`\n===== FILL DETECTED =====`);
|
|
523
|
+
bot._log(`Order ID: ${fillOp.order_id}`);
|
|
524
|
+
bot._log(`Pays: ${paysAmount}, Receives: ${receivesAmount}`);
|
|
525
|
+
bot._log(`Block: ${fill.block_num} (History ID: ${fill.id || 'N/A'})`);
|
|
526
|
+
bot._log(`=========================\n`);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
const cleanupTimestamp = Date.now();
|
|
530
|
+
let cleanedCount = 0;
|
|
531
|
+
for (const [key, timestamp] of bot._recentlyQueuedFills) {
|
|
532
|
+
if (cleanupTimestamp - timestamp > bot._fillDedupeWindowMs) {
|
|
533
|
+
bot._recentlyQueuedFills.delete(key);
|
|
534
|
+
cleanedCount++;
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
if (cleanedCount > 0) {
|
|
538
|
+
bot.manager.logger.log(`Cleaned ${cleanedCount} old queued fill records. Remaining: ${bot._recentlyQueuedFills.size}`, 'debug');
|
|
539
|
+
}
|
|
540
|
+
if (validFills.length === 0 && !requiresOpenOrdersSync)
|
|
541
|
+
continue;
|
|
542
|
+
let allFilledOrders = [];
|
|
543
|
+
let ordersNeedingCorrection = [];
|
|
544
|
+
const fillMode = chainOrders.getFillProcessingMode();
|
|
545
|
+
const processValidFills = async (fillsToSync) => {
|
|
546
|
+
let resolvedOrders = [];
|
|
547
|
+
if (fillMode === 'history') {
|
|
548
|
+
bot.manager.logger.log(`Syncing ${fillsToSync.length} fill(s) (history mode)`, 'info');
|
|
549
|
+
if (fillsToSync.length >= 2) {
|
|
550
|
+
const batchResult = await bot.manager.syncFromFillHistoryBatch(fillsToSync, {
|
|
551
|
+
persistenceMode: processed_fill_store_1.PROCESSED_FILL_PERSISTENCE_MODES.BATCHED
|
|
552
|
+
});
|
|
553
|
+
for (const fill of fillsToSync) {
|
|
554
|
+
const fillKey = buildFillKey({
|
|
555
|
+
orderId: fill?.op?.[1]?.order_id,
|
|
556
|
+
blockNum: fill?.block_num,
|
|
557
|
+
historyId: fill?.id
|
|
558
|
+
});
|
|
559
|
+
if (fillKey)
|
|
560
|
+
pendingFillKeysForCurrentCycle.add(fillKey);
|
|
561
|
+
}
|
|
562
|
+
if (batchResult.filledOrders)
|
|
563
|
+
resolvedOrders.push(...batchResult.filledOrders);
|
|
564
|
+
if (batchResult.requiresOpenOrdersSync)
|
|
565
|
+
requiresOpenOrdersSync = true;
|
|
566
|
+
}
|
|
567
|
+
else {
|
|
568
|
+
for (const fill of fillsToSync) {
|
|
569
|
+
const resultHistory = await bot.manager.syncFromFillHistory(fill, {
|
|
570
|
+
persistenceMode: processed_fill_store_1.PROCESSED_FILL_PERSISTENCE_MODES.BATCHED
|
|
571
|
+
});
|
|
572
|
+
const fillKey = buildFillKey({
|
|
573
|
+
orderId: fill?.op?.[1]?.order_id,
|
|
574
|
+
blockNum: fill?.block_num,
|
|
575
|
+
historyId: fill?.id
|
|
576
|
+
});
|
|
577
|
+
if (fillKey)
|
|
578
|
+
pendingFillKeysForCurrentCycle.add(fillKey);
|
|
579
|
+
if (resultHistory.filledOrders)
|
|
580
|
+
resolvedOrders.push(...resultHistory.filledOrders);
|
|
581
|
+
if (resultHistory.requiresOpenOrdersSync)
|
|
582
|
+
requiresOpenOrdersSync = true;
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
if (fillMode !== 'history' || requiresOpenOrdersSync) {
|
|
587
|
+
if (fillMode === 'history' && requiresOpenOrdersSync) {
|
|
588
|
+
bot.manager.logger.log('Falling back to open-orders sync for fill(s) missing replay-safe history identifiers', 'warn');
|
|
589
|
+
}
|
|
590
|
+
bot.manager.logger.log(`Syncing ${fillsToSync.length} fill(s) (open orders mode)`, 'info');
|
|
591
|
+
const chainOpenOrders = await chainOrders.readOpenOrders(bot.account);
|
|
592
|
+
const resultOpenOrders = await bot.manager.syncFromOpenOrders(chainOpenOrders);
|
|
593
|
+
if (resultOpenOrders.filledOrders)
|
|
594
|
+
resolvedOrders.push(...resultOpenOrders.filledOrders);
|
|
595
|
+
if (resultOpenOrders.ordersNeedingCorrection)
|
|
596
|
+
ordersNeedingCorrection.push(...resultOpenOrders.ordersNeedingCorrection);
|
|
597
|
+
}
|
|
598
|
+
return resolvedOrders;
|
|
599
|
+
};
|
|
600
|
+
bot.manager.pauseFundRecalc();
|
|
601
|
+
try {
|
|
602
|
+
const fillsByBlock = new Map();
|
|
603
|
+
const fillsWithoutBlock = [];
|
|
604
|
+
for (const fill of validFills) {
|
|
605
|
+
if (fill.block_num != null) {
|
|
606
|
+
const list = fillsByBlock.get(fill.block_num);
|
|
607
|
+
if (list)
|
|
608
|
+
list.push(fill);
|
|
609
|
+
else
|
|
610
|
+
fillsByBlock.set(fill.block_num, [fill]);
|
|
611
|
+
}
|
|
612
|
+
else {
|
|
613
|
+
fillsWithoutBlock.push(fill);
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
const sortedBlocks = [...fillsByBlock.keys()].sort((a, b) => a - b);
|
|
617
|
+
const accumulatedOrders = [];
|
|
618
|
+
let anyRequiresSync = false;
|
|
619
|
+
const initialRequiresSync = requiresOpenOrdersSync;
|
|
620
|
+
for (const blockNum of sortedBlocks) {
|
|
621
|
+
requiresOpenOrdersSync = false;
|
|
622
|
+
bot.manager.logger.log(`[FILL-BLOCK] Processing ${fillsByBlock.get(blockNum).length} fill(s) from block ${blockNum}`, 'debug');
|
|
623
|
+
const blockResult = await processValidFills(fillsByBlock.get(blockNum));
|
|
624
|
+
accumulatedOrders.push(...blockResult);
|
|
625
|
+
if (requiresOpenOrdersSync)
|
|
626
|
+
anyRequiresSync = true;
|
|
627
|
+
}
|
|
628
|
+
requiresOpenOrdersSync = anyRequiresSync || initialRequiresSync;
|
|
629
|
+
if (fillsWithoutBlock.length > 0) {
|
|
630
|
+
bot.manager.logger.log(`[FILL-BLOCK] Processing ${fillsWithoutBlock.length} fill(s) without block info`, 'debug');
|
|
631
|
+
const noBlockResult = await processValidFills(fillsWithoutBlock);
|
|
632
|
+
accumulatedOrders.push(...noBlockResult);
|
|
633
|
+
if (requiresOpenOrdersSync)
|
|
634
|
+
anyRequiresSync = true;
|
|
635
|
+
}
|
|
636
|
+
if (requiresOpenOrdersSync && !anyRequiresSync) {
|
|
637
|
+
bot.manager.logger.log('[FILL-BLOCK] Running open-orders sync for fills with missing history identifiers', 'warn');
|
|
638
|
+
const fallbackOrders = await processValidFills([]);
|
|
639
|
+
accumulatedOrders.push(...fallbackOrders);
|
|
640
|
+
}
|
|
641
|
+
allFilledOrders = accumulatedOrders;
|
|
642
|
+
if (ordersNeedingCorrection.length > 0) {
|
|
643
|
+
const correctionResult = await correctAllPriceMismatches(bot.manager, bot.account, bot.privateKey, chainOrders);
|
|
644
|
+
if (correctionResult.failed > 0)
|
|
645
|
+
bot.manager.logger.log(`${correctionResult.failed} corrections failed`, 'error');
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
finally {
|
|
649
|
+
await bot.manager.resumeFundRecalc();
|
|
650
|
+
}
|
|
651
|
+
bot._refreshDynamicWeightDistribution('fill queue');
|
|
652
|
+
if (allFilledOrders.length > 0) {
|
|
653
|
+
const result = await bot._processFillsWithBatching(allFilledOrders, null, 'fill set');
|
|
654
|
+
let abortedFillCycle = result.aborted;
|
|
655
|
+
if (!abortedFillCycle) {
|
|
656
|
+
const batchFillKeys = new Set(allFilledOrders.map((filledOrder) => buildFillKey({
|
|
657
|
+
orderId: filledOrder?.orderId,
|
|
658
|
+
blockNum: filledOrder?.blockNum,
|
|
659
|
+
historyId: filledOrder?.historyId
|
|
660
|
+
})).filter(Boolean));
|
|
661
|
+
await bot._flushProcessedFillPersistenceForKeys(batchFillKeys, 'fill-batch-committed');
|
|
662
|
+
}
|
|
663
|
+
else {
|
|
664
|
+
bot.manager.logger.log('[FILL-DEDUP] Fill cycle aborted; fill key persistence guarded under abort path.', 'warn');
|
|
665
|
+
}
|
|
666
|
+
const fullFillCount = allFilledOrders.filter((o) => o && o.isPartial !== true).length;
|
|
667
|
+
const hasAnyFills = allFilledOrders.some((o) => o);
|
|
668
|
+
const shouldRunPostFillChecks = !abortedFillCycle && fullFillCount > 0;
|
|
669
|
+
const shouldRunDustDetection = !abortedFillCycle && hasAnyFills;
|
|
670
|
+
if (shouldRunDustDetection) {
|
|
671
|
+
const healthResult = await bot.manager.checkGridHealth(bot.updateOrdersOnChainPlan.bind(bot));
|
|
672
|
+
const allDust = [
|
|
673
|
+
...(healthResult.buyDustOrders || []),
|
|
674
|
+
...(healthResult.sellDustOrders || []),
|
|
675
|
+
];
|
|
676
|
+
if (allDust.length > 0) {
|
|
677
|
+
const dustCancelResult = await bot._cancelDustOrders({
|
|
678
|
+
buy: healthResult.buyDustOrders,
|
|
679
|
+
sell: healthResult.sellDustOrders,
|
|
680
|
+
});
|
|
681
|
+
if (dustCancelResult?.batchResult?.aborted) {
|
|
682
|
+
abortedFillCycle = true;
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
if (shouldRunPostFillChecks && !abortedFillCycle) {
|
|
687
|
+
await bot._runGridMaintenance('post-fill');
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
else if (pendingFillKeysForCurrentCycle.size > 0) {
|
|
691
|
+
await bot._flushProcessedFillPersistenceForKeys(pendingFillKeysForCurrentCycle, 'fill-batch-no-rotations');
|
|
692
|
+
}
|
|
693
|
+
bot.manager._recentFillKeysSnapshot = bot._getRecentFillKeysSnapshot();
|
|
694
|
+
await retryPersistenceIfNeeded(bot.manager);
|
|
695
|
+
bot._fillCleanupCounter += validFills.length;
|
|
696
|
+
const cleanupThreshold = constants_1.MAINTENANCE.CLEANUP_PROBABILITY > 0 && constants_1.MAINTENANCE.CLEANUP_PROBABILITY < 1
|
|
697
|
+
? Math.floor(1 / constants_1.MAINTENANCE.CLEANUP_PROBABILITY)
|
|
698
|
+
: 100;
|
|
699
|
+
if (bot._fillCleanupCounter >= cleanupThreshold) {
|
|
700
|
+
try {
|
|
701
|
+
await bot.accountOrders.cleanOldProcessedFills(constants_1.TIMING.FILL_RECORD_RETENTION_MS);
|
|
702
|
+
bot._fillCleanupCounter = 0;
|
|
703
|
+
}
|
|
704
|
+
catch (err) {
|
|
705
|
+
bot.manager?.logger?.log(`Warning: Fill cleanup failed (will retry): ${(0, errors_1.getErrorMessage)(err)}`, 'warn');
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
bot._metrics.fillsProcessed += validFills.length;
|
|
709
|
+
bot._metrics.fillProcessingTimeMs += Date.now() - batchStartTime;
|
|
710
|
+
if (bot._staleCleanedOrderIds.size > 0) {
|
|
711
|
+
const now = Date.now();
|
|
712
|
+
let prunedCount = 0;
|
|
713
|
+
for (const [orderId, markedAt] of bot._staleCleanedOrderIds) {
|
|
714
|
+
if (now - markedAt > bot._staleCleanupRetentionMs) {
|
|
715
|
+
bot._staleCleanedOrderIds.delete(orderId);
|
|
716
|
+
prunedCount++;
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
if (prunedCount > 0) {
|
|
720
|
+
bot.manager.logger.log(`[STALE-CLEANUP] Pruned ${prunedCount} expired stale-cleaned order IDs ` +
|
|
721
|
+
`(retention=${bot._staleCleanupRetentionMs}ms, remaining=${bot._staleCleanedOrderIds.size})`, 'debug');
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
bot._markGridActivity('fill processing end');
|
|
726
|
+
bot._consecutiveConsumeFailures = 0;
|
|
727
|
+
bot._consumeFailureFirstAt = 0;
|
|
728
|
+
});
|
|
729
|
+
}
|
|
730
|
+
catch (err) {
|
|
731
|
+
const isCredentialOutage = bot._isCredentialDaemonError(err);
|
|
732
|
+
if (pendingFillKeysForCurrentCycle.size > 0) {
|
|
733
|
+
const flushReason = isCredentialOutage
|
|
734
|
+
? 'credential-outage-verified-fills'
|
|
735
|
+
: 'fill-cycle-error-verified-fills';
|
|
736
|
+
if (isCredentialOutage) {
|
|
737
|
+
bot._credentialRecoveryNeeded = true;
|
|
738
|
+
bot._suspendGridPersistenceForCredentialOutage(`credential outage during fill processing: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
739
|
+
}
|
|
740
|
+
try {
|
|
741
|
+
await bot._flushProcessedFillPersistenceForKeys(pendingFillKeysForCurrentCycle, flushReason, { throwOnError: true });
|
|
742
|
+
const credentialSuffix = isCredentialOutage
|
|
743
|
+
? '; grid persistence is suspended until recovery'
|
|
744
|
+
: '';
|
|
745
|
+
bot.manager?.logger?.log?.(`[FILL-DEDUP] Persisted ${pendingFillKeysForCurrentCycle.size} verified processed-fill write(s) after fill cycle error${credentialSuffix}.`, isCredentialOutage ? 'warn' : 'info');
|
|
746
|
+
}
|
|
747
|
+
catch (flushErr) {
|
|
748
|
+
bot.manager?.logger?.log?.(`[FILL-DEDUP] Failed to persist verified fill keys during fill error handling: ${(0, errors_1.getErrorMessage)(flushErr)}`, 'warn');
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
if (isCredentialOutage && pendingFillKeysForCurrentCycle.size === 0) {
|
|
752
|
+
bot._credentialRecoveryNeeded = true;
|
|
753
|
+
bot._suspendGridPersistenceForCredentialOutage(`credential outage during fill processing: ${(0, errors_1.getErrorMessage)(err)}`);
|
|
754
|
+
}
|
|
755
|
+
bot._log(`Error processing fills: ${(0, errors_1.getErrorMessage)(err)}`, 'error');
|
|
756
|
+
if (err.stack)
|
|
757
|
+
bot._log(err.stack, 'error');
|
|
758
|
+
}
|
|
759
|
+
if (!bot._shuttingDown && bot._incomingFillQueue.length > 0) {
|
|
760
|
+
scheduleFillConsumerRestart(bot, chainOrders);
|
|
761
|
+
}
|
|
762
|
+
}
|
|
220
763
|
//# sourceMappingURL=dexbot_fill_runtime.js.map
|