Data Flow: Prediction Assistant
Data Flow: Kalshi Assistant
Diagram
Flow 1: Watchdog Scan
Flow 2: Position Monitor
Flow 3: User Auth
Components
| Component | Purpose | Notes |
|---|---|---|
| Solid Queue | Background job runner for scan and monitor loops | Rails 8 built-in, no Redis dependency |
| Rails App | Core application logic, API layer, strategy engine | Port 3000, Rails 8 |
| PostgreSQL | Primary data store for all entities | Shared CNPG cluster, 4 databases |
| Kalshi API | External market data and trade execution | RSA-PSS SHA-256 auth, rate-limited |
| Keycloak | Identity provider, SSO | Auth Code + PKCE, same pattern as landscaping-assistant |
| iOS App | Turbo Native shell for mobile access | ASWebAuthenticationSession for login |
Key Decisions
- Solid Queue over Sidekiq — eliminates Redis dependency, sufficient for polling frequency
- RSA-PSS signature computed per request — Kalshi requires timestamp + method + path signed with private key
- Market data cached in PostgreSQL not Redis — simpler ops, query-friendly for strategy evaluation
- Auth Code + PKCE flow — matches landscaping-assistant pattern, works with iOS
Related
arch-domain-kalshi-assistant— entity definitions referenced in flowsarch-deployment-kalshi-assistant— where these services runproject-kalshi-assistant— parent project page