/** * Tracks strategies the backend has rejected as not-ACTIVE (paused/closed) so * the runtime stops firing orders at them instead of re-submitting on every * signal (the 2026-07 create_position storm: thousands of rejections against a * PAUSED strategy over days). * * Entries expire after a recheck TTL so a strategy the user resumes recovers * without a runtime restart: the next signal after expiry probes the backend * again and either succeeds (clearing the pause) or re-arms it for another * window. The default is deliberately short — while paused every signal is * skipped and nothing can call clear(), so the TTL bounds BOTH the storm rate * (~1 rejected probe per window) AND how long trading stays blocked after the * user resumes the strategy on Senpi. */ export interface BackendPauseRegistry { /** Record a backend not-active rejection for this strategy. Refreshes the TTL. */ markPaused(address: string, reason: string): void; /** True while the strategy is considered paused by the backend. */ isPaused(address: string): boolean; /** * Whether the user should be alerted about this pause now. True once per * pause episode (and again after the notify cooldown while it persists) — * NOT on every TTL re-arm, which happens every few minutes while paused. * Marks the notification as sent when returning true. */ shouldNotifyPause(address: string): boolean; /** Remove the pause immediately (e.g. an order later succeeded). Ends the episode. */ clear(address: string): void; } export interface BackendPauseRegistryOptions { /** How long a pause entry lasts before the runtime probes again. Default 5 minutes. */ ttlMs?: number; /** Minimum gap between pause alerts for the same ongoing episode. Default 6 hours. */ notifyCooldownMs?: number; now?: () => number; } export declare function createBackendPauseRegistry(options?: BackendPauseRegistryOptions): BackendPauseRegistry; //# sourceMappingURL=backend-pause-registry.d.ts.map