Persistent state over process memory
Recorded position data and database transactions provide a clearer recovery path than keeping critical state only in a running process.
Engineering project
A trading-system refactor centred on persistent position state, real-time Bybit data, webhook signal handling, and a React operational dashboard.

Implementation scope
The refactor replaced in-memory position handling with PostgreSQL-backed state so active positions and protective order details could survive a process restart and be reviewed through a more reliable operational model.
The backend uses FastAPI services for authentication, settings, signal intake, and position handling. A dedicated WebSocket client consumes market and private execution updates, while the exchange REST API supports order actions.
The front end was reorganized around React, TypeScript, Zustand, TanStack Query, and a component system for settings, state visibility, and dashboard updates.
Engineering choices
Recorded position data and database transactions provide a clearer recovery path than keeping critical state only in a running process.
Public market and private account or execution streams are handled as explicit sources for different parts of the trading workflow.
Clear API and WebSocket message boundaries make dashboard updates and trading-service responsibilities easier to maintain.
Current boundaries