Premium finance is the finance-variant layer that ports the reusable stock-analysis product surface from ../daily_stock_analysis into World Monitor without importing that repo's full standalone app architecture.
This layer is intentionally split into:
core premium financeextra enrichment layers
The core layer is the part required for the premium feature to work. Extra layers improve output quality or efficiency but are not the source of truth.
The current premium finance scope includes:
- premium stock analysis
- shared analysis history
- stored backtest summaries
- scheduled daily market brief generation
- finance-variant premium panels
- Redis-backed shared backend persistence for analysis history and backtests
It does not attempt full parity with the source repo's:
- standalone web app
- relational database model
- notification system
- agent/chat workflows
- bot integrations
- image ticker extraction
- China-specific provider mesh
- Finance premium panels load through the normal app shell and panel loader.
- Premium stock RPCs are called through
MarketService. - Premium endpoints require
WORLDMONITOR_API_KEYserver-side, not just a locked UI. - Results are persisted into Redis-backed shared storage.
- Panels prefer stored shared results before recomputing fresh analyses or backtests.
Primary handlers:
- analyze-stock.ts
- get-stock-analysis-history.ts
- backtest-stock.ts
- list-stored-stock-backtests.ts
- premium-stock-store.ts
Primary contracts:
- analyze_stock.proto
- get_stock_analysis_history.proto
- backtest_stock.proto
- list_stored_stock_backtests.proto
- service.proto
Panels:
Services and loading:
The premium stock-analysis engine is a TypeScript port of the reusable core logic from the source repo, adapted to World Monitor conventions.
It computes:
- moving-average stack and trend state
- bias versus short and medium moving averages
- volume pattern scoring
- MACD state
- RSI state
- bullish and risk factors
- composite signal and signal score
- AI overlay using the shared LLM chain when configured
Each stored analysis record includes stable replay fields so the record can be reused later:
analysisIdanalysisAtsignalcurrentPricestopLosstakeProfitengineVersion
Those fields matter because backtesting now validates stored analysis records rather than re-deriving a different strategy view later.
World Monitor still lacks a general-purpose relational backend, so premium finance currently uses Redis as the backend-owned source of truth.
- latest shared stock-analysis snapshots
- per-symbol analysis history index
- historical analysis ledger used by backtesting
- stored backtest summary snapshots
Earlier iterations stored history locally per device and recomputed backtests on demand. The hardened version promotes those artifacts into the backend layer so:
- multiple users can share the same analysis results
- multiple users can share the same backtest summaries
- browser or desktop cache is no longer the canonical history
Redis is used as:
- shared product memory
- cache-backed persistence
- the current source of truth for premium finance artifacts
It is not a relational finance ledger yet. Long-lived querying, rich pagination, and full auditability would still be better served by a future database layer.
Backtesting in World Monitor is intentionally tied to stored analysis records, not just a raw signal replay.
Current flow:
- Build or refresh a historical stored analysis ledger from Yahoo daily bars.
- Persist those records with stable IDs and timestamps.
- Evaluate forward performance from each stored record's saved signal and target levels.
- Store the resulting backtest summary in Redis for shared reuse.
This makes the feature closer to "validate prior premium analyses" than "rerun whatever the latest strategy code happens to do."
The daily market brief is a premium finance panel layered on top of the project's existing market and news infrastructure.
It:
- builds once per local day
- uses the tracked watchlist and available market/news context
- caches the brief
- avoids unnecessary regeneration before the next local morning schedule
This is a World Monitor adaptation, not a port of the source repo's full scheduler/automation system.
Premium finance endpoints are enforced server-side.
Premium RPC paths are gated in:
This matters because a UI-only lock would still allow direct API usage from trusted browser origins.
Core premium finance currently depends on:
- Yahoo Finance chart/history endpoints
- Finnhub for broader market data already used elsewhere in World Monitor
- Google News RSS as the baseline stock-news fallback
- the shared LLM provider chain in llm.ts
The provider-backed targeted stock-news layer is documented separately in PREMIUM_FINANCE_SEARCH.md.
There are three distinct cache or persistence behaviors in play:
- Redis shared storage for premium analysis history and backtests
- Redis response caching for expensive server recomputation
- client-side cache only as a rendering/performance layer
The data loader refreshes stale symbols individually rather than recomputing the whole watchlist when only one symbol is missing or stale.
The core layer is:
- analysis engine
- stored history
- stored backtests
- premium auth
- premium UI panels
- daily brief
The search-backed stock-news layer is intentionally separate because it improves analysis quality but is not required for the feature to function. If all search providers are unavailable, premium stock analysis still works using Google News RSS fallback.
See PREMIUM_FINANCE_SEARCH.md.
This feature is valid and production-usable within World Monitor's current architecture, but some boundaries remain explicit:
- Redis is the canonical store for now
- there is no standalone finance database
- there is no agent/chat or notifications integration yet
- the source repo's broader provider stack was not fully ported
- China-focused market data/search layers were intentionally excluded
That tradeoff keeps the feature aligned with World Monitor rather than contaminating the repo with a second backend architecture.