Runtime State Persistence (src/fyers_store/state/)
Runtime state persistence provides crash-safe recovery for order/trade/position state. This state DB is intentionally separate from the historical bars cache.
flowchart TD
BROKER["FyersBroker"]
STATE["SQLiteStateStore<br/>(state/)"]
DB["SQLite state DB<br/>(config/state.yaml)"]
FAIL_SCHEMA["schema mismatch<br/>reset required"]
BROKER -->|"save/load/clear"| STATE
STATE --> DB
DB -.version mismatch.-> FAIL_SCHEMA