--- title: docs/interface/ISessionInstance group: docs --- # ISessionInstance Interface for session instance implementations. Defines the contract for local, persist, and dummy backends. Intended use: per-(symbol, strategy, exchange, frame) mutable session data shared across strategy callbacks within a single run — e.g. caching LLM inference results, intermediate indicator state, or cross-candle accumulators. Example shape: ```ts { lastLlmSignal: "buy" | "sell" | null; confirmedAt: number } ``` ## Methods ### waitForInit ```ts waitForInit: (initial: boolean) => Promise ``` Initialize the session instance. ### setData ```ts setData: (value: Value, when: Date) => Promise ``` Write a new session value. ### getData ```ts getData: (when: Date) => Promise ``` Read the current session value. Returns null when the stored `when` is greater than the requested `when` (look-ahead bias protection). ### dispose ```ts dispose: () => Promise ``` Releases any resources held by this instance.