dexbot 1.6.13 → 1.6.15

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.
Files changed (114) hide show
  1. package/CHANGELOG.md +66 -4
  2. package/README.md +2 -2
  3. package/analysis/README.md +6 -6
  4. package/analysis/tradingview/README.md +2 -1
  5. package/claw/README.md +7 -7
  6. package/claw/docs/AI_BOT_LIBRARY_API.md +1 -1
  7. package/claw/docs/DEXBOT2_TUNING_CHEAT_SHEET.md +4 -4
  8. package/claw/modules/claw_catalog.ts +8 -4
  9. package/claw/modules/dexbot_profiles.ts +59 -15
  10. package/claw/modules/types.ts +2 -1
  11. package/claw/package.json +1 -1
  12. package/claw/runtimes/openclaw-plugin/openclaw.plugin.json +1 -1
  13. package/claw/runtimes/openclaw-plugin/package.json +1 -1
  14. package/claw/skills/margin-trading/SKILL.md +1 -1
  15. package/claw/skills/margin-trading/references/position-management.md +1 -1
  16. package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js +105 -31
  17. package/dist/analysis/trend_detection/dynamic_weight_chart_generator.js +36 -2
  18. package/dist/dexbot.js +23 -3
  19. package/dist/market_adapter/core/strategies/dynamic_weight_series.js +26 -11
  20. package/dist/modules/account_bots.d.ts +10 -6
  21. package/dist/modules/account_bots.js +13 -10
  22. package/dist/modules/account_orders.d.ts +36 -4
  23. package/dist/modules/account_orders.js +76 -5
  24. package/dist/modules/bitshares-native/crypto/ecc_core.d.ts +1 -2
  25. package/dist/modules/bitshares-native/crypto/ecc_core.js +1 -1
  26. package/dist/modules/bitshares-native/serial/chain_constants.d.ts +1 -2
  27. package/dist/modules/bitshares-native/serial/chain_constants.js +1 -2
  28. package/dist/modules/bitshares-native/subscriptions.js +1 -1
  29. package/dist/modules/bot_defaults.d.ts +29 -4
  30. package/dist/modules/bot_defaults.js +65 -10
  31. package/dist/modules/bot_settings.d.ts +4 -0
  32. package/dist/modules/bot_settings.js +58 -21
  33. package/dist/modules/config.js +6 -1
  34. package/dist/modules/constants.d.ts +13 -5
  35. package/dist/modules/constants.js +36 -5
  36. package/dist/modules/credit_runtime.d.ts +35 -5
  37. package/dist/modules/credit_runtime.js +219 -38
  38. package/dist/modules/dexbot_class.d.ts +23 -0
  39. package/dist/modules/dexbot_class.js +60 -17
  40. package/dist/modules/dexbot_cow_runtime.d.ts +62 -174
  41. package/dist/modules/dexbot_cow_runtime.js +350 -64
  42. package/dist/modules/dexbot_credential_client.d.ts +1 -16
  43. package/dist/modules/dexbot_credential_client.js +1 -1
  44. package/dist/modules/dexbot_fill_runtime.d.ts +2 -2
  45. package/dist/modules/dexbot_fill_runtime.js +16 -8
  46. package/dist/modules/dexbot_maintenance_runtime.d.ts +24 -81
  47. package/dist/modules/dexbot_maintenance_runtime.js +104 -70
  48. package/dist/modules/dexbot_startup_runtime.js +15 -2
  49. package/dist/modules/dexbot_state_recovery.js +17 -1
  50. package/dist/modules/key_store.d.ts +0 -5
  51. package/dist/modules/key_store.js +1 -1
  52. package/dist/modules/order/accounting.js +11 -11
  53. package/dist/modules/order/export.js +4 -4
  54. package/dist/modules/order/format.d.ts +15 -1
  55. package/dist/modules/order/format.js +19 -1
  56. package/dist/modules/order/genesis_policy.d.ts +1 -1
  57. package/dist/modules/order/genesis_policy.js +1 -1
  58. package/dist/modules/order/grid.d.ts +141 -12
  59. package/dist/modules/order/grid.js +666 -92
  60. package/dist/modules/order/grid_reconcile.d.ts +1 -1
  61. package/dist/modules/order/grid_reconcile.js +9 -8
  62. package/dist/modules/order/grid_reconcile_internal.js +61 -58
  63. package/dist/modules/order/index.d.ts +37 -9
  64. package/dist/modules/order/logger.js +2 -2
  65. package/dist/modules/order/manager.d.ts +10 -2
  66. package/dist/modules/order/manager.js +56 -31
  67. package/dist/modules/order/strategy.d.ts +2 -2
  68. package/dist/modules/order/strategy.js +51 -21
  69. package/dist/modules/order/sync_engine.js +22 -9
  70. package/dist/modules/order/utils/math.d.ts +101 -29
  71. package/dist/modules/order/utils/math.js +215 -84
  72. package/dist/modules/order/utils/order.d.ts +58 -58
  73. package/dist/modules/order/utils/order.js +135 -106
  74. package/dist/modules/order/utils/system.d.ts +193 -6
  75. package/dist/modules/order/utils/system.js +394 -31
  76. package/dist/modules/order/utils/validate.d.ts +1 -1
  77. package/dist/modules/order/utils/validate.js +71 -59
  78. package/dist/modules/runtime_settings.d.ts +1 -1
  79. package/dist/modules/runtime_settings.js +3 -3
  80. package/dist/modules/types.d.ts +55 -4
  81. package/dist/scripts/analyze-credit.js +44 -27
  82. package/dist/scripts/analyze-orders.d.ts +1 -1
  83. package/dist/scripts/analyze-orders.js +4 -4
  84. package/dist/scripts/diagnose-pool-history.js +35 -30
  85. package/dist/scripts/divergence-calc.js +6 -6
  86. package/dist/scripts/pnl.js +1 -1
  87. package/dist/scripts/rich_list.d.ts +18 -0
  88. package/dist/scripts/rich_list.js +461 -0
  89. package/dist/scripts/run-tests.js +80 -4
  90. package/dist/scripts/validate_bots.d.ts +1 -1
  91. package/dist/scripts/validate_bots.js +3 -3
  92. package/dist/unlock.d.ts +2 -1
  93. package/dist/unlock.js +11 -5
  94. package/docs/COPY_ON_WRITE_MASTER_PLAN.md +1 -2
  95. package/docs/COW_INVARIANTS.md +12 -6
  96. package/docs/DEXBOT_COMPARISON.md +7 -7
  97. package/docs/EVOLUTION.md +10 -8
  98. package/docs/FUND_MOVEMENT_AND_ACCOUNTING.md +8 -6
  99. package/docs/GRID_PRICE_INVARIANT.md +3 -3
  100. package/docs/GRID_RECALCULATION.md +4 -1
  101. package/docs/GRID_RECONCILE.md +4 -4
  102. package/docs/LIFECYCLE.md +11 -11
  103. package/docs/LOGGING.md +30 -1
  104. package/docs/MPA_CREDIT_USAGE.md +11 -6
  105. package/docs/ORDER_ENGINE_POST_1.0_RETROSPECTIVE.md +170 -12
  106. package/docs/README.md +3 -3
  107. package/docs/WORKFLOW.md +1 -0
  108. package/docs/architecture.md +62 -8
  109. package/docs/developer_guide.md +12 -3
  110. package/market_adapter/README.md +4 -4
  111. package/modules/README.md +1 -1
  112. package/package.json +2 -1
  113. package/scripts/README.md +59 -32
  114. package/tests/README.md +12 -3
@@ -25,12 +25,6 @@ interface CredentialClientOptions {
25
25
  */
26
26
  onNodeFailed?: (nodeUrl: string) => void;
27
27
  }
28
- interface CredentialDaemonMeta {
29
- uncertainOnTimeout?: boolean;
30
- operations?: unknown[] | null;
31
- accountName?: string | null;
32
- batchId?: string | null;
33
- }
34
28
  export interface CredentialDaemonResponse {
35
29
  success?: boolean;
36
30
  error?: string;
@@ -45,14 +39,6 @@ export interface CredentialDaemonResponse {
45
39
  /** Node reported by the daemon as in play at the failure (typed replies). */
46
40
  nodeUrl?: string | null;
47
41
  }
48
- interface RequestPayload {
49
- type: string;
50
- accountName: string;
51
- operations: unknown[];
52
- sessionId?: string | null;
53
- hmac?: string;
54
- nodeUrl?: string;
55
- }
56
42
  declare const DEFAULT_SOCKET_PATH: string;
57
43
  declare const DEFAULT_READY_FILE: string;
58
44
  declare const DEFAULT_BROADCAST_TIMEOUT_MS: number;
@@ -80,9 +66,8 @@ declare class BroadcastUncertainError extends Error {
80
66
  timeoutMs: number | null;
81
67
  constructor(message: string, details?: BroadcastUncertainErrorDetails);
82
68
  }
83
- declare function sendCredentialDaemonRequest(socketPath: string, payload: RequestPayload, timeoutMs: number, meta?: CredentialDaemonMeta): Promise<CredentialDaemonResponse>;
84
69
  declare function isCredentialDaemonReady(options?: CredentialClientOptions): boolean;
85
70
  declare function waitForCredentialDaemon(timeoutMs?: number, options?: CredentialClientOptions): Promise<void>;
86
71
  declare function executeOperationsViaCredentialDaemon(accountName: string, operations: unknown[], options?: CredentialClientOptions): Promise<CredentialDaemonResponse>;
87
- export { DEFAULT_READY_FILE, DEFAULT_SOCKET_PATH, DEFAULT_BROADCAST_TIMEOUT_MS, sendCredentialDaemonRequest, executeOperationsViaCredentialDaemon, isCredentialDaemonReady, waitForCredentialDaemon, BroadcastUncertainError };
72
+ export { DEFAULT_READY_FILE, DEFAULT_SOCKET_PATH, DEFAULT_BROADCAST_TIMEOUT_MS, executeOperationsViaCredentialDaemon, isCredentialDaemonReady, waitForCredentialDaemon, BroadcastUncertainError };
88
73
  //# sourceMappingURL=dexbot_credential_client.d.ts.map
@@ -219,5 +219,5 @@ async function executeOperationsViaCredentialDaemon(accountName, operations, opt
219
219
  throw err;
220
220
  }
221
221
  }
222
- export { DEFAULT_READY_FILE, DEFAULT_SOCKET_PATH, DEFAULT_BROADCAST_TIMEOUT_MS, sendCredentialDaemonRequest, executeOperationsViaCredentialDaemon, isCredentialDaemonReady, waitForCredentialDaemon, BroadcastUncertainError };
222
+ export { DEFAULT_READY_FILE, DEFAULT_SOCKET_PATH, DEFAULT_BROADCAST_TIMEOUT_MS, executeOperationsViaCredentialDaemon, isCredentialDaemonReady, waitForCredentialDaemon, BroadcastUncertainError };
223
223
  //# sourceMappingURL=dexbot_credential_client.js.map
@@ -7,7 +7,7 @@ export interface FillOpLike {
7
7
  }
8
8
  type MissingKeyMessageFn = (op: FillOpLike, fill: unknown) => string;
9
9
  type FallbackKeyMessageFn = (op: FillOpLike, fill: unknown, fillKey: string) => string;
10
- export type ReplayMessageFn = (op: FillOpLike, fill: unknown, fillKey: string) => string;
10
+ type ReplayMessageFn = (op: FillOpLike, fill: unknown, fillKey: string) => string;
11
11
  type FillErrorFn = (op: FillOpLike, fill: unknown, err: unknown) => string;
12
12
  interface SweepOrphanFillOptions {
13
13
  context: string;
@@ -243,7 +243,7 @@ declare function scheduleFillConsumerRestart(bot: BotLike, chainOrders: ChainOrd
243
243
  * Level-triggered retry for fills parked by consumeFillQueue's pre-lock
244
244
  * gates (order-pipeline or broadcast deferral).
245
245
  *
246
- * Incident (2026-09-13, H-BTS slot-86): a lone fill deferred by an active
246
+ * Incident (2026-09-13, <bot> slot-86): a lone fill deferred by an active
247
247
  * broadcast never drained — the defer branches returned without
248
248
  * rescheduling, and none of the edge-triggered wake-ups came: the flag was
249
249
  * leaked (no region end would ever fire), no second fill arrived to trip
@@ -59,10 +59,7 @@ async function isUnknownFillOrderAdoptable(bot, fillOp) {
59
59
  // through to the credit path instead of deferring credit
60
60
  // to an adoption sync that must not adopt it.
61
61
  {
62
- const precision = parsed.type === ORDER_TYPES.SELL
63
- ? bot.manager?.assets?.assetA?.precision
64
- : bot.manager?.assets?.assetB?.precision;
65
- if (isChainPriceOutOfGrid(price, genesis, precision))
62
+ if (isChainPriceOutOfGrid(price, genesis, Number(parsed?.size) || 0, parsed?.type ?? null, bot.manager?.assets ?? null))
66
63
  return false;
67
64
  }
68
65
  const slotId = `slot-${idx}`;
@@ -331,7 +328,7 @@ async function applyReplaySafeTrackedFillAccounting(bot, fill, fillOp, options =
331
328
  */
332
329
  async function applyReplaySafeOrphanFillAccounting(bot, fill, fillOp, options = {}) {
333
330
  const { context, logger, replayMessage, persistenceMode } = resolveReplaySafeFillOptions(bot, options);
334
- return applyReplaySafeFillAccounting(bot, fill, fillOp, {
331
+ const result = await applyReplaySafeFillAccounting(bot, fill, fillOp, {
335
332
  logger,
336
333
  missingKeyMessage: (op) => `[${context}] Missing fill history id and orphan fallback key for ${op.order_id}; deferring to open-orders sync`,
337
334
  fallbackKeyMessage: (op) => `[${context}] Missing fill history id for orphan fill ${op.order_id}; using degraded orphan replay key for proceeds-only accounting`,
@@ -340,6 +337,17 @@ async function applyReplaySafeOrphanFillAccounting(bot, fill, fillOp, options =
340
337
  persistenceMode,
341
338
  allowOrphanFallbackKey: true
342
339
  });
340
+ // P2 observability: this wrapper is orphan-fill-only (processSweepOrphanFill),
341
+ // so an `applied` result is exactly one set of proceeds credited outside
342
+ // slot accounting. `duplicate`/`error`/`missing_key` are not credits and
343
+ // would make the metric useless as a "funds left the grid" signal.
344
+ try {
345
+ if (result?.status === 'applied' && bot?._metrics) {
346
+ bot._metrics.orphanFillCreditedCount = (bot._metrics.orphanFillCreditedCount || 0) + 1;
347
+ }
348
+ }
349
+ catch { /* metrics are best-effort */ }
350
+ return result;
343
351
  }
344
352
  /**
345
353
  * Create a fill callback handler for blockchain subscription events.
@@ -544,7 +552,7 @@ function scheduleFillConsumerRestart(bot, chainOrders) {
544
552
  * Level-triggered retry for fills parked by consumeFillQueue's pre-lock
545
553
  * gates (order-pipeline or broadcast deferral).
546
554
  *
547
- * Incident (2026-09-13, H-BTS slot-86): a lone fill deferred by an active
555
+ * Incident (2026-09-13, <bot> slot-86): a lone fill deferred by an active
548
556
  * broadcast never drained — the defer branches returned without
549
557
  * rescheduling, and none of the edge-triggered wake-ups came: the flag was
550
558
  * leaked (no region end would ever fire), no second fill arrived to trip
@@ -906,7 +914,7 @@ async function consumeFillQueue(bot, chainOrders) {
906
914
  resetFailureWatchdogIfSet();
907
915
  // Level-triggered retry: without this, a lone fill parked here
908
916
  // waits for a region end / second fill / maintenance tick that may
909
- // never come (2026-09-13 H-BTS slot-86).
917
+ // never come (2026-09-13 <bot> slot-86).
910
918
  scheduleDeferredFillRetry(bot, chainOrders, 'order pipeline active');
911
919
  return;
912
920
  }
@@ -922,7 +930,7 @@ async function consumeFillQueue(bot, chainOrders) {
922
930
  resetFailureWatchdogIfSet();
923
931
  // Level-triggered retry: without this, a lone fill parked here
924
932
  // waits for a region end / second fill / maintenance tick that may
925
- // never come (2026-09-13 H-BTS slot-86).
933
+ // never come (2026-09-13 <bot> slot-86).
926
934
  scheduleDeferredFillRetry(bot, chainOrders, 'broadcast active');
927
935
  return;
928
936
  }
@@ -12,32 +12,6 @@ interface HeldChainOrder {
12
12
  }
13
13
  import { usesAmaGridPrice } from './grid_price_source.js';
14
14
  declare const isWrapperAdapterOwner: (...args: unknown[]) => any;
15
- /**
16
- * Check if a bot configuration uses an AMA grid price source.
17
- *
18
- * Canonical implementation lives in ./grid_price_source.js (browser-safe,
19
- * shared with the market adapter service) — re-exported here so existing
20
- * Node-side consumers keep their import path.
21
- */
22
- /**
23
- * Find a bot entry in the bots config snapshot that matches a runtime config.
24
- * Matches by botKey or name.
25
- * @param {unknown} snapshot - Bots configuration snapshot
26
- * @param {Object} config - Runtime bot configuration
27
- * @returns {Object|null} Matched bot entry or null
28
- */
29
- declare function findSnapshotBotForRuntimeConfig(snapshot: {
30
- activeBots?: BotLike[];
31
- }, config: JsonObj): BotLike | null;
32
- /**
33
- * Check if a runtime bot configuration requires the market adapter.
34
- * @param {unknown} snapshot - Bots configuration snapshot
35
- * @param {Object} config - Runtime bot configuration
36
- * @returns {boolean} True if the bot uses AMA grid pricing
37
- */
38
- declare function runtimeConfigNeedsMarketAdapter(snapshot: {
39
- activeBots?: BotLike[];
40
- }, config: JsonObj): boolean;
41
15
  /**
42
16
  * Build the full-entry fingerprint for one bot (stable across key order and
43
17
  * comment/whitespace edits, since those never reach the parsed entry).
@@ -69,30 +43,30 @@ declare function buildBotConfigFingerprint(entry: unknown): string;
69
43
  */
70
44
  declare function checkAndApplyBotConfigChanges(bot: BotLike, context?: string, preloadedSnapshot?: JsonObj | null): Promise<unknown>;
71
45
  /**
72
- * Count live on-chain reserve orders for one side (issue #27 follow-up).
46
+ * Count live on-chain edge orders for one side (issue #27 follow-up).
73
47
  *
74
- * The window shortfall check above compares live window+reserves against
75
- * window+reserves, so a pre-existing window surplus masks a reserve deficit
76
- * (e.g. target 6+2=8 vs 12 live after reserveOrders 0→2: no shortfall, no
77
- * sync, zero reserve placements). Reserves get their own independent reason
78
- * below — the mirror of the masking case getTargetActiveOrders handles.
48
+ * The window shortfall check above compares live window+edges against
49
+ * window+edges, so a pre-existing window surplus masks an edge deficit
50
+ * (e.g. target 6+2=8 vs 12 live after edgeOrders 0→2: no shortfall, no
51
+ * sync, zero edge placements). Edge orders get their own independent reason
52
+ * below — the mirror of the masking case getTargetCoreOrders handles.
79
53
  *
80
- * Classification reuses the single source of truth (reserveEdgeIdSet +
81
- * resolveLiveReserveEdgeAnchorPrice, same anchor the placement pickers use)
54
+ * Classification reuses the single source of truth (edgeOrderIdSet +
55
+ * resolveLiveEdgeAnchorPrice, same anchor the placement pickers use)
82
56
  * over the full master grid, intersected with live ACTIVE/PARTIAL orderIds
83
57
  * (same live definition as countLiveGridOrders). The edge pick excludes the
84
58
  * window (liveWindowIdSet — the same exclusion every placement picker
85
59
  * applies): window + edge are additive in targets/fees/hold-back, but
86
60
  * without the exclusion a window that reaches the grid edge (keep-low
87
61
  * window = bottom slots = floor edge) makes the edge pick land on window
88
- * members and the count reads N/N with zero dedicated reserves, so the
62
+ * members and the count reads N/N with zero dedicated edge orders, so the
89
63
  * deficit never fires (issue #27 follow-up).
90
64
  * @param {unknown} manager - OrderManager
91
- * @param {unknown} config - Bot configuration (reserve count source)
65
+ * @param {unknown} config - Bot configuration (edge count source)
92
66
  * @param {unknown} type - ORDER_TYPES.BUY or ORDER_TYPES.SELL
93
- * @returns {number|null} Live reserve count, or null when unclassifiable
67
+ * @returns {number|null} Live edge count, or null when unclassifiable
94
68
  */
95
- declare function countLiveReserveOrders(manager: OrderManagerLike, config: JsonObj, type: unknown): number | null;
69
+ declare function countLiveEdgeOrders(manager: OrderManagerLike, config: JsonObj, type: unknown): number | null;
96
70
  /**
97
71
  * Mirror a spread-check stall into the flags the targeted-sync gate reads.
98
72
  *
@@ -126,11 +100,6 @@ declare function maybeRunTargetedDriftReconciliation(bot: BotLike, context: stri
126
100
  * @returns {unknown} Snapshot with exists flag, fingerprint, active bots list, and adapter requirement
127
101
  */
128
102
  declare function loadBotsConfigSnapshot(): any;
129
- /**
130
- * Stop and delete the market adapter process from PM2.
131
- * @returns {Promise<void>}
132
- */
133
- declare function stopMarketAdapterPm2(): Promise<void>;
134
103
  /**
135
104
  * Synchronize market adapter state based on periodic config checks.
136
105
  * Starts or stops the market adapter based on whether any active bot uses AMA grid pricing.
@@ -371,9 +340,11 @@ declare function executeMaintenanceLogic(bot: BotLike, context: string): Promise
371
340
  * @param {unknown} bot
372
341
  * @param {boolean} spreadChecked - Whether the spread check ran this tick
373
342
  * @param {number} ordersPlaced - Correction orders placed this tick
343
+ * @param {boolean} [transient=false] - True when the correction was refused for
344
+ * a retryable reason (stale plan / duplicate CREATE / unclassified non-execution)
374
345
  * @returns {{staleMs: number, escalated: boolean}}
375
346
  */
376
- export declare function trackOutOfSpreadStaleness(bot: BotLike, spreadChecked: boolean, ordersPlaced: number): {
347
+ export declare function trackOutOfSpreadStaleness(bot: BotLike, spreadChecked: boolean, ordersPlaced: number, transient?: boolean): {
377
348
  staleMs: number;
378
349
  escalated: boolean;
379
350
  };
@@ -412,22 +383,6 @@ declare function cancelDustOrders(bot: BotLike, { buy: buyDust, sell: sellDust }
412
383
  declare function runGridMaintenance(bot: BotLike, context?: string, options?: {
413
384
  skipIdle?: boolean;
414
385
  }): Promise<void>;
415
- /**
416
- * Check if the bot's BTS balance is below the minimum threshold and trigger acquisition.
417
- * Only applies to non-BTS pairs. Uses hysteresis: triggers at 1× min_BTS_value,
418
- * fills to BTS_ACQUIRE_TARGET_MULTIPLIER × min_BTS_value.
419
- * @param {import('./dexbot_class.js').DEXBot} bot
420
- * @returns {Promise<void>}
421
- */
422
- declare function checkBtsBalanceAndAcquire(bot: BotLike): Promise<void>;
423
- /**
424
- * Acquire BTS by swapping one of the trading pair assets through an AMM pool.
425
- * Tries both assets for a BTS pool, picks the best (lowest price impact).
426
- * @param {import('./dexbot_class.js').DEXBot} bot
427
- * @param {number} deficit - Amount of BTS needed (float)
428
- * @returns {Promise<void>}
429
- */
430
- declare function acquireBts(bot: BotLike, deficit: number): Promise<void>;
431
386
  /**
432
387
  * Run a single dust health check cycle.
433
388
  * @param {import('./dexbot_class.js').DEXBot} bot
@@ -498,6 +453,14 @@ declare function getMetrics(bot: BotLike): {
498
453
  maxQueueDepth: number;
499
454
  gridLockContention: number;
500
455
  fundRecalcCount: number;
456
+ refusedCommitCount: number;
457
+ orphanFillCreditedCount: number;
458
+ restampBuyAboveAnchorCount: number;
459
+ boundaryDriftExceedsWindowCount: number;
460
+ gapBandPlacementShadowCount: number;
461
+ spreadCorrectionRefusedCount: number;
462
+ spreadCorrectionRefusalCauses: Record<string, number>;
463
+ spreadCorrectionRetryCount: number;
501
464
  };
502
465
  /**
503
466
  * Read open orders from chain, sync with local state, and process any fills found.
@@ -522,15 +485,10 @@ declare function syncOpenOrdersAndProcessFills(bot: BotLike, tag: string): Promi
522
485
  hasUnmatched: number;
523
486
  openOrders: import("./types.js").ChainOrder[];
524
487
  }>;
525
- export { loadBotsConfigSnapshot, isWrapperAdapterOwner, checkAndApplyBotConfigChanges, buildBotConfigFingerprint, refreshDynamicWeightDistribution, performGridResync, updateBotGridResetMetadata, handlePendingTriggerReset, setupTriggerFileDetection, performPeriodicGridChecks, isOpenOrdersSyncLoopEnabled, startOpenOrdersSyncLoop, stopOpenOrdersSyncLoop, setupBlockchainFetchInterval, stopBlockchainFetchInterval, setupBotsConfigPollInterval, stopBotsConfigPollInterval, executeMaintenanceLogic, getTargetedSyncReason, maybeRunTargetedDriftReconciliation, countLiveReserveOrders, cancelDustOrders, isOrderDoesNotExistError, runGridMaintenance, releaseMarketAdapterRuntime, syncMarketAdapterOnPeriodicConfigCheck, usesAmaGridPrice, runDustHealthCheck, setupDustHealthCheckInterval, requestGridReset, wireStructuralGridResyncRequest, getPipelineSignals, markGridActivity, getMetrics, syncOpenOrdersAndProcessFills, shouldDeferMaintenanceForBroadcast, checkGridLockHoldDuration };
488
+ export { loadBotsConfigSnapshot, isWrapperAdapterOwner, checkAndApplyBotConfigChanges, buildBotConfigFingerprint, refreshDynamicWeightDistribution, performGridResync, updateBotGridResetMetadata, handlePendingTriggerReset, setupTriggerFileDetection, performPeriodicGridChecks, isOpenOrdersSyncLoopEnabled, startOpenOrdersSyncLoop, stopOpenOrdersSyncLoop, setupBlockchainFetchInterval, stopBlockchainFetchInterval, setupBotsConfigPollInterval, stopBotsConfigPollInterval, executeMaintenanceLogic, getTargetedSyncReason, maybeRunTargetedDriftReconciliation, countLiveEdgeOrders, cancelDustOrders, isOrderDoesNotExistError, runGridMaintenance, releaseMarketAdapterRuntime, syncMarketAdapterOnPeriodicConfigCheck, usesAmaGridPrice, runDustHealthCheck, setupDustHealthCheckInterval, requestGridReset, wireStructuralGridResyncRequest, getPipelineSignals, markGridActivity, getMetrics, syncOpenOrdersAndProcessFills, shouldDeferMaintenanceForBroadcast, checkGridLockHoldDuration };
526
489
  declare const _default: {
527
- loadBotsConfigSnapshot: typeof loadBotsConfigSnapshot;
528
- isWrapperAdapterOwner: (...args: unknown[]) => any;
529
- checkAndApplyBotConfigChanges: typeof checkAndApplyBotConfigChanges;
530
- buildBotConfigFingerprint: typeof buildBotConfigFingerprint;
531
490
  refreshDynamicWeightDistribution: typeof refreshDynamicWeightDistribution;
532
491
  performGridResync: typeof performGridResync;
533
- updateBotGridResetMetadata: typeof updateBotGridResetMetadata;
534
492
  handlePendingTriggerReset: typeof handlePendingTriggerReset;
535
493
  setupTriggerFileDetection: typeof setupTriggerFileDetection;
536
494
  performPeriodicGridChecks: typeof performPeriodicGridChecks;
@@ -542,22 +500,9 @@ declare const _default: {
542
500
  setupBotsConfigPollInterval: typeof setupBotsConfigPollInterval;
543
501
  stopBotsConfigPollInterval: typeof stopBotsConfigPollInterval;
544
502
  executeMaintenanceLogic: typeof executeMaintenanceLogic;
545
- getTargetedSyncReason: typeof getTargetedSyncReason;
546
- mirrorSpreadStall: typeof mirrorSpreadStall;
547
- countLiveReserveOrders: typeof countLiveReserveOrders;
548
- maybeRunTargetedDriftReconciliation: typeof maybeRunTargetedDriftReconciliation;
549
503
  cancelDustOrders: typeof cancelDustOrders;
550
- isOrderDoesNotExistError: typeof isOrderDoesNotExistError;
551
504
  runGridMaintenance: typeof runGridMaintenance;
552
- trackOutOfSpreadStaleness: typeof trackOutOfSpreadStaleness;
553
- stopMarketAdapterPm2: typeof stopMarketAdapterPm2;
554
505
  releaseMarketAdapterRuntime: typeof releaseMarketAdapterRuntime;
555
- syncMarketAdapterOnPeriodicConfigCheck: typeof syncMarketAdapterOnPeriodicConfigCheck;
556
- findSnapshotBotForRuntimeConfig: typeof findSnapshotBotForRuntimeConfig;
557
- runtimeConfigNeedsMarketAdapter: typeof runtimeConfigNeedsMarketAdapter;
558
- usesAmaGridPrice: typeof usesAmaGridPrice;
559
- checkBtsBalanceAndAcquire: typeof checkBtsBalanceAndAcquire;
560
- acquireBts: typeof acquireBts;
561
506
  runDustHealthCheck: typeof runDustHealthCheck;
562
507
  setupDustHealthCheckInterval: typeof setupDustHealthCheckInterval;
563
508
  requestGridReset: typeof requestGridReset;
@@ -566,8 +511,6 @@ declare const _default: {
566
511
  markGridActivity: typeof markGridActivity;
567
512
  getMetrics: typeof getMetrics;
568
513
  syncOpenOrdersAndProcessFills: typeof syncOpenOrdersAndProcessFills;
569
- shouldDeferMaintenanceForBroadcast: typeof shouldDeferMaintenanceForBroadcast;
570
- checkGridLockHoldDuration: typeof checkGridLockHoldDuration;
571
514
  _internalDeferredHold: {
572
515
  logDeferredHoldSummary: typeof logDeferredHoldSummary;
573
516
  describeDeferredHolds: typeof describeDeferredHolds;