/** * Single-interval price monitor: batch prices per dex, reconcile, process positions in parallel. */ import type { SenpiClient } from "../../senpi/client.js"; import type { SenpiEventBus } from "../events/index.js"; import type { StrategyState } from "../../types/strategy.js"; import type { StateManager } from "../../state/index.js"; import type { IdentityEnvelope } from "../../telemetry/identity.js"; import type { PositionOpenedEvent } from "../../types/dsl/index.js"; export interface PriceMonitorOptions { stateManager: StateManager; /** Used only for getMarketPrices in the monitor tick (not for reconcile or position I/O). */ senpiClient: SenpiClient; bus: SenpiEventBus; baseDir: string; strategyStates: Map; isSlPlacementInProgress?: (key: string) => boolean; /** Order type for DSL-triggered closes (default: MARKET). */ closeOrderType?: import("../../senpi/types.js").CloseOrderType; /** Options for FEE_OPTIMIZED_LIMIT close orders. */ feeOptimizedLimitOptions?: import("../../senpi/types.js").FeeOptimizedLimitOptions; /** * When provided, the monitor runs the UNIFIED reconcile (adopt orphans + resize drift + * archive gone) via runReconcile, instead of the legacy archive-only reconcileStateWithBackend. * Adopter routes through the DSL plugin (honors placeSlOnAdopt). When omitted, falls back to * archive-only (backward-compatible for callers that don't wire it). */ reconcileAdopter?: { adoptPosition(p: PositionOpenedEvent, opts?: { tickId?: string; }): Promise; resizePosition(p: PositionOpenedEvent, opts?: { tickId?: string; }): Promise; }; /** Serializes the reconcile execute-pass vs the trade loop / boot reconcile (reconcileMutex). */ reconcileSerialize?: (fn: () => Promise) => Promise; /** Called on a successful periodic reconcile to resolve the boot trade-gate if still closed. */ reconcileGateResolve?: () => void; /** Lazy runtime identity builder; used to stamp per-trace identity at the dsl.tick seam. */ identity?: () => IdentityEnvelope; } export declare function getAddressesWithUnavailableClearinghouseState(entries: Array<{ addr: string; result: unknown; }>): string[]; export declare function createPriceMonitor(options: PriceMonitorOptions): { tick: () => Promise; }; //# sourceMappingURL=create-monitor.d.ts.map