dexbot 1.6.11 → 1.6.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -4
- package/README.md +2 -1
- package/analysis/README.md +2 -0
- package/analysis/tradingview/README.md +1 -1
- package/analysis/trend_detection/DYNAMIC_WEIGHT_RESEARCH.md +3 -3
- package/claw/docs/DEXBOT2_TUNING_CHEAT_SHEET.md +4 -3
- package/claw/modules/chain_broadcast.ts +7 -1
- package/claw/modules/claw_launcher.ts +1 -1
- package/claw/modules/launcher_mode_detector.ts +9 -2
- package/claw/package.json +1 -1
- package/claw/runtimes/openclaw-plugin/openclaw.plugin.json +1 -1
- package/claw/runtimes/openclaw-plugin/package.json +1 -1
- package/dist/analysis/account_resolver.d.ts +1 -1
- package/dist/analysis/account_resolver.js +2 -1
- package/dist/analysis/ama_fitting/analyze_ama_price_changes.js +3 -4
- package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.js +2 -7
- package/dist/analysis/ama_fitting/calibrate_convergence_er.js +0 -1
- package/dist/analysis/ama_fitting/fetch_lp_candles.js +4 -4
- package/dist/analysis/ama_fitting/generate_unified_comparison_chart.d.ts +20 -4
- package/dist/analysis/ama_fitting/generate_unified_comparison_chart.js +9 -6
- package/dist/analysis/ama_fitting/optimizer_high_resolution.js +16 -12
- package/dist/analysis/analyze_args.d.ts +31 -0
- package/dist/analysis/analyze_args.js +41 -0
- package/dist/analysis/analyze_dynamic_weight.js +7 -17
- package/dist/analysis/analyze_kalman.js +7 -17
- package/dist/analysis/analyze_regime.js +7 -17
- package/dist/analysis/analyze_regime_windows.js +8 -18
- package/dist/analysis/analyze_risk_profile.js +8 -18
- package/dist/analysis/analyze_trade_heatmap.js +7 -17
- package/dist/analysis/analyze_volatility.js +7 -17
- package/dist/analysis/bot_fitting/backtest_ama_sweep.d.ts +220 -12
- package/dist/analysis/bot_fitting/backtest_ama_sweep.js +6 -5
- package/dist/analysis/bot_fitting/backtest_bot_fitting.d.ts +34 -4
- package/dist/analysis/bot_fitting/backtest_bot_fitting.js +11 -63
- package/dist/analysis/bot_fitting/shared_utils.d.ts +7 -7
- package/dist/analysis/bot_fitting/shared_utils.js +2 -2
- package/dist/analysis/bot_key_utils.d.ts +18 -10
- package/dist/analysis/bot_key_utils.js +7 -4
- package/dist/analysis/bot_usage/discover_bot_accounts.js +44 -47
- package/dist/analysis/bot_usage/kibana_bot_queries.d.ts +1 -21
- package/dist/analysis/chain_pool.d.ts +3 -1
- package/dist/analysis/chart_ui.d.ts +5 -2
- package/dist/analysis/chart_ui.js +6 -3
- package/dist/analysis/chart_utils.d.ts +5 -5
- package/dist/analysis/chart_utils.js +9 -0
- package/dist/analysis/fills_cache.d.ts +1 -1
- package/dist/analysis/fills_source.d.ts +2 -2
- package/dist/analysis/fills_source.js +14 -12
- package/dist/analysis/grid_correction_check.d.ts +1 -1
- package/dist/analysis/grid_correction_check.js +12 -11
- package/dist/analysis/math_utils.d.ts +7 -6
- package/dist/analysis/math_utils.js +5 -8
- package/dist/analysis/pnl_report.js +29 -29
- package/dist/analysis/price_sources.d.ts +8 -8
- package/dist/analysis/price_sources.js +5 -4
- package/dist/analysis/resolve_bot_accounts.js +2 -2
- package/dist/analysis/resolve_source.d.ts +1 -1
- package/dist/analysis/trade_profitability.d.ts +23 -2
- package/dist/analysis/trade_profitability.js +50 -50
- package/dist/analysis/tradingview/analyze_tradingview.d.ts +17 -6
- package/dist/analysis/tradingview/analyze_tradingview.js +6 -5
- package/dist/analysis/tradingview/grid_reset_config.d.ts +41 -32
- package/dist/analysis/tradingview/grid_reset_config.js +23 -11
- package/dist/analysis/tradingview/grid_reset_sim.d.ts +75 -9
- package/dist/analysis/tradingview/grid_reset_sim.js +4 -3
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.d.ts +69 -4
- package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js +18 -19
- package/dist/analysis/trend_detection/backtest_ama_slope_huber.d.ts +1 -1
- package/dist/analysis/trend_detection/backtest_ama_slope_huber.js +5 -5
- package/dist/analysis/trend_detection/dynamic_weight_chart_generator.d.ts +63 -1
- package/dist/analysis/trend_detection/dynamic_weight_chart_generator.js +5 -4
- package/dist/analysis/trend_detection/huber_scale_variants.d.ts +9 -3
- package/dist/analysis/trend_detection/huber_scale_variants.js +4 -4
- package/dist/analysis/trend_detection/kalman_chart_generator.d.ts +30 -1
- package/dist/analysis/trend_detection/kalman_chart_generator.js +3 -3
- package/dist/analysis/trend_detection/regime_chart_generator.d.ts +31 -1
- package/dist/analysis/trend_detection/regime_chart_generator.js +2 -2
- package/dist/analysis/trend_detection/volatility_chart_generator.d.ts +33 -1
- package/dist/credential-daemon.js +34 -20
- package/dist/dexbot.js +11 -11
- package/dist/market_adapter/candle_utils.d.ts +22 -18
- package/dist/market_adapter/candle_utils.js +24 -20
- package/dist/market_adapter/core/asymmetric_bounds.d.ts +13 -4
- package/dist/market_adapter/core/config_normalizers.d.ts +3 -3
- package/dist/market_adapter/core/kibana_candles.d.ts +53 -18
- package/dist/market_adapter/core/kibana_candles.js +9 -7
- package/dist/market_adapter/core/kibana_client.d.ts +9 -1
- package/dist/market_adapter/core/kibana_client.js +8 -7
- package/dist/market_adapter/core/kibana_market_candles.d.ts +3 -2
- package/dist/market_adapter/core/market_adapter_service.d.ts +284 -117
- package/dist/market_adapter/core/market_adapter_service.js +137 -113
- package/dist/market_adapter/core/strategies/ama.d.ts +10 -2
- package/dist/market_adapter/core/strategies/ama.js +2 -4
- package/dist/market_adapter/core/strategies/ama_slope_model.d.ts +14 -1
- package/dist/market_adapter/core/strategies/ama_slope_model.js +12 -34
- package/dist/market_adapter/core/strategies/atr/calculator.d.ts +7 -2
- package/dist/market_adapter/core/strategies/atr/calculator.js +2 -34
- package/dist/market_adapter/core/strategies/collateral_manager.d.ts +7 -1
- package/dist/market_adapter/core/strategies/collateral_manager.js +0 -22
- package/dist/market_adapter/core/strategies/dynamic_weight_series.d.ts +34 -6
- package/dist/market_adapter/core/strategies/dynamic_weight_series.js +7 -7
- package/dist/market_adapter/core/strategies/regime_gate.d.ts +24 -15
- package/dist/market_adapter/core/strategies/regime_gate.js +4 -31
- package/dist/market_adapter/core/strategies/regime_interp.d.ts +7 -1
- package/dist/market_adapter/core/strategies/regime_interp.js +14 -22
- package/dist/market_adapter/core/strategies/volatility_shift.d.ts +11 -1
- package/dist/market_adapter/core/strategies/volatility_shift.js +0 -13
- package/dist/market_adapter/inputs/cex_candle_parsing.d.ts +29 -0
- package/dist/market_adapter/inputs/cex_candle_parsing.js +52 -0
- package/dist/market_adapter/inputs/fetch_book_data.d.ts +20 -4
- package/dist/market_adapter/inputs/fetch_book_data.js +3 -1
- package/dist/market_adapter/inputs/fetch_cex_synthetic_data.js +96 -224
- package/dist/market_adapter/inputs/fetch_lp_data.d.ts +42 -7
- package/dist/market_adapter/inputs/fetch_lp_data.js +22 -15
- package/dist/market_adapter/inputs/kibana_feed_source.d.ts +74 -15
- package/dist/market_adapter/inputs/kibana_feed_source.js +29 -22
- package/dist/market_adapter/inputs/kibana_source.d.ts +25 -3
- package/dist/market_adapter/inputs/kibana_source.js +2 -2
- package/dist/market_adapter/inputs/window_cache.d.ts +99 -94
- package/dist/market_adapter/inputs/window_cache.js +8 -8
- package/dist/market_adapter/interval_utils.d.ts +4 -4
- package/dist/market_adapter/log_format.d.ts +6 -6
- package/dist/market_adapter/log_format.js +28 -21
- package/dist/market_adapter/lp_chart_core.d.ts +22 -1
- package/dist/market_adapter/lp_chart_core.js +26 -192
- package/dist/market_adapter/lp_chart_runner.d.ts +7 -7
- package/dist/market_adapter/lp_chart_strategy_loader.d.ts +41 -6
- package/dist/market_adapter/lp_chart_strategy_loader.js +8 -7
- package/dist/market_adapter/market_adapter.d.ts +94 -32
- package/dist/market_adapter/market_adapter.js +67 -48
- package/dist/market_adapter/utils/adapter_client.d.ts +3 -3
- package/dist/market_adapter/utils/adapter_client.js +2 -2
- package/dist/market_adapter/utils/atomic_write.d.ts +8 -1
- package/dist/market_adapter/utils/chain.d.ts +50 -41
- package/dist/market_adapter/utils/chain.js +40 -46
- package/dist/market_adapter/utils/data_discovery.d.ts +4 -1
- package/dist/market_adapter/utils/dynamic_grid_snapshot.d.ts +12 -3
- package/dist/market_adapter/utils/file_json_cache.d.ts +2 -2
- package/dist/market_adapter/utils/file_lock.d.ts +28 -14
- package/dist/market_adapter/utils/file_lock.js +36 -32
- package/dist/market_adapter/utils/native_history.d.ts +9 -2
- package/dist/market_adapter/utils/native_history.js +35 -28
- package/dist/modules/account_bots.d.ts +577 -21
- package/dist/modules/account_bots.js +182 -158
- package/dist/modules/account_orders.d.ts +66 -30
- package/dist/modules/account_orders.js +22 -20
- package/dist/modules/authority_resolver.d.ts +12 -2
- package/dist/modules/authority_resolver.js +15 -8
- package/dist/modules/bitshares-native/chain_client.d.ts +38 -3
- package/dist/modules/bitshares-native/chain_client.js +45 -46
- package/dist/modules/bitshares-native/crypto/ecc.browser.js +11 -171
- package/dist/modules/bitshares-native/crypto/ecc.js +13 -176
- package/dist/modules/bitshares-native/crypto/ecc_core.d.ts +33 -0
- package/dist/modules/bitshares-native/crypto/ecc_core.js +213 -0
- package/dist/modules/bitshares-native/crypto/ecc_selector.d.ts +2 -1
- package/dist/modules/bitshares-native/crypto/ecc_selector.js +1 -13
- package/dist/modules/bitshares-native/index.d.ts +1 -1
- package/dist/modules/bitshares-native/lru_cache.d.ts +7 -7
- package/dist/modules/bitshares-native/resolvers.d.ts +18 -6
- package/dist/modules/bitshares-native/serial/lazy_buffer.d.ts +4 -0
- package/dist/modules/bitshares-native/serial/lazy_buffer.js +21 -0
- package/dist/modules/bitshares-native/serial/operations.d.ts +1 -1
- package/dist/modules/bitshares-native/serial/serializer.d.ts +16 -12
- package/dist/modules/bitshares-native/serial/serializer.js +7 -13
- package/dist/modules/bitshares-native/serial/types.d.ts +25 -16
- package/dist/modules/bitshares-native/serial/types.js +55 -62
- package/dist/modules/bitshares-native/signing_client.d.ts +32 -2
- package/dist/modules/bitshares-native/signing_client.js +19 -14
- package/dist/modules/bitshares-native/subscriptions.d.ts +81 -1
- package/dist/modules/bitshares-native/subscriptions.js +12 -12
- package/dist/modules/bitshares-native/transport.d.ts +5 -4
- package/dist/modules/bitshares-native/transport.js +5 -4
- package/dist/modules/bitshares-native/tx/builder.d.ts +40 -5
- package/dist/modules/bitshares-native/tx/builder.js +4 -3
- package/dist/modules/bitshares-native/tx/tx_cache.d.ts +4 -4
- package/dist/modules/bitshares_client.d.ts +45 -13
- package/dist/modules/bitshares_client.js +28 -19
- package/dist/modules/bot_defaults.d.ts +6 -15
- package/dist/modules/bot_defaults.js +1 -5
- package/dist/modules/bot_settings.d.ts +44 -10
- package/dist/modules/bot_settings.js +11 -8
- package/dist/modules/bots_file_lock.d.ts +6 -6
- package/dist/modules/bots_file_lock.js +16 -12
- package/dist/modules/broadcast_failure.d.ts +2 -2
- package/dist/modules/broadcast_failure.js +5 -4
- package/dist/modules/chain_keys.d.ts +42 -40
- package/dist/modules/chain_keys.js +53 -45
- package/dist/modules/chain_orders.d.ts +93 -59
- package/dist/modules/chain_orders.js +31 -23
- package/dist/modules/constants.d.ts +527 -31
- package/dist/modules/constants.js +15 -47
- package/dist/modules/cr_planner.d.ts +40 -2
- package/dist/modules/credential_policy.d.ts +68 -8
- package/dist/modules/credential_policy.js +37 -31
- package/dist/modules/credential_session_cache.d.ts +2 -2
- package/dist/modules/credit_pricing.d.ts +42 -6
- package/dist/modules/credit_pricing.js +44 -30
- package/dist/modules/credit_runtime.d.ts +276 -118
- package/dist/modules/credit_runtime.js +462 -165
- package/dist/modules/crypto/browser_provider.js +6 -4
- package/dist/modules/crypto/node_provider.js +1 -1
- package/dist/modules/crypto/pure_scrypt.js +35 -4
- package/dist/modules/crypto/pure_secp256k1.js +72 -26
- package/dist/modules/crypto/sync.d.ts +9 -9
- package/dist/modules/crypto/sync.js +16 -9
- package/dist/modules/dexbot_class.d.ts +195 -139
- package/dist/modules/dexbot_class.js +78 -28
- package/dist/modules/dexbot_cow_runtime.d.ts +167 -87
- package/dist/modules/dexbot_cow_runtime.js +248 -206
- package/dist/modules/dexbot_credential_client.d.ts +19 -11
- package/dist/modules/dexbot_fill_runtime.d.ts +63 -48
- package/dist/modules/dexbot_fill_runtime.js +48 -41
- package/dist/modules/dexbot_maintenance_runtime.d.ts +109 -70
- package/dist/modules/dexbot_maintenance_runtime.js +108 -83
- package/dist/modules/dexbot_startup_runtime.d.ts +11 -10
- package/dist/modules/dexbot_startup_runtime.js +43 -43
- package/dist/modules/dexbot_state_recovery.d.ts +13 -12
- package/dist/modules/dexbot_state_recovery.js +18 -13
- package/dist/modules/fund_registry.d.ts +4 -2
- package/dist/modules/fund_registry.js +10 -10
- package/dist/modules/general_settings.d.ts +30 -4
- package/dist/modules/graceful_shutdown.d.ts +3 -3
- package/dist/modules/graceful_shutdown.js +2 -2
- package/dist/modules/grid_price_source.d.ts +1 -1
- package/dist/modules/key_store.d.ts +14 -8
- package/dist/modules/key_store.js +7 -6
- package/dist/modules/launcher/adapter_requirement.d.ts +11 -5
- package/dist/modules/launcher/adapter_requirement.js +5 -5
- package/dist/modules/launcher/bot_supervisor.d.ts +106 -24
- package/dist/modules/launcher/bot_supervisor.js +12 -11
- package/dist/modules/launcher/credential_bootstrap.d.ts +1 -1
- package/dist/modules/launcher/credential_bootstrap.js +1 -1
- package/dist/modules/launcher/credential_daemon.d.ts +4 -4
- package/dist/modules/launcher/credential_daemon.js +2 -2
- package/dist/modules/launcher/credential_secret.d.ts +1 -1
- package/dist/modules/launcher/foreign_cred_daemon.d.ts +2 -2
- package/dist/modules/launcher/market_adapter_runtime.d.ts +61 -6
- package/dist/modules/launcher/market_adapter_watchdog.d.ts +10 -2
- package/dist/modules/launcher/market_adapter_watchdog.js +4 -0
- package/dist/modules/launcher/monolithic_runtime.d.ts +18 -16
- package/dist/modules/launcher/status_reporting.d.ts +22 -14
- package/dist/modules/launcher/supervisor_control.d.ts +8 -1
- package/dist/modules/launcher/supervisor_control.js +4 -2
- package/dist/modules/market_adapter_whitelist.d.ts +9 -3
- package/dist/modules/market_adapter_whitelist.js +15 -3
- package/dist/modules/node_manager.d.ts +41 -11
- package/dist/modules/node_manager.js +5 -4
- package/dist/modules/order/accounting.d.ts +53 -24
- package/dist/modules/order/accounting.js +16 -15
- package/dist/modules/order/async_lock.d.ts +5 -2
- package/dist/modules/order/async_lock.js +1 -1
- package/dist/modules/order/export.d.ts +7 -6
- package/dist/modules/order/export.js +1 -7
- package/dist/modules/order/format.d.ts +4 -4
- package/dist/modules/order/genesis_policy.d.ts +21 -18
- package/dist/modules/order/genesis_policy.js +12 -8
- package/dist/modules/order/grid.d.ts +142 -36
- package/dist/modules/order/grid.js +148 -123
- package/dist/modules/order/grid_reconcile.d.ts +21 -20
- package/dist/modules/order/grid_reconcile.js +13 -12
- package/dist/modules/order/grid_reconcile_internal.d.ts +85 -72
- package/dist/modules/order/grid_reconcile_internal.js +28 -19
- package/dist/modules/order/index.d.ts +263 -1
- package/dist/modules/order/logger.d.ts +45 -11
- package/dist/modules/order/logger.js +38 -40
- package/dist/modules/order/logger_state.d.ts +4 -4
- package/dist/modules/order/manager.d.ts +225 -180
- package/dist/modules/order/manager.js +80 -83
- package/dist/modules/order/processed_fill_store.d.ts +18 -3
- package/dist/modules/order/processed_fill_store.js +16 -27
- package/dist/modules/order/strategy.d.ts +21 -13
- package/dist/modules/order/strategy.js +5 -6
- package/dist/modules/order/sync_engine.d.ts +91 -33
- package/dist/modules/order/sync_engine.js +84 -53
- package/dist/modules/order/utils/math.d.ts +157 -102
- package/dist/modules/order/utils/math.js +77 -38
- package/dist/modules/order/utils/order.d.ts +310 -110
- package/dist/modules/order/utils/order.js +122 -99
- package/dist/modules/order/utils/slot.d.ts +1 -1
- package/dist/modules/order/utils/system.d.ts +176 -26
- package/dist/modules/order/utils/system.js +86 -69
- package/dist/modules/order/utils/validate.d.ts +89 -41
- package/dist/modules/order/utils/validate.js +24 -22
- package/dist/modules/order/utils/withPoolRef.d.ts +4 -3
- package/dist/modules/order/utils/withPoolRef.js +18 -12
- package/dist/modules/order/working_grid.d.ts +14 -13
- package/dist/modules/paths.d.ts +1 -4
- package/dist/modules/paths.js +1 -27
- package/dist/modules/process_discovery.d.ts +1 -1
- package/dist/modules/process_discovery.js +2 -1
- package/dist/modules/runtime.d.ts +7 -3
- package/dist/modules/runtime.js +4 -3
- package/dist/modules/runtime_settings.d.ts +15 -10
- package/dist/modules/runtime_settings.js +30 -24
- package/dist/modules/settings_merge.d.ts +29 -3
- package/dist/modules/settings_merge.js +56 -78
- package/dist/modules/socket_json_client.d.ts +7 -4
- package/dist/modules/storage/browser_adapter.d.ts +38 -53
- package/dist/modules/storage/browser_adapter.js +7 -30
- package/dist/modules/storage/index.d.ts +1 -1
- package/dist/modules/storage/node_adapter.d.ts +45 -27
- package/dist/modules/storage/node_adapter.js +9 -9
- package/dist/modules/storage/types.d.ts +5 -4
- package/dist/modules/types.d.ts +1071 -2
- package/dist/modules/types.js +4 -1
- package/dist/modules/utils/asset_symbols.d.ts +2 -1
- package/dist/modules/utils/asset_symbols.js +2 -1
- package/dist/modules/utils/errors.d.ts +9 -0
- package/dist/modules/utils/errors.js +23 -1
- package/dist/modules/utils/time_range.d.ts +1 -12
- package/dist/modules/utils/time_range.js +1 -1
- package/dist/modules/validate_profiles.js +53 -43
- package/dist/modules/version_notice.d.ts +14 -3
- package/dist/modules/version_notice.js +6 -4
- package/dist/pm2.d.ts +29 -27
- package/dist/pm2.js +5 -5
- package/dist/scripts/analyze-credit.d.ts +2 -1
- package/dist/scripts/analyze-credit.js +23 -24
- package/dist/scripts/analyze-orders.d.ts +77 -9
- package/dist/scripts/analyze-orders.js +65 -40
- package/dist/scripts/chart_command.d.ts +27 -18
- package/dist/scripts/chart_command.js +13 -11
- package/dist/scripts/check_any.d.ts +18 -0
- package/dist/scripts/check_any.js +126 -0
- package/dist/scripts/diagnose-pool-history.js +12 -7
- package/dist/scripts/print_grid.js +0 -1
- package/dist/scripts/run-tests.js +39 -7
- package/dist/scripts/runner.js +1 -1
- package/dist/scripts/test-credit-renewal.js +30 -21
- package/dist/scripts/update.d.ts +10 -5
- package/dist/scripts/update.js +168 -103
- package/dist/scripts/update_dist_freshness.js +1 -0
- package/dist/scripts/update_layout.d.ts +61 -0
- package/dist/scripts/update_layout.js +180 -0
- package/dist/scripts/validate_bots.js +2 -1
- package/dist/scripts/verify-browser-bundle.js +8 -0
- package/dist/unlock.d.ts +28 -3
- package/dist/unlock.js +63 -35
- package/docs/BITSHARES_ONBOARDING.md +2 -0
- package/docs/COPY_ON_WRITE_MASTER_PLAN.md +1 -1
- package/docs/COW_INVARIANTS.md +13 -6
- package/docs/DEXBOT_COMPARISON.md +8 -8
- package/docs/EVOLUTION.md +10 -9
- package/docs/FUND_MOVEMENT_AND_ACCOUNTING.md +5 -5
- package/docs/GRID_RECALCULATION.md +4 -2
- package/docs/GRID_RECONCILE.md +14 -3
- package/docs/LIFECYCLE.md +11 -11
- package/docs/MPA_CREDIT_USAGE.md +22 -3
- package/docs/README.md +14 -3
- package/docs/architecture.md +12 -9
- package/docs/developer_guide.md +6 -6
- package/market_adapter/README.md +6 -1
- package/modules/README.md +4 -1
- package/package.json +4 -1
|
@@ -63,85 +63,136 @@
|
|
|
63
63
|
*
|
|
64
64
|
* ===============================================================================
|
|
65
65
|
*/
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
import * as DexbotStartupRuntime from './dexbot_startup_runtime.js';
|
|
67
|
+
import cowRuntime from './dexbot_cow_runtime.js';
|
|
68
|
+
import type { ChainOrderLike, CowResult, OpPhase } from './dexbot_cow_runtime.js';
|
|
69
|
+
import { normalizeBotEntry } from './bot_settings.js';
|
|
70
|
+
import type { FillOpLike, FillLike, ReplayMessageFn } from './dexbot_fill_runtime.js';
|
|
71
|
+
import type { BotLike, AssetPair, IncomingFill, ManagerLogger, UnknownRecord, GridConfig, OrderManagerLike, AccountOrdersLike, BotMetrics, ProcessedFillStoreLike, CreditRuntimeLike, FillBatchResult, SigningToken } from './types.js';
|
|
72
|
+
declare class DEXBot implements BotLike {
|
|
73
|
+
static normalizeBotEntry: typeof normalizeBotEntry;
|
|
74
|
+
config: GridConfig;
|
|
68
75
|
_baseWeightDistribution: {
|
|
69
76
|
sell: number;
|
|
70
77
|
buy: number;
|
|
71
78
|
};
|
|
72
|
-
account:
|
|
79
|
+
account: string | null;
|
|
73
80
|
accountId: string | null;
|
|
74
|
-
privateKey:
|
|
75
|
-
manager:
|
|
76
|
-
accountOrders:
|
|
81
|
+
privateKey: string | SigningToken | null;
|
|
82
|
+
manager: OrderManagerLike;
|
|
83
|
+
accountOrders: AccountOrdersLike;
|
|
77
84
|
triggerFile: string;
|
|
78
|
-
_recentlyQueuedFills: Map<
|
|
85
|
+
_recentlyQueuedFills: Map<string, number>;
|
|
79
86
|
_fillCleanupCounter: number;
|
|
80
87
|
_fillDedupeWindowMs: number;
|
|
81
88
|
_fillRecordRetentionMs: number;
|
|
82
89
|
_processedFillPersistBatchMs: number;
|
|
83
90
|
_processedFillPersistBatchSize: number;
|
|
84
|
-
_processedFillStore:
|
|
85
|
-
_recentlyProcessedFills:
|
|
86
|
-
_pendingProcessedFillWrites:
|
|
87
|
-
_incomingFillQueue:
|
|
91
|
+
_processedFillStore: ProcessedFillStoreLike;
|
|
92
|
+
_recentlyProcessedFills: Map<string, number>;
|
|
93
|
+
_pendingProcessedFillWrites: unknown;
|
|
94
|
+
_incomingFillQueue: IncomingFill[];
|
|
88
95
|
logPrefix: string;
|
|
89
|
-
_credentialDaemonWatchdogInterval:
|
|
96
|
+
_credentialDaemonWatchdogInterval: ReturnType<typeof setInterval> | null;
|
|
90
97
|
_credentialDaemonDown: boolean;
|
|
91
98
|
_credentialRecoveryNeeded: boolean;
|
|
92
99
|
_credentialRecoveryInFlight: boolean;
|
|
93
100
|
_credentialDaemonWatchdogInFlight: boolean;
|
|
94
101
|
_staleCleanedOrderIds: Map<string, number>;
|
|
95
102
|
_staleCleanupRetentionMs: number;
|
|
96
|
-
_metrics:
|
|
103
|
+
_metrics: BotMetrics;
|
|
97
104
|
_shuttingDown: boolean;
|
|
98
105
|
_shutdownPromise: Promise<void> | null;
|
|
99
|
-
_blockchainFetchInterval:
|
|
106
|
+
_blockchainFetchInterval: ReturnType<typeof setInterval> | null;
|
|
100
107
|
_blockchainFetchInFlight: number;
|
|
101
|
-
_botsConfigPollInterval:
|
|
108
|
+
_botsConfigPollInterval: ReturnType<typeof setInterval> | null;
|
|
102
109
|
_botsConfigPollInFlight: boolean;
|
|
103
110
|
_marketAdapterWatchdogFingerprint: string | null;
|
|
104
111
|
_appliedBotConfigFingerprint: string | null;
|
|
105
|
-
_appliedBotConfigEntry:
|
|
112
|
+
_appliedBotConfigEntry: unknown;
|
|
106
113
|
_lastBotConfigHintFingerprint: string | null;
|
|
107
|
-
_fillsUnsubscribe:
|
|
108
|
-
_triggerWatcher:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
114
|
+
_fillsUnsubscribe: (() => Promise<unknown>) | null;
|
|
115
|
+
_triggerWatcher: {
|
|
116
|
+
close?: () => void;
|
|
117
|
+
} | null;
|
|
118
|
+
_triggerDebounceTimer: ReturnType<typeof setTimeout> | null;
|
|
119
|
+
_deferredGridResyncTimer: ReturnType<typeof setTimeout> | null;
|
|
120
|
+
_maintenanceIdleTimer: ReturnType<typeof setTimeout> | null;
|
|
112
121
|
_mainLoopActive: boolean;
|
|
113
|
-
_mainLoopPromise:
|
|
114
|
-
_creditRuntime:
|
|
115
|
-
_creditWatchdogInterval:
|
|
122
|
+
_mainLoopPromise: Promise<unknown> | null;
|
|
123
|
+
_creditRuntime: CreditRuntimeLike | null;
|
|
124
|
+
_creditWatchdogInterval: ReturnType<typeof setInterval> | null;
|
|
116
125
|
_batchInFlight: number;
|
|
117
126
|
_cowBroadcastInFlight: boolean;
|
|
118
127
|
_recoverySyncInFlight: number;
|
|
119
128
|
_deferredFillsPending: boolean;
|
|
120
|
-
_postRecoveryRebalanceTimer:
|
|
121
|
-
_deferredFillRetryTimer:
|
|
129
|
+
_postRecoveryRebalanceTimer: ReturnType<typeof setTimeout> | null;
|
|
130
|
+
_deferredFillRetryTimer: ReturnType<typeof setTimeout> | null;
|
|
122
131
|
_lastTargetedDriftSyncAt: number;
|
|
123
132
|
_lightweightSyncCheckAt: number;
|
|
133
|
+
_lastUncertainResyncAt: number;
|
|
134
|
+
_lastResolvedPollIntervalMs: number;
|
|
135
|
+
_fillBroadcastDeferSince: number;
|
|
136
|
+
_fillBroadcastDeferRegionAt: number;
|
|
137
|
+
_fillTotalsParkedFills: IncomingFill[];
|
|
138
|
+
_fillTotalsRetryTimer: ReturnType<typeof setTimeout> | null;
|
|
139
|
+
_fillTotalsRetryDelayMs: number;
|
|
124
140
|
_targetedDriftSyncCooldownMs: number;
|
|
125
141
|
_maintenanceCooldownCycles: number;
|
|
126
142
|
_lastGridActivityAt: number;
|
|
127
143
|
_currentCycleId: number;
|
|
128
144
|
_consecutiveConsumeFailures: number;
|
|
129
145
|
_consumeFailureFirstAt: number;
|
|
130
|
-
_reconnectUnregister:
|
|
131
|
-
_credentialRecoveryDeferredTimer:
|
|
132
|
-
_structuralGridResyncTimer:
|
|
146
|
+
_reconnectUnregister: (() => void) | null;
|
|
147
|
+
_credentialRecoveryDeferredTimer: ReturnType<typeof setTimeout> | null;
|
|
148
|
+
_structuralGridResyncTimer: ReturnType<typeof setTimeout> | null;
|
|
133
149
|
_structuralGridResyncRunning: number;
|
|
134
|
-
_dustHealthCheckTimer:
|
|
150
|
+
_dustHealthCheckTimer: ReturnType<typeof setInterval> | null;
|
|
135
151
|
_lastBroadcastHeartbeatAt: number | undefined;
|
|
136
152
|
_lastDeferredDustCount: number;
|
|
137
153
|
_currentBatchId: string | number | null | undefined;
|
|
154
|
+
assets: AssetPair | null;
|
|
155
|
+
botKey: string;
|
|
156
|
+
name: string;
|
|
157
|
+
_blockchainFetchIntervalMin: number;
|
|
158
|
+
_deferredFillRetryDelayMs: number;
|
|
159
|
+
_deferredFillRetryWaits: number;
|
|
160
|
+
_fillTotalsRetryAttempt: number;
|
|
161
|
+
_gridLockHoldWarnAt: number;
|
|
162
|
+
_gridModule: unknown;
|
|
163
|
+
_gridPriceInvariantRejectStreak: Map<string, number>;
|
|
164
|
+
_gridReconcileModule: unknown;
|
|
165
|
+
_lastDeferredHoldResyncAt: number;
|
|
166
|
+
_lastGridPriceInvariantResyncAt: number;
|
|
167
|
+
_lastHeldChainOrderSignature: string | null;
|
|
168
|
+
_lastHeldChainOrderSignatureSince: number;
|
|
169
|
+
_lastHeldChainOrderWarnAt: number;
|
|
170
|
+
_lastSpreadStaleResyncAt: number;
|
|
171
|
+
_marketAdapterWatchdogInFlight: boolean;
|
|
172
|
+
_outOfSpreadSince: number;
|
|
173
|
+
_outOfSpreadStaleWarned: boolean;
|
|
174
|
+
_postRecoveryRebalanceDefers: number;
|
|
175
|
+
_skipEmptyReadConfirmDelay: boolean;
|
|
176
|
+
_spreadFundsExhausted: boolean;
|
|
177
|
+
_strandedHoldSince: Map<string, number>;
|
|
178
|
+
_structuralGridResyncDeferCount: number;
|
|
179
|
+
_structuralGridResyncDeferStartedAt: number;
|
|
180
|
+
_testPollIntervalMs: number;
|
|
181
|
+
_getPm2ProcessNames: (...args: unknown[]) => Promise<string[]>;
|
|
182
|
+
_listenForFillsHook: (...args: unknown[]) => unknown;
|
|
183
|
+
_loadBotsConfigSnapshot: (...args: unknown[]) => unknown;
|
|
184
|
+
_readOpenOrdersHook: (...args: unknown[]) => unknown;
|
|
185
|
+
_startMarketAdapterPm2: (...args: unknown[]) => unknown;
|
|
186
|
+
_stopMarketAdapterPm2: (...args: unknown[]) => unknown;
|
|
187
|
+
_submitCancelOrder: (...args: unknown[]) => unknown;
|
|
188
|
+
_syncMarketAdapterHook: (...args: unknown[]) => unknown;
|
|
138
189
|
/**
|
|
139
190
|
* Create a new DEXBot instance
|
|
140
191
|
* @param {Object} config - Bot configuration from profiles/bots.json
|
|
141
192
|
* @param {Object} options - Optional settings
|
|
142
193
|
* @param {string} options.logPrefix - Prefix for console logs (e.g., "[bot.js]")
|
|
143
194
|
*/
|
|
144
|
-
constructor(config:
|
|
195
|
+
constructor(config: GridConfig, options?: {
|
|
145
196
|
logPrefix?: string;
|
|
146
197
|
});
|
|
147
198
|
/**
|
|
@@ -151,20 +202,20 @@ declare class DEXBot {
|
|
|
151
202
|
* @throws {Error} If critical validation fails
|
|
152
203
|
* @private
|
|
153
204
|
*/
|
|
154
|
-
_validateStartupConfig(config:
|
|
205
|
+
_validateStartupConfig(config: Record<string, unknown>): void;
|
|
155
206
|
/**
|
|
156
207
|
* Log a message to the console with the bot's prefix.
|
|
157
208
|
* @param {string} msg - The message to log.
|
|
158
209
|
* @param {string} [level='info'] - The log level ('debug', 'info', 'warn', 'error').
|
|
159
210
|
* @private
|
|
160
211
|
*/
|
|
161
|
-
_log(msg:
|
|
212
|
+
_log(msg: unknown, level?: string): void;
|
|
162
213
|
/**
|
|
163
214
|
* Log a warning message to the console with the bot's prefix.
|
|
164
215
|
* @param {string} msg - The message to log.
|
|
165
216
|
* @private
|
|
166
217
|
*/
|
|
167
|
-
_warn(msg:
|
|
218
|
+
_warn(msg: unknown): void;
|
|
168
219
|
/**
|
|
169
220
|
* Persist the grid and trigger immediate recovery if validation fails.
|
|
170
221
|
* Used during startup to ensure bot begins in a stable state.
|
|
@@ -184,30 +235,30 @@ declare class DEXBot {
|
|
|
184
235
|
* @returns {{incomingFillQueueLength: number, shadowLocks: number, batchInFlight: boolean, recoveryInFlight: boolean, broadcasting: boolean}}
|
|
185
236
|
*/
|
|
186
237
|
_getPipelineSignals(): {
|
|
187
|
-
incomingFillQueueLength:
|
|
188
|
-
shadowLocks:
|
|
238
|
+
incomingFillQueueLength: number;
|
|
239
|
+
shadowLocks: number;
|
|
189
240
|
batchInFlight: boolean;
|
|
190
241
|
recoveryInFlight: boolean;
|
|
191
|
-
broadcasting:
|
|
242
|
+
broadcasting: boolean;
|
|
192
243
|
};
|
|
193
244
|
/**
|
|
194
245
|
* Mark that grid activity occurred (updates idle timer).
|
|
195
246
|
* @param {string} [reason='activity'] - Reason for activity
|
|
196
247
|
* @returns {void}
|
|
197
248
|
*/
|
|
198
|
-
_markGridActivity(reason?:
|
|
249
|
+
_markGridActivity(reason?: string): void;
|
|
199
250
|
/**
|
|
200
251
|
* Trigger a full state recovery sync (fetch chain + sync from open orders + persist).
|
|
201
252
|
* @param {string} [reason='state recovery sync'] - Reason for recovery
|
|
202
253
|
* @returns {Promise<void>}
|
|
203
254
|
*/
|
|
204
|
-
_triggerStateRecoverySync(reason?:
|
|
255
|
+
_triggerStateRecoverySync(reason?: string): Promise<void>;
|
|
205
256
|
/**
|
|
206
257
|
* Abort the current flow if an illegal state signal was raised.
|
|
207
258
|
* @param {string} flowContext - Description of the flow being aborted
|
|
208
259
|
* @returns {Promise<boolean>} True if flow was aborted
|
|
209
260
|
*/
|
|
210
|
-
_abortFlowIfIllegalState(flowContext:
|
|
261
|
+
_abortFlowIfIllegalState(flowContext: string): Promise<boolean>;
|
|
211
262
|
/**
|
|
212
263
|
* Handle a hard abort from batch processing due to illegal state or accounting failure.
|
|
213
264
|
* @param {Error} err - The error that triggered the abort
|
|
@@ -215,7 +266,7 @@ declare class DEXBot {
|
|
|
215
266
|
* @param {number} [opsCount=0] - Number of operations in the batch
|
|
216
267
|
* @returns {Promise<Object>} Abort result object
|
|
217
268
|
*/
|
|
218
|
-
_handleBatchHardAbort(err:
|
|
269
|
+
_handleBatchHardAbort(err: unknown, phase?: string, opsCount?: number): Promise<{
|
|
219
270
|
abortedForAccountingFailure: boolean;
|
|
220
271
|
executed: boolean;
|
|
221
272
|
hadRotation: boolean;
|
|
@@ -230,14 +281,14 @@ declare class DEXBot {
|
|
|
230
281
|
* @param {string} [context='recoverable-grid-update'] - Context label for logging
|
|
231
282
|
* @returns {Promise<number>} Number of updates applied
|
|
232
283
|
*/
|
|
233
|
-
_applyRecoverableGridUpdates(updates:
|
|
284
|
+
_applyRecoverableGridUpdates(updates: unknown[], context?: string): Promise<number>;
|
|
234
285
|
/**
|
|
235
286
|
* Recover from explicit stale order errors by virtualizing affected grid slots.
|
|
236
287
|
* @param {Set<string>|string[]} staleOrderIds - Set or array of stale chain order IDs
|
|
237
288
|
* @param {string} [reason='stale order cleanup'] - Reason for cleanup
|
|
238
289
|
* @returns {Promise<{executed: boolean, hadRotation: boolean, stale: boolean, recoveredByVirtualization?: boolean}>}
|
|
239
290
|
*/
|
|
240
|
-
_recoverExplicitStaleOrders(staleOrderIds:
|
|
291
|
+
_recoverExplicitStaleOrders(staleOrderIds: unknown, reason?: string): Promise<{
|
|
241
292
|
executed: boolean;
|
|
242
293
|
hadRotation: boolean;
|
|
243
294
|
stale: boolean;
|
|
@@ -253,7 +304,7 @@ declare class DEXBot {
|
|
|
253
304
|
* @param {Error} err - The size drift error
|
|
254
305
|
* @returns {Promise<{executed: boolean, hadRotation: boolean, recoveredBySync: boolean, reason: string}>}
|
|
255
306
|
*/
|
|
256
|
-
_recoverBatchSizeDrift(err:
|
|
307
|
+
_recoverBatchSizeDrift(err: unknown, opContexts?: unknown[]): Promise<{
|
|
257
308
|
executed: boolean;
|
|
258
309
|
hadRotation: boolean;
|
|
259
310
|
recoveredBySync: boolean;
|
|
@@ -291,7 +342,7 @@ declare class DEXBot {
|
|
|
291
342
|
* @param {'startup'|'recovery'} context - Controls log prefix.
|
|
292
343
|
* @returns {Promise<boolean>} True if the snapshot was rejected (cleared).
|
|
293
344
|
*/
|
|
294
|
-
_rejectCorruptedGridSnapshot(context:
|
|
345
|
+
_rejectCorruptedGridSnapshot(context: string): Promise<boolean>;
|
|
295
346
|
/**
|
|
296
347
|
* Attempt to repair size-drift for specific order IDs by reading their
|
|
297
348
|
* current on-chain state and correcting the local grid directly.
|
|
@@ -299,7 +350,7 @@ declare class DEXBot {
|
|
|
299
350
|
* @param {string[]} orderIds
|
|
300
351
|
* @returns {Promise<boolean>} True if all affected orders were repaired
|
|
301
352
|
*/
|
|
302
|
-
_targetedOrderRepair(orderIds:
|
|
353
|
+
_targetedOrderRepair(orderIds: string[]): Promise<boolean>;
|
|
303
354
|
/**
|
|
304
355
|
* Initialize bot state from storage and blockchain.
|
|
305
356
|
* Consolidates common initialization logic for start() and startWithPrivateKey().
|
|
@@ -307,13 +358,13 @@ declare class DEXBot {
|
|
|
307
358
|
* @private
|
|
308
359
|
*/
|
|
309
360
|
_initializeStartupState(): Promise<{
|
|
310
|
-
persistedGrid:
|
|
311
|
-
persistedBtsFeesOwed:
|
|
312
|
-
persistedBoundaryIdx:
|
|
313
|
-
persistedBtsBalance:
|
|
314
|
-
persistedRecentFillKeys:
|
|
315
|
-
persistedGenesis:
|
|
316
|
-
persistedGapEvacStreaks:
|
|
361
|
+
persistedGrid: unknown[] | null;
|
|
362
|
+
persistedBtsFeesOwed: unknown;
|
|
363
|
+
persistedBoundaryIdx: number | null;
|
|
364
|
+
persistedBtsBalance: unknown;
|
|
365
|
+
persistedRecentFillKeys: unknown;
|
|
366
|
+
persistedGenesis: {} | null;
|
|
367
|
+
persistedGapEvacStreaks: {} | null;
|
|
317
368
|
}>;
|
|
318
369
|
/**
|
|
319
370
|
* Wire processed fill tracking into the manager.
|
|
@@ -326,7 +377,7 @@ declare class DEXBot {
|
|
|
326
377
|
* @param {Object} [options={}] - Flush options
|
|
327
378
|
* @returns {Promise<void>}
|
|
328
379
|
*/
|
|
329
|
-
_flushProcessedFillPersistence(reason?:
|
|
380
|
+
_flushProcessedFillPersistence(reason?: string, options?: Record<string, unknown>): Promise<void>;
|
|
330
381
|
/**
|
|
331
382
|
* Flush persistence for specific fill keys.
|
|
332
383
|
* @param {Set<string>|string[]} fillKeys - Fill keys to persist
|
|
@@ -334,18 +385,18 @@ declare class DEXBot {
|
|
|
334
385
|
* @param {Object} [options={}] - Flush options
|
|
335
386
|
* @returns {Promise<void>}
|
|
336
387
|
*/
|
|
337
|
-
_flushProcessedFillPersistenceForKeys(fillKeys:
|
|
388
|
+
_flushProcessedFillPersistenceForKeys(fillKeys: string[] | Set<string>, reason?: string, options?: Record<string, unknown>): Promise<void>;
|
|
338
389
|
/**
|
|
339
390
|
* Build a fallback deduplication key for an orphan fill (when standard keys are unavailable).
|
|
340
391
|
* @param {Object} fill - Fill event object
|
|
341
392
|
* @returns {string|null} Fallback key or null
|
|
342
393
|
*/
|
|
343
|
-
_buildOrphanFillFallbackKey(fill:
|
|
344
|
-
_isNewFillKey(fillKey:
|
|
394
|
+
_buildOrphanFillFallbackKey(fill: FillLike): string | null;
|
|
395
|
+
_isNewFillKey(fillKey: string, processedFillKeys: Set<string>, label?: string, orderId?: string): boolean;
|
|
345
396
|
/**
|
|
346
397
|
* Apply replay-safe fill accounting for tracked fills (those with a valid grid order).
|
|
347
398
|
* @param {Object} fill - Fill event object
|
|
348
|
-
* @param {
|
|
399
|
+
* @param {unknown} fillOp - Fill operation data
|
|
349
400
|
* @param {Object} [options={}]
|
|
350
401
|
* @param {string} [options.context]
|
|
351
402
|
* @param {Object} [options.logger]
|
|
@@ -353,11 +404,11 @@ declare class DEXBot {
|
|
|
353
404
|
* @param {string} [options.persistenceMode='batched']
|
|
354
405
|
* @returns {Promise<any>}
|
|
355
406
|
*/
|
|
356
|
-
_applyReplaySafeTrackedFillAccounting(fill:
|
|
407
|
+
_applyReplaySafeTrackedFillAccounting(fill: unknown, fillOp: FillOpLike, { context, logger, replayMessage, persistenceMode }?: {
|
|
357
408
|
context?: string;
|
|
358
|
-
logger?:
|
|
359
|
-
replayMessage?:
|
|
360
|
-
persistenceMode?:
|
|
409
|
+
logger?: Partial<ManagerLogger>;
|
|
410
|
+
replayMessage?: ReplayMessageFn;
|
|
411
|
+
persistenceMode?: string;
|
|
361
412
|
}): Promise<{
|
|
362
413
|
status: string;
|
|
363
414
|
fillKey: any;
|
|
@@ -371,13 +422,13 @@ declare class DEXBot {
|
|
|
371
422
|
} | {
|
|
372
423
|
status: string;
|
|
373
424
|
fillKey: any;
|
|
374
|
-
error:
|
|
425
|
+
error: unknown;
|
|
375
426
|
usedFallbackKey?: undefined;
|
|
376
427
|
}>;
|
|
377
428
|
/**
|
|
378
429
|
* Apply replay-safe fill accounting for orphan fills (grid order not found).
|
|
379
430
|
* @param {Object} fill - Fill event object
|
|
380
|
-
* @param {
|
|
431
|
+
* @param {unknown} fillOp - Fill operation data
|
|
381
432
|
* @param {Object} [options={}]
|
|
382
433
|
* @param {string} [options.context]
|
|
383
434
|
* @param {Object} [options.logger]
|
|
@@ -385,11 +436,11 @@ declare class DEXBot {
|
|
|
385
436
|
* @param {string} [options.persistenceMode='batched']
|
|
386
437
|
* @returns {Promise<any>}
|
|
387
438
|
*/
|
|
388
|
-
_applyReplaySafeOrphanFillAccounting(fill:
|
|
439
|
+
_applyReplaySafeOrphanFillAccounting(fill: unknown, fillOp: FillOpLike, { context, logger, replayMessage, persistenceMode }?: {
|
|
389
440
|
context?: string;
|
|
390
|
-
logger?:
|
|
391
|
-
replayMessage?:
|
|
392
|
-
persistenceMode?:
|
|
441
|
+
logger?: Partial<ManagerLogger>;
|
|
442
|
+
replayMessage?: ReplayMessageFn;
|
|
443
|
+
persistenceMode?: string;
|
|
393
444
|
}): Promise<{
|
|
394
445
|
status: string;
|
|
395
446
|
fillKey: any;
|
|
@@ -403,7 +454,7 @@ declare class DEXBot {
|
|
|
403
454
|
} | {
|
|
404
455
|
status: string;
|
|
405
456
|
fillKey: any;
|
|
406
|
-
error:
|
|
457
|
+
error: unknown;
|
|
407
458
|
usedFallbackKey?: undefined;
|
|
408
459
|
}>;
|
|
409
460
|
/**
|
|
@@ -411,7 +462,7 @@ declare class DEXBot {
|
|
|
411
462
|
* @param {string} [context='runtime'] - Context label for logging
|
|
412
463
|
* @returns {any|null}
|
|
413
464
|
*/
|
|
414
|
-
_refreshDynamicWeightDistribution(context?:
|
|
465
|
+
_refreshDynamicWeightDistribution(context?: string): {
|
|
415
466
|
applied: boolean;
|
|
416
467
|
source: string;
|
|
417
468
|
weightDistribution: any;
|
|
@@ -420,7 +471,7 @@ declare class DEXBot {
|
|
|
420
471
|
applied: boolean;
|
|
421
472
|
source: string;
|
|
422
473
|
weightDistribution: any;
|
|
423
|
-
snapshotUpdatedAt:
|
|
474
|
+
snapshotUpdatedAt: {} | null;
|
|
424
475
|
};
|
|
425
476
|
/**
|
|
426
477
|
* Finalize the bot startup after account and initial grid sync are complete.
|
|
@@ -428,7 +479,7 @@ declare class DEXBot {
|
|
|
428
479
|
* @param {Object} startupState - The startup state from _initializeStartupState.
|
|
429
480
|
* @private
|
|
430
481
|
*/
|
|
431
|
-
_finishStartupSequence(startupState:
|
|
482
|
+
_finishStartupSequence(startupState: Parameters<typeof DexbotStartupRuntime.finishStartupSequence>[1]): Promise<void>;
|
|
432
483
|
/**
|
|
433
484
|
* Create the fill callback for listenForFills.
|
|
434
485
|
* Separated from start() to allow deferred activation after startup completes.
|
|
@@ -436,23 +487,23 @@ declare class DEXBot {
|
|
|
436
487
|
* @returns {Function} Async callback for processing fills
|
|
437
488
|
* @private
|
|
438
489
|
*/
|
|
439
|
-
_createFillCallback(chainOrders:
|
|
490
|
+
_createFillCallback(chainOrders: typeof import('./chain_orders.js')): (fills: IncomingFill[]) => Promise<void>;
|
|
440
491
|
/**
|
|
441
492
|
* Read open orders from chain, sync with local state, and process any fills found.
|
|
442
493
|
* Shared helper used by post-reset spread check and targeted drift reconciliation.
|
|
443
494
|
* @param {string} tag - Context label for logging
|
|
444
495
|
* @returns {Promise<{syncResult: Object|null, aborted: boolean, hasUnmatched: number, openOrders: Array|null}>}
|
|
445
496
|
*/
|
|
446
|
-
_syncOpenOrdersAndProcessFills(tag:
|
|
497
|
+
_syncOpenOrdersAndProcessFills(tag: string): Promise<{
|
|
447
498
|
syncResult: null;
|
|
448
499
|
aborted: boolean;
|
|
449
500
|
hasUnmatched: number;
|
|
450
501
|
openOrders: null;
|
|
451
502
|
} | {
|
|
452
|
-
syncResult:
|
|
503
|
+
syncResult: import("./types.js").SyncResult;
|
|
453
504
|
aborted: boolean;
|
|
454
|
-
hasUnmatched:
|
|
455
|
-
openOrders:
|
|
505
|
+
hasUnmatched: number;
|
|
506
|
+
openOrders: import("./types.js").ChainOrder[];
|
|
456
507
|
}>;
|
|
457
508
|
/**
|
|
458
509
|
* Schedule the fill-consumer restart after the failure budget
|
|
@@ -462,7 +513,7 @@ declare class DEXBot {
|
|
|
462
513
|
* @param {Object} chainOrders - Chain orders module for blockchain operations
|
|
463
514
|
* @private
|
|
464
515
|
*/
|
|
465
|
-
_scheduleFillConsumerRestart(chainOrders:
|
|
516
|
+
_scheduleFillConsumerRestart(chainOrders: typeof import('./chain_orders.js')): void;
|
|
466
517
|
/**
|
|
467
518
|
* Consume queued fills from incomingFillQueue and rebalance.
|
|
468
519
|
*
|
|
@@ -476,7 +527,7 @@ declare class DEXBot {
|
|
|
476
527
|
* @param {Object} chainOrders - Chain orders module for blockchain operations
|
|
477
528
|
* @private
|
|
478
529
|
*/
|
|
479
|
-
_consumeFillQueue(chainOrders:
|
|
530
|
+
_consumeFillQueue(chainOrders: typeof import('./chain_orders.js')): Promise<void>;
|
|
480
531
|
/**
|
|
481
532
|
* Process fills during bootstrap phase using the standard fill pipeline.
|
|
482
533
|
*
|
|
@@ -497,20 +548,20 @@ declare class DEXBot {
|
|
|
497
548
|
* @param {Object} chainOrders - Chain orders instance for broadcasting
|
|
498
549
|
* @returns {Promise<void>}
|
|
499
550
|
*/
|
|
500
|
-
_processFillsWithBootstrapMode(chainOrders:
|
|
551
|
+
_processFillsWithBootstrapMode(chainOrders: typeof import('./chain_orders.js')): Promise<void>;
|
|
501
552
|
/**
|
|
502
553
|
* Set up account identifier and configure global context.
|
|
503
554
|
* @param {string} accountName - The name of the account to set up
|
|
504
555
|
* @private
|
|
505
556
|
*/
|
|
506
|
-
_setupAccountContext(accountName:
|
|
557
|
+
_setupAccountContext(accountName: string): Promise<void>;
|
|
507
558
|
/**
|
|
508
559
|
* Initialize the bot by connecting to BitShares and setting up the account.
|
|
509
560
|
* @param {string|Object|Buffer} [vaultSecret=null] - The unlock secret for authentication.
|
|
510
561
|
* @returns {Promise<void>}
|
|
511
562
|
* @throws {Error} If initialization fails or preferredAccount is missing.
|
|
512
563
|
*/
|
|
513
|
-
initialize(vaultSecret?:
|
|
564
|
+
initialize(vaultSecret?: string | null): Promise<void>;
|
|
514
565
|
/**
|
|
515
566
|
* Places initial orders on the blockchain.
|
|
516
567
|
* @returns {Promise<void>}
|
|
@@ -521,13 +572,13 @@ declare class DEXBot {
|
|
|
521
572
|
* @param {Array<Object>} orders - Array of order objects
|
|
522
573
|
* @returns {Array<Array<Object>>} Grouped order arrays
|
|
523
574
|
*/
|
|
524
|
-
_buildOutsideInPairGroupsForOrders(orders:
|
|
575
|
+
_buildOutsideInPairGroupsForOrders(orders: unknown[]): unknown[][];
|
|
525
576
|
/**
|
|
526
577
|
* Build outside-in pair groups for create entry contexts.
|
|
527
578
|
* @param {Array<Object>} createEntries - Array of create entry objects with context.order
|
|
528
579
|
* @returns {Array<Array<Object>>} Grouped entry arrays
|
|
529
580
|
*/
|
|
530
|
-
_buildOutsideInPairGroupsForCreateEntries(createEntries:
|
|
581
|
+
_buildOutsideInPairGroupsForCreateEntries(createEntries: unknown[]): unknown[][];
|
|
531
582
|
/**
|
|
532
583
|
* Resolve the fill/broadcast batch size from the grid gap-slot count.
|
|
533
584
|
*
|
|
@@ -578,14 +629,14 @@ declare class DEXBot {
|
|
|
578
629
|
* @param {Array<{index:number, ctx:Object}>} missingCreateResults - Missing CREATE results.
|
|
579
630
|
* @returns {void}
|
|
580
631
|
*/
|
|
581
|
-
_markMissingCreateResultsAsStructuralBlocker(missingCreateResults:
|
|
632
|
+
_markMissingCreateResultsAsStructuralBlocker(missingCreateResults: unknown): void;
|
|
582
633
|
/**
|
|
583
634
|
* Format an unmatched chain order/blocker for COW logs.
|
|
584
635
|
*
|
|
585
636
|
* @param {Object} order - Unmatched chain order or structural blocker.
|
|
586
637
|
* @returns {string} Compact human-readable diagnostic.
|
|
587
638
|
*/
|
|
588
|
-
_formatUnmatchedChainOrderForLog(order:
|
|
639
|
+
_formatUnmatchedChainOrderForLog(order: unknown): string;
|
|
589
640
|
/**
|
|
590
641
|
* Record a pending CREATE broadcast on the manager.
|
|
591
642
|
*
|
|
@@ -606,7 +657,7 @@ declare class DEXBot {
|
|
|
606
657
|
* @param {Object} entry.finalInts - { amountToSell, minToReceive, ... } blockchain integers
|
|
607
658
|
* @returns {void}
|
|
608
659
|
*/
|
|
609
|
-
_recordPendingBroadcast(entry:
|
|
660
|
+
_recordPendingBroadcast(entry: unknown): string | null;
|
|
610
661
|
/**
|
|
611
662
|
* Clear the pending-broadcast cache.
|
|
612
663
|
*
|
|
@@ -631,7 +682,7 @@ declare class DEXBot {
|
|
|
631
682
|
* @param {Object} planned - { sell, receive, orderType } integers from the planned op
|
|
632
683
|
* @returns {Object|null} Matching chain order, or null
|
|
633
684
|
*/
|
|
634
|
-
_findChainOrderForSlot(chainOrders:
|
|
685
|
+
_findChainOrderForSlot(chainOrders: ChainOrderLike[], slotId: string, planned: Parameters<typeof cowRuntime.findChainOrderForSlot>[3]): ChainOrderLike | null;
|
|
635
686
|
/**
|
|
636
687
|
* Reconcile a broadcast whose chain state is unknown.
|
|
637
688
|
*
|
|
@@ -658,7 +709,12 @@ declare class DEXBot {
|
|
|
658
709
|
* @param {Array<Object>} opContexts - Original opContexts from the failed batch
|
|
659
710
|
* @returns {Promise<Object>} Result object compatible with batch return shape
|
|
660
711
|
*/
|
|
661
|
-
_reconcileAfterUncertainBroadcast(err:
|
|
712
|
+
_reconcileAfterUncertainBroadcast(err: unknown, opContexts: OpPhase[], options?: UnknownRecord): Promise<UnknownRecord | {
|
|
713
|
+
executed: boolean;
|
|
714
|
+
hadRotation: boolean;
|
|
715
|
+
uncertain: boolean;
|
|
716
|
+
ambiguousRead: boolean;
|
|
717
|
+
}>;
|
|
662
718
|
/**
|
|
663
719
|
* Execute operations with retry on BroadcastUncertainError.
|
|
664
720
|
* The daemon already retries internally against a 25s deadline. If it
|
|
@@ -672,9 +728,9 @@ declare class DEXBot {
|
|
|
672
728
|
* execution where earlier groups already committed). Re-broadcasting
|
|
673
729
|
* the full operations array would duplicate those creates on chain.
|
|
674
730
|
*/
|
|
675
|
-
_executeWithRetryOnUncertain(operations:
|
|
676
|
-
result:
|
|
677
|
-
opContexts:
|
|
731
|
+
_executeWithRetryOnUncertain(operations: unknown[], opContexts: OpPhase[]): Promise<{
|
|
732
|
+
result: unknown;
|
|
733
|
+
opContexts: OpPhase[];
|
|
678
734
|
}>;
|
|
679
735
|
/**
|
|
680
736
|
* Execute operations with retry-on-uncertain semantics AND a per-broadcast
|
|
@@ -685,9 +741,9 @@ declare class DEXBot {
|
|
|
685
741
|
* @param {Array<Object>} opContexts - Array of operation context metadata (1:1 with operations)
|
|
686
742
|
* @returns {Promise<{result: Object, opContexts: Array}>} Execution result with contexts
|
|
687
743
|
*/
|
|
688
|
-
_executeChunkedWithRetryOnUncertain(operations:
|
|
689
|
-
result:
|
|
690
|
-
opContexts:
|
|
744
|
+
_executeChunkedWithRetryOnUncertain(operations: unknown[], opContexts: OpPhase[]): Promise<{
|
|
745
|
+
result: unknown;
|
|
746
|
+
opContexts: OpPhase[];
|
|
691
747
|
}>;
|
|
692
748
|
/**
|
|
693
749
|
* Execute a batch of order operations if the rebalance result has executable actions.
|
|
@@ -695,7 +751,7 @@ declare class DEXBot {
|
|
|
695
751
|
* @param {string} [contextLabel='rebalance'] - Context label for logging
|
|
696
752
|
* @returns {Promise<Object>} Batch execution result
|
|
697
753
|
*/
|
|
698
|
-
_executeBatchIfNeeded(rebalanceResult:
|
|
754
|
+
_executeBatchIfNeeded(rebalanceResult: unknown, contextLabel?: unknown): Promise<unknown>;
|
|
699
755
|
/**
|
|
700
756
|
* Process filled orders in (gap-slot + 1)-sized batches per _getGapSlotBatchSize().
|
|
701
757
|
* Each chunk triggers its own processFilledOrders → COW plan → broadcast cycle.
|
|
@@ -706,13 +762,7 @@ declare class DEXBot {
|
|
|
706
762
|
* @param {Object} [options={}] - Passed through to processFilledOrders
|
|
707
763
|
* @returns {{aborted: boolean}}
|
|
708
764
|
*/
|
|
709
|
-
_processFillsWithBatching(fills:
|
|
710
|
-
aborted: boolean;
|
|
711
|
-
deferred?: undefined;
|
|
712
|
-
} | {
|
|
713
|
-
aborted: boolean;
|
|
714
|
-
deferred: boolean;
|
|
715
|
-
}>;
|
|
765
|
+
_processFillsWithBatching(fills: unknown, excl: unknown, contextLabel: unknown, options?: UnknownRecord): Promise<FillBatchResult>;
|
|
716
766
|
/**
|
|
717
767
|
* Check if the bot requires credential daemon for write operations.
|
|
718
768
|
* @returns {boolean}
|
|
@@ -723,26 +773,26 @@ declare class DEXBot {
|
|
|
723
773
|
* @param {string} reason - Reason for suspension
|
|
724
774
|
* @returns {void}
|
|
725
775
|
*/
|
|
726
|
-
_suspendGridPersistenceForCredentialOutage(reason:
|
|
776
|
+
_suspendGridPersistenceForCredentialOutage(reason: unknown): void;
|
|
727
777
|
/**
|
|
728
778
|
* Resume grid persistence after credential daemon recovery.
|
|
729
779
|
* @param {string} reason - Reason for resuming
|
|
730
780
|
* @returns {void}
|
|
731
781
|
*/
|
|
732
|
-
_resumeGridPersistenceAfterCredentialRecovery(reason:
|
|
782
|
+
_resumeGridPersistenceAfterCredentialRecovery(reason: unknown): void;
|
|
733
783
|
/**
|
|
734
784
|
* Ensure the credential daemon is writable before broadcasting operations.
|
|
735
785
|
* @param {string} [contextLabel='write batch'] - Context label for logging
|
|
736
786
|
* @returns {Promise<void>}
|
|
737
787
|
* @throws {Error} With code CREDENTIAL_DAEMON_UNAVAILABLE if daemon is down
|
|
738
788
|
*/
|
|
739
|
-
_ensureCredentialDaemonWritable(contextLabel?:
|
|
789
|
+
_ensureCredentialDaemonWritable(contextLabel?: unknown): Promise<void>;
|
|
740
790
|
/**
|
|
741
791
|
* Check if an error is related to credential daemon unavailability.
|
|
742
792
|
* @param {Error|*} err - Error to check
|
|
743
793
|
* @returns {boolean}
|
|
744
794
|
*/
|
|
745
|
-
_isCredentialDaemonError(err:
|
|
795
|
+
_isCredentialDaemonError(err: unknown): boolean;
|
|
746
796
|
/**
|
|
747
797
|
* Run state recovery after credential daemon is restored.
|
|
748
798
|
* @returns {Promise<void>}
|
|
@@ -764,27 +814,20 @@ declare class DEXBot {
|
|
|
764
814
|
* @param {Object} rebalanceResult - COW result containing workingGrid + actions.
|
|
765
815
|
* @returns {Promise<Object>} The batch result.
|
|
766
816
|
*/
|
|
767
|
-
updateOrdersOnChainBatch(rebalanceResult:
|
|
817
|
+
updateOrdersOnChainBatch(rebalanceResult: unknown): Promise<unknown>;
|
|
768
818
|
/**
|
|
769
819
|
* Converts simple plan payloads (place/update/rotate/cancel) into a COW batch.
|
|
770
820
|
* Used by spread/divergence maintenance and bootstrap helpers.
|
|
771
821
|
* @param {Object|Array} plan - Plan object or array of ordersToPlace
|
|
772
822
|
* @returns {Promise<Object>} Batch execution result
|
|
773
823
|
*/
|
|
774
|
-
updateOrdersOnChainPlan(plan:
|
|
824
|
+
updateOrdersOnChainPlan(plan: UnknownRecord): Promise<UnknownRecord>;
|
|
775
825
|
/**
|
|
776
826
|
* Build a COW result object (workingGrid + actions) from a simple plan.
|
|
777
827
|
* @param {Object|Array} plan - Plan object or array of ordersToPlace
|
|
778
828
|
* @returns {{workingGrid: any, workingIndexes: Object, workingBoundary: number, actions: Array}}
|
|
779
829
|
*/
|
|
780
|
-
_buildCowResultFromPlan(plan:
|
|
781
|
-
refillSlotIds?: any;
|
|
782
|
-
workingGrid: any;
|
|
783
|
-
workingIndexes: any;
|
|
784
|
-
workingBoundary: any;
|
|
785
|
-
actions: any[];
|
|
786
|
-
origin: any;
|
|
787
|
-
};
|
|
830
|
+
_buildCowResultFromPlan(plan: UnknownRecord): CowResult;
|
|
788
831
|
/**
|
|
789
832
|
* COW broadcast: Execute blockchain operations and commit working grid on success.
|
|
790
833
|
* Master grid is ONLY updated after successful blockchain confirmation.
|
|
@@ -792,12 +835,8 @@ declare class DEXBot {
|
|
|
792
835
|
* @returns {Promise<Object>} The batch result.
|
|
793
836
|
* @private
|
|
794
837
|
*/
|
|
795
|
-
_updateOrdersOnChainBatchCOW(cowResult:
|
|
796
|
-
_processBatchResults(result:
|
|
797
|
-
executed: boolean;
|
|
798
|
-
hadRotation: boolean;
|
|
799
|
-
updateOperationCount: number;
|
|
800
|
-
}>;
|
|
838
|
+
_updateOrdersOnChainBatchCOW(cowResult: CowResult, options?: UnknownRecord): Promise<UnknownRecord>;
|
|
839
|
+
_processBatchResults(result: UnknownRecord, opContexts: OpPhase[]): Promise<UnknownRecord>;
|
|
801
840
|
/**
|
|
802
841
|
* Perform grid recalculation triggered by trigger file.
|
|
803
842
|
* Reloads config from disk, recalculates grid, resets funds, and removes trigger file.
|
|
@@ -806,7 +845,7 @@ declare class DEXBot {
|
|
|
806
845
|
* @returns {Promise<boolean>} True if resync succeeded
|
|
807
846
|
* @private
|
|
808
847
|
*/
|
|
809
|
-
_performGridResync(options?:
|
|
848
|
+
_performGridResync(options?: UnknownRecord): Promise<unknown>;
|
|
810
849
|
/**
|
|
811
850
|
* Handle any pending trigger file reset at startup.
|
|
812
851
|
* This is called FIRST during startup before any grid operations.
|
|
@@ -825,14 +864,14 @@ declare class DEXBot {
|
|
|
825
864
|
* @param {string|Object|Buffer} [vaultSecret=null] - The unlock secret.
|
|
826
865
|
* @returns {Promise<void>}
|
|
827
866
|
*/
|
|
828
|
-
start(vaultSecret?:
|
|
867
|
+
start(vaultSecret?: unknown): Promise<void>;
|
|
829
868
|
/**
|
|
830
869
|
* Start bot with a pre-decrypted private key.
|
|
831
870
|
* Alternative to start(vaultSecret) when the signing secret is already available.
|
|
832
871
|
* @param {string|Object} privateKey - Pre-decrypted private key or daemon signing token
|
|
833
872
|
* @returns {Promise<void>}
|
|
834
873
|
*/
|
|
835
|
-
startWithPrivateKey(privateKey:
|
|
874
|
+
startWithPrivateKey(privateKey: unknown): Promise<void>;
|
|
836
875
|
/**
|
|
837
876
|
* Common startup sequence logic shared between start() and startWithPrivateKey().
|
|
838
877
|
* @private
|
|
@@ -883,17 +922,17 @@ declare class DEXBot {
|
|
|
883
922
|
* @private
|
|
884
923
|
*/
|
|
885
924
|
_stopBotsConfigPollInterval(): void;
|
|
886
|
-
_releaseMarketAdapterRuntime(context?:
|
|
925
|
+
_releaseMarketAdapterRuntime(context?: unknown): Promise<any>;
|
|
887
926
|
/**
|
|
888
927
|
* Get or create the credit runtime for debt policy management.
|
|
889
928
|
* @returns {import('./credit_runtime.js').CreditRuntime|null}
|
|
890
929
|
*/
|
|
891
|
-
_getCreditRuntime():
|
|
930
|
+
_getCreditRuntime(): CreditRuntimeLike | null;
|
|
892
931
|
/**
|
|
893
932
|
* Set up the credit runtime by loading its persisted state.
|
|
894
933
|
* @returns {Promise<import('./credit_runtime.js').CreditRuntime|null>}
|
|
895
934
|
*/
|
|
896
|
-
_setupCreditRuntime(): Promise<
|
|
935
|
+
_setupCreditRuntime(): Promise<CreditRuntimeLike | null>;
|
|
897
936
|
/**
|
|
898
937
|
* Refresh credit runtime state from chain and sync internal tracking.
|
|
899
938
|
* @returns {Promise<void>}
|
|
@@ -905,7 +944,7 @@ declare class DEXBot {
|
|
|
905
944
|
* @param {Object} [options={}] - Maintenance options
|
|
906
945
|
* @returns {Promise<*>} Maintenance result from runtime
|
|
907
946
|
*/
|
|
908
|
-
_runCreditRuntimeMaintenance(context?:
|
|
947
|
+
_runCreditRuntimeMaintenance(context?: unknown, options?: UnknownRecord): Promise<unknown>;
|
|
909
948
|
/**
|
|
910
949
|
* Start the credit deal watchdog interval.
|
|
911
950
|
* @returns {void}
|
|
@@ -916,10 +955,7 @@ declare class DEXBot {
|
|
|
916
955
|
* @returns {void}
|
|
917
956
|
*/
|
|
918
957
|
_stopCreditWatchdogInterval(): void;
|
|
919
|
-
requestGridReset(reason?:
|
|
920
|
-
refreshCenterPrice?: boolean;
|
|
921
|
-
[key: string]: any;
|
|
922
|
-
}): Promise<any>;
|
|
958
|
+
requestGridReset(reason?: unknown, options?: UnknownRecord): Promise<unknown>;
|
|
923
959
|
_wireStructuralGridResyncRequest(): void;
|
|
924
960
|
/**
|
|
925
961
|
* Wire the manager's broadcast-region-end hook to drain the deferred fill
|
|
@@ -937,7 +973,24 @@ declare class DEXBot {
|
|
|
937
973
|
* Get current metrics for monitoring and debugging.
|
|
938
974
|
* @returns {Object} Metrics snapshot
|
|
939
975
|
*/
|
|
940
|
-
getMetrics():
|
|
976
|
+
getMetrics(): {
|
|
977
|
+
queueDepth: number;
|
|
978
|
+
fillProcessingLockActive: boolean;
|
|
979
|
+
divergenceLockActive: boolean;
|
|
980
|
+
shadowLocksActive: number;
|
|
981
|
+
recoveryExhaustedAt: number | null;
|
|
982
|
+
recentFillsTracked: number;
|
|
983
|
+
unmatchedChainOrders: number;
|
|
984
|
+
heldChainOrders: number;
|
|
985
|
+
blockingChainOrders: number;
|
|
986
|
+
fillsProcessed: number;
|
|
987
|
+
batchesExecuted: number;
|
|
988
|
+
fillProcessingTimeMs: number;
|
|
989
|
+
lockContentionEvents: number;
|
|
990
|
+
maxQueueDepth: number;
|
|
991
|
+
gridLockContention: number;
|
|
992
|
+
fundRecalcCount: number;
|
|
993
|
+
};
|
|
941
994
|
/**
|
|
942
995
|
* Execute grid maintenance checks in strict order with pipeline consensus.
|
|
943
996
|
*
|
|
@@ -969,7 +1022,7 @@ declare class DEXBot {
|
|
|
969
1022
|
* @param {Object} context - Maintenance context for logging.
|
|
970
1023
|
* @private
|
|
971
1024
|
*/
|
|
972
|
-
_executeMaintenanceLogic(context:
|
|
1025
|
+
_executeMaintenanceLogic(context: unknown): Promise<void>;
|
|
973
1026
|
/**
|
|
974
1027
|
* Cancel dust partial orders immediately — no maps, no timers, no delay.
|
|
975
1028
|
* Each dust order is cancelled on chain and its slot rotated through the
|
|
@@ -978,13 +1031,16 @@ declare class DEXBot {
|
|
|
978
1031
|
* @returns {Promise<{cancelledCount: number, batchResult: {aborted: boolean}|null}>}
|
|
979
1032
|
* @private
|
|
980
1033
|
*/
|
|
981
|
-
_cancelDustOrders({ buy: buyDust, sell: sellDust }?:
|
|
1034
|
+
_cancelDustOrders({ buy: buyDust, sell: sellDust }?: {
|
|
1035
|
+
buy?: unknown[];
|
|
1036
|
+
sell?: unknown[];
|
|
1037
|
+
}): Promise<{
|
|
982
1038
|
cancelledCount: number;
|
|
983
1039
|
batchResult: null;
|
|
984
1040
|
} | {
|
|
985
1041
|
cancelledCount: number;
|
|
986
1042
|
batchResult: {
|
|
987
|
-
aborted:
|
|
1043
|
+
aborted: boolean | undefined;
|
|
988
1044
|
};
|
|
989
1045
|
}>;
|
|
990
1046
|
/**
|
|
@@ -1027,7 +1083,7 @@ declare class DEXBot {
|
|
|
1027
1083
|
* @param {Object} options - Maintenance options
|
|
1028
1084
|
* @private
|
|
1029
1085
|
*/
|
|
1030
|
-
_runGridMaintenance(context?:
|
|
1086
|
+
_runGridMaintenance(context?: unknown, options?: UnknownRecord): Promise<unknown>;
|
|
1031
1087
|
/**
|
|
1032
1088
|
* Gracefully shutdown the bot.
|
|
1033
1089
|
* Waits for current fill processing to complete, persists state, and stops intervals.
|