export declare function setStateFilePath(path: string): void; export declare function resetStateFilePath(): void; export interface ArbPositionState { id: string; symbol: string; longExchange: string; shortExchange: string; longSize: number; shortSize: number; entryTime: string; entrySpread: number; entryLongPrice: number; entryShortPrice: number; accumulatedFunding: number; lastCheckTime: string; /** "perp-perp" (default) or "spot-perp" */ mode?: "perp-perp" | "spot-perp"; /** Spot leg exchange name (for spot-perp mode) */ spotExchange?: string; /** Spot symbol, e.g. "ETH/USDC" (for spot-perp mode) */ spotSymbol?: string; } export interface ArbDaemonState { version: 1; lastStartTime: string; lastScanTime: string; lastSuccessfulScanTime: string; positions: ArbPositionState[]; config: { minSpread: number; closeSpread: number; size: number | "auto"; holdDays: number; bridgeCost: number; maxPositions: number; settleStrategy: string; notifyUrl?: string; }; } /** Load daemon state from disk. Falls back to .tmp if main file is corrupted. */ export declare function loadArbState(): ArbDaemonState | null; /** * Save daemon state to disk using atomic write pattern. * Writes to .tmp first, then renames to main file. * If crash occurs mid-write, .tmp is partial but main file is intact. */ export declare function saveArbState(state: ArbDaemonState): void; /** Add a position to the persisted state. Auto-initializes state if missing. */ export declare function addPosition(pos: ArbPositionState): void; /** Remove a position by symbol from the persisted state. */ export declare function removePosition(symbol: string): void; /** Update a position by symbol with partial updates. */ export declare function updatePosition(symbol: string, updates: Partial): void; /** Get all persisted positions. */ export declare function getPositions(): ArbPositionState[]; /** Create a default empty daemon state with the given config. */ export declare function createInitialState(config: ArbDaemonState["config"]): ArbDaemonState;