| User |
App user authenticated via Keycloak |
Keycloak JWT — maps to CrewMember-style model |
| Credential |
Stores Kalshi API key ID and encrypted RSA private key |
Encrypted at rest, validated on save via test API call |
| Strategy |
Polymorphic strategy definition (watchdog, stacking) |
strategy_type + jsonb parameters for flexibility |
| WatchdogConfig |
Threshold configuration for watchdog strategy |
Buy at 85%, take profit at 95%, cut loss at 80% |
| SizingConfig |
YES/NO allocation ratios for Option D sizing |
Default: 83% YES / 17% NO |
| Portfolio |
A set of trades for a single trading day |
Same-day-only constraint enforced at model level |
| Trade |
Individual buy/sell order placed on Kalshi |
Tracks kalshi_order_id for reconciliation |
| Market |
Cached Kalshi market data |
Refreshed by MarketScan jobs, TTL-based cache |
| MarketScan |
Audit log of each market polling cycle |
Tracks markets found and above-threshold count |