Interface IPersistStrategyInstance

Per-context deferred strategy state persistence instance interface. Scoped to a specific (symbol, strategyName, exchangeName) triple.

Custom adapters should implement this interface to override the default file-based deferred strategy state persistence behavior.

interface IPersistStrategyInstance {
    readStrategyData(): Promise<StrategyData>;
    waitForInit(initial: boolean): Promise<void>;
    writeStrategyData(row: StrategyData): Promise<void>;
}

Implemented by

Methods

  • Read persisted deferred strategy state for this context.

    Returns Promise<StrategyData>

    Promise resolving to strategy state snapshot or null if none persisted

  • Initialize storage for this strategy state context.

    Parameters

    • initial: boolean

      Whether this is the first initialization

    Returns Promise<void>

    Promise that resolves when initialization is complete

  • Write deferred strategy state for this context (null to clear).

    Parameters

    • row: StrategyData

      Strategy state snapshot to persist, or null to clear

    Returns Promise<void>

    Promise that resolves when write is complete