/** * Centralized constants for the DSL feature. */ export declare const COMPONENT_TYPE_EXIT_DSL: "exit/dsl"; /** DSL subscribes to the same hook event names as HookSystem.fire (position tracker, open/close actions). */ export declare const EVENTS: { readonly POSITION_OPENED: "on_position_opened"; readonly POSITION_CLOSED: "on_position_closed"; readonly POSITION_FLIPPED: "on_position_flipped"; readonly POSITION_INCREASED: "on_position_increased"; readonly POSITION_DECREASED: "on_position_decreased"; }; export declare const DSL_EVENTS: { readonly CREATED: "dsl.created"; readonly PHASE_CHANGED: "dsl.phase_changed"; readonly TIER_ADVANCED: "dsl.tier_advanced"; readonly SL_UPDATED: "dsl.sl_updated"; readonly CLOSED: "dsl.closed"; readonly CLOSE_PENDING: "dsl.close_pending"; readonly SETTINGS_UPDATED: "dsl.settings_updated"; readonly DELETED: "dsl.deleted"; /** Periodic open-position status (monitor emits when interval + suppression rules pass). */ readonly HEARTBEAT: "dsl.heartbeat"; }; /** No heartbeat in the first hour after open. */ export declare const DSL_HEARTBEAT_FIRST_HOUR_MS: number; /** Minimum interval between heartbeat notifications (also first heartbeat after open). */ export declare const DSL_HEARTBEAT_INTERVAL_MS: number; /** Suppress heartbeat if a tier-advanced notification fired within this window. */ export declare const DSL_HEARTBEAT_TIER_SUPPRESS_MS: number; export declare const DEFAULT_STATE_DIR = ".dsl-state"; /** On-disk DSL state schema version (v1 = DSL engine v2; no migration from older files). */ export declare const DSL_STATE_VERSION = 1; /** * Recipe YAML uses a single `exit.dsl_preset` object; after parse it becomes this key in * DslPluginConfig.presets. position.opened may set preset to override (must match this name). */ export declare const CANONICAL_DSL_PRESET_NAME = "default"; /** Validation / parse error paths for the lone recipe preset. */ export declare const EXIT_DSL_PRESET_PATH = "exit.dsl_preset"; /** Close reasons for DSL state (closeReason) and position.closed (reason). */ export declare const CLOSE_REASON: { readonly MANUAL_CLOSE: "manual_close"; readonly CLOSED_EXTERNALLY: "closed_externally"; readonly EXCHANGE_SL_HIT: "exchange_sl_hit"; readonly DSL_BREACH: "dsl_breach"; readonly FLIPPED: "flipped"; readonly CLOSE_POSITION_FAILED: "close_position_failed"; readonly HARD_TIMEOUT: "hard_timeout"; readonly WEAK_PEAK_CUT: "weak_peak_cut"; readonly DEAD_WEIGHT_CUT: "dead_weight_cut"; readonly POSITION_INCREASED: "position_increased"; readonly POSITION_DECREASED: "position_decreased"; readonly DSL_DELETED: "dsl_deleted"; /** Reconcile resize: stale adopted state replaced by a fresh adopt for the same position. */ readonly RECONCILE_RESIZE: "reconcile_resize"; }; export type CloseReason = (typeof CLOSE_REASON)[keyof typeof CLOSE_REASON]; export declare const MIN_INTERVAL_SECONDS = 5; /** Upper bound for `exit.interval_seconds` (validation spec). */ export declare const MAX_INTERVAL_SECONDS = 3600; export declare const DEFAULT_INTERVAL_MS = 30000; export declare const MAX_CONSECUTIVE_CLOSE_FAILURES = 3; /** Log a warning when price is missing for this many consecutive monitor ticks. */ export declare const DSL_PRICE_FETCH_FAILURE_WARN_THRESHOLD = 5; /** Number of retries for DSL SenpiClient calls (total attempts = retries + 1). */ export declare const DSL_EXTERNAL_RETRIES = 2; /** Delay in ms between retries for DSL SenpiClient calls. */ export declare const DSL_EXTERNAL_RETRY_DELAY_MS = 500; /** * Read timeout for the handoff's live-SL lookup, well under the 45s default for reads. * * The lookup runs inside the strictly serial monitor tick, so its worst case blocks every * other position too: at the default, three attempts cost ~136s (3 × 45s + 2 × 500ms) before * the runtime places its own stop. At 10s that is ~21s. * * The retries stay. A failed lookup answers "not live", which is not free: the handoff stays * pending and the runtime syncs its own stop over the backend's, leaving the backend row * pointing at an order it no longer owns — the stale-oid state dsl-engine #16 exists to * repair. A transient flake must not trigger that, so the bound goes on the call, not on the * retries. 10s matches the backend's own bound on the same lookup * (`evaluate.sl_order_check_timeout`). */ export declare const DSL_HANDOFF_SL_STATUS_TIMEOUT_MS = 10000; export declare const MCP_TOOL_PREFIX = "senpi."; export declare const PRICE_DECIMALS = 4; //# sourceMappingURL=index.d.ts.map