CryptoAI Pro is a self-hosted market analysis platform for crypto and stocks. It is an analysis tool only: it never places trades and is not financial advice.
Stack: Next.js 15 (App Router), MongoDB as a replica set, NextAuth v5, socket.io, and a native SwiftUI iOS app. Three processes share the database: the web app, a realtime sidecar and a background worker.
Decisions that mattered
- Binance, CoinGecko, Finnhub and Yahoo sit behind provider adapters with circuit breakers. The worker rolls 1-minute candles into 5-minute, hourly and daily ones and backfills history.
- The AI returns versioned, structured JSON (sentiment, confidence, drivers, risks, levels) so the chart can draw it. Results are cached longer when an asset is calm, shorter when volatile, identical requests are de-duplicated and watched assets are pre-warmed.
- The alert engine subscribes to the market bus and evaluates conditions as prices arrive, with cooldowns.
- Every server action passes session, permission, rate limit, validation and audit in one wrapper.
Limits: the public demo runs on simulated market data, and without an AI key a deterministic mock answers.
Trade-off we chose: cache lifetimes depend on how volatile an asset is, a heuristic we would like feedback on.
How do you cache AI output for fast-moving data? Feedback welcome.