Data Flow: Prediction Assistant

arch-dataflow-prediction-assistant Architecture

architecture active

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
  • arch-domain-kalshi-assistant — entity definitions referenced in flows
  • arch-deployment-kalshi-assistant — where these services run
  • project-kalshi-assistant — parent project page