diff --git a/DEV_LOG.md b/DEV_LOG.md index 56ebb9b..95ff58a 100644 --- a/DEV_LOG.md +++ b/DEV_LOG.md @@ -157,3 +157,28 @@ This document tracks all modifications, npm packages, active compilation states, ### Active Bugs / Compile Status * **Active Bugs**: None. * **Type Checker Status**: Verified clean compilation (`npx tsc --noEmit` returns exit code 0). + +--- + +## [2026-06-13] - Launch Native KaTeX Rig & Comprehensive Dual-Handbook Architecture (#ISSUE-016) + +### Added +* **8 new Operational Blueprint Modals**: Authored and mounted operational guide modals explaining user interface interactions, mock data updates, and loop logics for: + * `CryptoBlueprintModal.tsx` (Crypto Bayes expected values e.g. "62/14" and "E: 85.5%") + * `ScannerBlueprintModal.tsx` (Anomalies Scanner search masks) + * `SandboxBlueprintModal.tsx` (Portfolio Sandbox transaction ledger) + * `WhaleBlueprintModal.tsx` (Whale Satellites 13F lag warnings) + * `InsiderBlueprintModal.tsx` (Insider Activity Form 4 codes) + * `MacroBlueprintModal.tsx` (Macro FRED indicators and credit metrics) + * `EconometricsBlueprintModal.tsx` (Event studies estimation parameters) + * `TechBlueprintModal.tsx` (Tech CapEx monitor Sloan quality filters) + +### Modified +* **8 Dashboard UI Modules Refactored**: Upgraded `CryptoDemo.tsx`, `ScannerDemo.tsx`, `SandboxDemo.tsx`, `WhaleScreener.tsx`, `InsiderDemo.tsx`, `MacroIndicatorsDemo.tsx`, `EventsDemo.tsx`, and `AiSpecialSilo.tsx` to feature the new side-by-side header buttons `📖 Quantitative Handbook` and `⚙️ Operational Blueprint`. +* **Native KaTeX Migration**: Migrated all math modals to wrap formulas strictly in native `` and `` component calls from `react-katex` with clean, single-escaped backslashes, eliminating parsing corruption. +* **Tailwind Typo Purge**: Cleaned up and deleted all occurrences of the non-existent `bg-slate-955` color class, replacing it with the correct `bg-slate-950` or `bg-slate-900` glassmorphic tokens. +* **`QUANT_ROADMAP.md`**: Updated the Milestones log to document Phase 5.0. + +### Active Bugs / Compile Status +* **Active Bugs**: None. +* **Type Checker Status**: Verified 100% clean compilation (`npx tsc --noEmit` returns exit code 0). diff --git a/QUANT_ROADMAP.md b/QUANT_ROADMAP.md index 184e41c..046755f 100644 --- a/QUANT_ROADMAP.md +++ b/QUANT_ROADMAP.md @@ -23,6 +23,9 @@ This document serves as the permanent, centralized system architecture design an * **Phase 4.7: AI & Tech Hyper-Leverage Silo** * *Features*: Track the AI CapEx-Overinvestment Cycle for NVDA, MSFT, GOOGL, META, and AMD. Calculates ROI-to-CapEx (Monetization Gap), Nvidia Supply-Chain Velocity Index, and Tech Infrastructure Leverage with a 60-minute caching layer. * *Status*: **Fully Operational (Production Lock)**. +* **Phase 5.0: Native KaTeX Rig & Dual-Handbook System** + * *Features*: Refactored all 8 sandbox modules to feature a unified twin-modal header layout (`📖 Quantitative Handbook` and `⚙️ Operational Blueprint`). Replaced all inline string-escaped LaTeX with native React `react-katex` calls to completely eliminate escaping anomalies. Authored 8 new functional operational blueprints explaining scanner, whale, and math mechanics. + * *Status*: **Fully Operational (Production Lock)**. --- diff --git a/components/modules/crypto/CryptoBlueprintModal.tsx b/components/modules/crypto/CryptoBlueprintModal.tsx new file mode 100644 index 0000000..a830f0e --- /dev/null +++ b/components/modules/crypto/CryptoBlueprintModal.tsx @@ -0,0 +1,130 @@ +import React from 'react'; +import { Settings, X } from 'lucide-react'; + +interface CryptoBlueprintModalProps { + isOpen: boolean; + onClose: () => void; +} + +export default function CryptoBlueprintModal({ isOpen, onClose }: CryptoBlueprintModalProps) { + React.useEffect(() => { + const handleKeyDown = (e: KeyboardEvent) => { + if (e.key === 'Escape') { + onClose(); + } + }; + if (isOpen) { + window.addEventListener('keydown', handleKeyDown); + } + return () => { + window.removeEventListener('keydown', handleKeyDown); + }; + }, [isOpen, onClose]); + + if (!isOpen) return null; + + return ( +
+
+ + {/* Modal Header */} +
+
+

+ Crypto Bayes Module - Operational Blueprint +

+

System User Manual & Interface Mechanics

+
+ +
+ + {/* Modal Body */} +
+ +
+

System Inputs & Signals

+

Operational breakdown of key indicators used by the multi-model pipeline.

+
+ + {/* Core Indicators */} +
+
+

1. Funding Rates (Leverage Skew)

+

+ Reflects periodic payments exchanged between long and short traders. Extremely positive funding rates signal retail over-leverage and high risk of long liquidation squeezes (bearish indicators). Negative rates signal retail panic and potential short squeezes (bullish indicators). +

+
+ +
+

2. Open Interest Change (Capital Velocity)

+

+ Measures the net speed at which new contracts are being opened or closed. A sharp increase in Open Interest accompanied by price moves confirms a strong momentum transition, indicating institutional volume entry. +

+
+ +
+

3. Retail Skew (Contrarian Filter)

+

+ Calculates the proportion of long contracts held by retail accounts. The system operates under a contrarian framework: when retail long positioning is at extreme bullishness (e.g. Retail Skew > 1.50), the system dampens bullish forecast probabilities. +

+
+ +
+

4. Whale Inflows (Accumulation Vectors)

+

+ Tracks large volume transactions moving from spot exchanges to private cold storage. Accumulation inflows decrease available supply on exchanges, establishing a spot-supply mismatch that supports upward spot pricing pressure. +

+
+
+ + {/* Interface Legend */} +
+

Interface Layout & Metrics Legend

+
+
+
+ Expected Value (E: %) +

+ Calculated as the Posterior Expected Value E = alpha / (alpha + beta) based on successes (alpha) and failures (beta). A value of e.g. **E: 85.5%** suggests that the estimator-horizon combination is highly calibrated. +

+
+
+ Raw Trackers ("62/14") +

+ Represents the absolute counts of success and failure outcomes: **62** successfully resolved direction predictions (alpha) and **14** false alarms or incorrect directional forecasts (beta). +

+
+
+ Horizon Forecasts +

+ Displays direction (▲ UP / ▼ DOWN) and probability forecast for BTC, ETH, or SOL at horizons T+1 (24h), T+5 (5d), and T+10 (10d). +

+
+
+
+
+ + {/* Operational Dynamics */} +
+

Simulator & Ingestion Loops

+
+

+ Posterior Calibration Simulator: Clicking **"+1 Success (All)"** or **"+1 False Alarm (All)"** simulates model feedback loops. It increments the success or failure count across all 15 independent trackers, storing updated states immediately in `localStorage` to evaluate how expected accuracies drift when models perform well or poorly. +

+

+ Background Evaluation Loop: When a user logs a manual forecast, the app registers predictions for all 15 trackers. In dev mode, the targets resolve quickly: T+1 in 60 seconds, T+5 in 5 minutes, and T+10 in 10 minutes. A background worker queries `/api/finance?region=crypto` to resolve the actual price change, updates the trackers in `localStorage`, and displays the success rates. +

+
+
+ +
+
+
+ ); +} diff --git a/components/modules/crypto/CryptoDemo.tsx b/components/modules/crypto/CryptoDemo.tsx index 9e59737..59ae21e 100644 --- a/components/modules/crypto/CryptoDemo.tsx +++ b/components/modules/crypto/CryptoDemo.tsx @@ -6,6 +6,7 @@ import { predictCryptoTrend, calculateBetaPosterior } from '@/lib/math/statistic import 'katex/dist/katex.min.css'; import { BlockMath, InlineMath } from 'react-katex'; import CryptoMathModal from './CryptoMathModal'; +import CryptoBlueprintModal from './CryptoBlueprintModal'; import { Cpu, Search, RefreshCw, BarChart2, TrendingUp, AlertCircle, Info, ChevronDown, ChevronUp, ArrowUpRight, ArrowDownRight, Compass, ShieldAlert, Sparkles, @@ -114,6 +115,7 @@ export default function CryptoDemo() { const [searchError, setSearchError] = useState(false); const [showMathAccordion, setShowMathAccordion] = useState(false); const [isMathModalOpen, setIsMathModalOpen] = useState(false); + const [isBlueprintModalOpen, setIsBlueprintModalOpen] = useState(false); const [simulatedTrialLogged, setSimulatedTrialLogged] = useState(false); const [lastTrialSuccess, setLastTrialSuccess] = useState(false); @@ -556,6 +558,14 @@ export default function CryptoDemo() { 📖 Quantitative Handbook + +
@@ -1002,6 +1012,7 @@ export default function CryptoDemo() {
setIsMathModalOpen(false)} /> + setIsBlueprintModalOpen(false)} />
); } diff --git a/components/modules/crypto/CryptoMathModal.tsx b/components/modules/crypto/CryptoMathModal.tsx index 685e040..995440d 100644 --- a/components/modules/crypto/CryptoMathModal.tsx +++ b/components/modules/crypto/CryptoMathModal.tsx @@ -65,11 +65,11 @@ export default function CryptoMathModal({ isOpen, onClose }: CryptoMathModalProp State 1 (S1) Bearish Squeeze / Crackdown -
+
State 2 (S2) Consolidation / Mean Reversion
-
+
State 3 (S3) Parabolic Bull Run
@@ -117,10 +117,10 @@ export default function CryptoMathModal({ isOpen, onClose }: CryptoMathModalProp
Ensemble Feature Inputs:
    -
  • Funding Rates (\\(FR_t\\)): Measures leverage imbalance in futures contracts.
  • -
  • Open Interest Volatility (\\(OI_t\\)): Captures the contract buildup speed.
  • -
  • Long/Short Retail Skew (\\(LS_t\\)): Identifies retail sentiment extremes.
  • -
  • Whale Accumulation Inflows (\\(W_t\\)): Proxy for cold-wallet transfer velocities.
  • +
  • Funding Rates (): Measures leverage imbalance in futures contracts.
  • +
  • Open Interest Volatility (): Captures the contract buildup speed.
  • +
  • Long/Short Retail Skew (): Identifies retail sentiment extremes.
  • +
  • Whale Accumulation Inflows (): Proxy for cold-wallet transfer velocities.

The Random Forest ensemble evaluates 10 non-linear decision trees to output the short-term and medium-term trend probabilities: @@ -135,7 +135,7 @@ export default function CryptoMathModal({ isOpen, onClose }: CryptoMathModalProp

Raw ML forecasts are susceptible to regime drift. We implement a self-correcting Beta-Binomial update. The continuous probability output from the Random Forest model is mapped into a discrete Binomial likelihood by defining the Trust-Weight Hyperparameter () as the Effective Sample Size (ESS):

-
+

1. Prior Distribution (Accuracy History):

@@ -165,7 +165,7 @@ export default function CryptoMathModal({ isOpen, onClose }: CryptoMathModalProp

To resolve a single operational point-estimate from our posterior distribution, we integrate out the continuous parameter to calculate the mathematical expectation of the posterior distribution:

-
+

Posterior Expectation Integral Proof:

diff --git a/components/modules/events/EconometricsBlueprintModal.tsx b/components/modules/events/EconometricsBlueprintModal.tsx new file mode 100644 index 0000000..6aa4c95 --- /dev/null +++ b/components/modules/events/EconometricsBlueprintModal.tsx @@ -0,0 +1,99 @@ +import React from 'react'; +import { Settings, X } from 'lucide-react'; + +interface EconometricsBlueprintModalProps { + isOpen: boolean; + onClose: () => void; +} + +export default function EconometricsBlueprintModal({ isOpen, onClose }: EconometricsBlueprintModalProps) { + React.useEffect(() => { + const handleKeyDown = (e: KeyboardEvent) => { + if (e.key === 'Escape') { + onClose(); + } + }; + if (isOpen) { + window.addEventListener('keydown', handleKeyDown); + } + return () => { + window.removeEventListener('keydown', handleKeyDown); + }; + }, [isOpen, onClose]); + + if (!isOpen) return null; + + return ( +

+
+ + {/* Modal Header */} +
+
+

+ Econometric Events - Operational Blueprint +

+

System User Manual & Interface Mechanics

+
+ +
+ + {/* Modal Body */} +
+ +
+

Event Studies & Models

+

Operational details of the econometric event study solver.

+
+ + {/* Core Mechanics */} +
+
+

1. Event Window Parameter Configuration

+

+ Allows defining the timeline partitions for analysis: + * **Estimation Window**: Historical baseline period (e.g. 120 days) used to estimate the normal asset return relationships. + * **Gap Window**: Separation buffer (e.g. 10 days) to prevent event-related leakages from skewing parameters. + * **Event Window**: Analysis window surrounding the event day (e.g. [-5, +5]). +

+
+ +
+

2. Abnormal Returns (AR)

+

+ Computes daily differences between the actual stock return and its expected "normal" return (using market-adjusted models or CAPM parameters derived during the estimation window). +

+
+ +
+

3. Cumulative Abnormal Returns (CAR)

+

+ Integrates and sums the daily abnormal returns across the event window. Determines whether an event (e.g. earnings release, regulatory fine, supply-chain shock) created statistically significant excess wealth changes. +

+
+
+ + {/* Interface Specifications */} +
+

Interface Actions & Chart Displays

+
+

+ Event Parameters Input Mask: Edit estimation days, gap days, event horizons, and click **"Run Event Study Solver"**. Initiates server-side calculations. +

+

+ CAR Event Charts: Renders a Recharts line chart illustrating the trajectory of Cumulative Abnormal Returns ($CAR$) across the event window. A significant deviation from zero indicates market inefficiency or corporate information shocks. +

+
+
+ +
+
+
+ ); +} diff --git a/components/modules/events/EconometricsMathModal.tsx b/components/modules/events/EconometricsMathModal.tsx index d9e26ce..df7459d 100644 --- a/components/modules/events/EconometricsMathModal.tsx +++ b/components/modules/events/EconometricsMathModal.tsx @@ -26,7 +26,7 @@ export default function EconometricsMathModal({ isOpen, onClose }: EconometricsM if (!isOpen) return null; return ( -
+
{/* Modal Header */} @@ -61,7 +61,7 @@ export default function EconometricsMathModal({ isOpen, onClose }: EconometricsM If an active event's date is in the past:

    -
  • FMP API fetches relative prices $P_t$ for $t \in [T-30, T+30]$ (60-day historical window).
  • +
  • FMP API fetches relative prices for (60-day historical window).
  • Asset curves and the user's manual score are frozen under archivedEvents in econometrics_storage.json.
  • Future edits to the active matrix will never modify archived price vectors.
@@ -70,10 +70,10 @@ export default function EconometricsMathModal({ isOpen, onClose }: EconometricsM

B. Endogenous Calibration

- Active future matrix cells pre-fill suggested scores by looking up the corresponding historical LMM coefficient and scaling it to our native score scale: + Active future matrix cells pre-fill suggested scores by looking up the corresponding historical LMM coefficient and scaling it to our native score scale:

- +
@@ -83,17 +83,17 @@ export default function EconometricsMathModal({ isOpen, onClose }: EconometricsM The engine estimates direct event drift and impact returns, isolating asset-level intercepts as random deviances and purging macro volatility using VIX indices:

- +

{"Where:"}
- {"- "}{" is the log-return "}{" of asset "}{" at relative index "}{"."} + {"- "}{" is the log-return "}{" of asset "}{" at relative index "}{"."}
- {"- "}{" design matrix elements isolate Pre-Event Drift ("}{") and Post-Event Impact ("}{") while controlling for systemic covariates (VIX)."} + {"- "}{" design matrix elements isolate Pre-Event Drift ("}{") and Post-Event Impact ("}{") while controlling for systemic covariates (VIX)."}
- {"- "}{" random intercept captures unique baseline asset variance."} + {"- "}{" random intercept captures unique baseline asset variance."}
- {"- "}{" residuals noise."} + {"- "}{" residuals noise."}

@@ -106,15 +106,15 @@ export default function EconometricsMathModal({ isOpen, onClose }: EconometricsM

Logistic Probability Projection:

- +

Optimal Youden Index (J):

- +

{"Inverting probability optimal threshold "}{" back to native score "}{" via Logit:"}

- +
@@ -126,7 +126,7 @@ export default function EconometricsMathModal({ isOpen, onClose }: EconometricsM

- +

{"Where:"}
@@ -137,7 +137,7 @@ export default function EconometricsMathModal({ isOpen, onClose }: EconometricsM

Reversal trigger with 1% Volatility Buffer:

- +
diff --git a/components/modules/events/EventsDemo.tsx b/components/modules/events/EventsDemo.tsx index fa0b713..ca93196 100644 --- a/components/modules/events/EventsDemo.tsx +++ b/components/modules/events/EventsDemo.tsx @@ -19,6 +19,7 @@ import { import 'katex/dist/katex.min.css'; import { BlockMath, InlineMath } from 'react-katex'; import EconometricsMathModal from './EconometricsMathModal'; +import EconometricsBlueprintModal from './EconometricsBlueprintModal'; import { Activity, BarChart4, @@ -247,6 +248,7 @@ export default function EventsDemo() { const [tauPre, setTauPre] = useState(7); const [tauPost, setTauPost] = useState(3); const [isMathModalOpen, setIsMathModalOpen] = useState(false); + const [isBlueprintModalOpen, setIsBlueprintModalOpen] = useState(false); const [selectedSurvivalAsset, setSelectedSurvivalAsset] = useState('Apple'); const [showLmmDiagnostics, setShowLmmDiagnostics] = useState(false); @@ -604,11 +606,19 @@ export default function EventsDemo() { + +
@@ -1326,6 +1336,7 @@ export default function EventsDemo() {
setIsMathModalOpen(false)} /> + setIsBlueprintModalOpen(false)} />
); } diff --git a/components/modules/insider/InsiderBlueprintModal.tsx b/components/modules/insider/InsiderBlueprintModal.tsx new file mode 100644 index 0000000..65714e5 --- /dev/null +++ b/components/modules/insider/InsiderBlueprintModal.tsx @@ -0,0 +1,96 @@ +import React from 'react'; +import { Settings, X } from 'lucide-react'; + +interface InsiderBlueprintModalProps { + isOpen: boolean; + onClose: () => void; +} + +export default function InsiderBlueprintModal({ isOpen, onClose }: InsiderBlueprintModalProps) { + React.useEffect(() => { + const handleKeyDown = (e: KeyboardEvent) => { + if (e.key === 'Escape') { + onClose(); + } + }; + if (isOpen) { + window.addEventListener('keydown', handleKeyDown); + } + return () => { + window.removeEventListener('keydown', handleKeyDown); + }; + }, [isOpen, onClose]); + + if (!isOpen) return null; + + return ( +
+
+ + {/* Modal Header */} +
+
+

+ Insider Trades - Operational Blueprint +

+

System User Manual & Interface Mechanics

+
+ +
+ + {/* Modal Body */} +
+ +
+

Insider Trade Ingestion & Filters

+

Operational details of corporate insider trade tracking.

+
+ + {/* Core Mechanics */} +
+
+

1. SEC Form 4 Tracking

+

+ Monitors corporate insider purchases and sales filed on SEC Form 4. Concentrates on high-ranking corporate officers (CEO, CFO, COO) and board directors, whose trading behaviors exhibit historical correlation with forward stock performance. +

+
+ +
+

2. Trade Size Filters

+

+ Filters transactions by absolute dollar size (prioritizing trades exceeding $100k) and percentage weight change relative to the insider's existing ownership stake. This helps eliminate routine stock option exercises and automated sales. +

+
+ +
+

3. DEV_MODE Interception

+

+ When the offline shield is active, the `/api/insider` route short-circuits live FMP calls and serves a high-fidelity local database file to guarantee zero API consumption costs. +

+
+
+ + {/* Interface Specifications */} +
+

Interface Layout & Mechanics

+
+

+ Insider Trades Ledger: Displays raw trade data: Tickers, Insider Names, Roles (CEO, Director, etc.), Buy/Sell transaction types, trade dates, shares traded, prices per share, and calculated total transaction values. +

+

+ API Layer Status Badge: Displays the status in the top control bar, showing `🟢 LIVE API` or `🟡 DEV-ARCHIV AKTIV` depending on the environment shield. +

+
+
+ +
+
+
+ ); +} diff --git a/components/modules/insider/InsiderDemo.tsx b/components/modules/insider/InsiderDemo.tsx index a1f56c3..e4cd20d 100644 --- a/components/modules/insider/InsiderDemo.tsx +++ b/components/modules/insider/InsiderDemo.tsx @@ -7,6 +7,7 @@ import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContaine import 'katex/dist/katex.min.css'; import { BlockMath, InlineMath } from 'react-katex'; import InsiderMathModal from './InsiderMathModal'; +import InsiderBlueprintModal from './InsiderBlueprintModal'; import { Shield, User, Landmark, ChevronDown, ChevronUp, Radio, Building2, AlertTriangle, Percent, BookOpen @@ -80,6 +81,7 @@ export default function InsiderDemo() { }[] | null>(null); const [showMathAccordion, setShowMathAccordion] = useState(false); const [isMathModalOpen, setIsMathModalOpen] = useState(false); + const [isBlueprintModalOpen, setIsBlueprintModalOpen] = useState(false); const [isShieldActive, setIsShieldActive] = useState(false); const [loading, setLoading] = useState(false); const [errorMsg, setErrorMsg] = useState(null); @@ -273,6 +275,14 @@ export default function InsiderDemo() { 📖 Quantitative Handbook + +
@@ -700,6 +710,7 @@ export default function InsiderDemo() {
setIsMathModalOpen(false)} /> + setIsBlueprintModalOpen(false)} />
); } diff --git a/components/modules/insider/InsiderMathModal.tsx b/components/modules/insider/InsiderMathModal.tsx index aa0cb59..45ceb0b 100644 --- a/components/modules/insider/InsiderMathModal.tsx +++ b/components/modules/insider/InsiderMathModal.tsx @@ -26,8 +26,8 @@ export default function InsiderMathModal({ isOpen, onClose }: InsiderMathModalPr if (!isOpen) return null; return ( -
-
+
+
{/* Modal Header */}
@@ -70,8 +70,8 @@ export default function InsiderMathModal({ isOpen, onClose }: InsiderMathModalPr

Insiders have unique company information, but clusters yield highest significance. A cluster is registered if:

-
- +
+

Insiders must represent distinct entities (e.g. CEO, CFO, and Directors trading concurrently).

@@ -83,8 +83,8 @@ export default function InsiderMathModal({ isOpen, onClose }: InsiderMathModalPr

The Insider Intensity Score scales signals based on size, conviction value, and count of participants:

-
- +
+
@@ -93,9 +93,9 @@ export default function InsiderMathModal({ isOpen, onClose }: InsiderMathModalPr

The engine cross-references corporate clusters with the Overreaction Scanner, isolating stocks with the highest rebound probabilities:

-
+

- {"If "}{" and "}{":"} + {"If "}{" and "}{":"}
Prioritize tickers showing asymmetric insider buying during panic drops, suggesting fundamental divergence from market sentiment.

diff --git a/components/modules/macro/MacroBlueprintModal.tsx b/components/modules/macro/MacroBlueprintModal.tsx new file mode 100644 index 0000000..4c15ec3 --- /dev/null +++ b/components/modules/macro/MacroBlueprintModal.tsx @@ -0,0 +1,99 @@ +import React from 'react'; +import { Settings, X } from 'lucide-react'; + +interface MacroBlueprintModalProps { + isOpen: boolean; + onClose: () => void; +} + +export default function MacroBlueprintModal({ isOpen, onClose }: MacroBlueprintModalProps) { + React.useEffect(() => { + const handleKeyDown = (e: KeyboardEvent) => { + if (e.key === 'Escape') { + onClose(); + } + }; + if (isOpen) { + window.addEventListener('keydown', handleKeyDown); + } + return () => { + window.removeEventListener('keydown', handleKeyDown); + }; + }, [isOpen, onClose]); + + if (!isOpen) return null; + + return ( +
+
+ + {/* Modal Header */} +
+
+

+ FRED Macro - Operational Blueprint +

+

System User Manual & Interface Mechanics

+
+ +
+ + {/* Modal Body */} +
+ +
+

Macro Ingestion & Thresholds

+

Operational details of Federal Reserve Economic Data (FRED) integration.

+
+ + {/* Core Mechanics */} +
+
+

1. FRED Ingestion channels

+

+ Queries Federal Reserve API endpoints to ingest 21 distinct macro credit, inflation, labor, and housing vectors. Bypasses external calls in `DEV_MODE` to read from local cache backups. +

+
+ +
+

2. Z-Score Normalization

+

+ Applies rolling historical mean and standard deviation scaling to convert raw indicators (e.g. housing starts, Delinquencies) into standardized Z-scores, indicating how far the current economy drifts from historical norms. +

+
+ +
+

3. Cockpit Alerts System

+

+ Standardizes warnings into green (safe), amber (watch), and flashing red (recession risk) lights. Evaluates interest rate curves, inflation velocity, credit delinquencies, and housing contractions. +

+
+
+ + {/* Interface Specifications */} +
+

Cockpit Status Alert Rationale

+
+

+ Inflation & Consumer Health Card: Sets off a `RED` trigger if CPI inflation YoY climbs above 3.0%, credit card delinquencies exceed 4.5%, or personal savings fall below 3.0%. +

+

+ Valuation & Liquidity Card: Sets off `RED` if S&P 500-to-GDP ratio (Buffett Indicator) rises past 150%, or the M2 money supply growth rate turns negative. +

+

+ Yield Curve & Credit Spread Card: Sets off `RED` if the 10Y-2Y yield curve spread inverts (spread < 0.0%) or high-yield credit spreads rise past 5.0%. +

+
+
+ +
+
+
+ ); +} diff --git a/components/modules/macro/MacroIndicatorsDemo.tsx b/components/modules/macro/MacroIndicatorsDemo.tsx index 878fb2f..8e53154 100644 --- a/components/modules/macro/MacroIndicatorsDemo.tsx +++ b/components/modules/macro/MacroIndicatorsDemo.tsx @@ -4,6 +4,7 @@ import React, { useState, useEffect, useMemo } from 'react'; import { LineChart, Line, ResponsiveContainer } from 'recharts'; import 'katex/dist/katex.min.css'; import MacroMathModal from './MacroMathModal'; +import MacroBlueprintModal from './MacroBlueprintModal'; import { TrendingUp, Landmark, AlertCircle, BookOpen, Percent, ArrowDownRight, ArrowUpRight, Minus, Activity, ShieldAlert, Coins, @@ -37,6 +38,7 @@ export default function MacroIndicatorsDemo() { const [error, setError] = useState(null); const [payload, setPayload] = useState(null); const [isMathModalOpen, setIsMathModalOpen] = useState(false); + const [isBlueprintModalOpen, setIsBlueprintModalOpen] = useState(false); const [isAccordionOpen, setIsAccordionOpen] = useState(false); // Collapsible accordion closed by default useEffect(() => { @@ -281,13 +283,21 @@ export default function MacroIndicatorsDemo() {
+ + -
+
Last Update
{new Date(payload.timestamp).toLocaleTimeString()} @@ -586,6 +596,7 @@ export default function MacroIndicatorsDemo() {
setIsMathModalOpen(false)} /> + setIsBlueprintModalOpen(false)} />
); } diff --git a/components/modules/macro/MacroMathModal.tsx b/components/modules/macro/MacroMathModal.tsx index f492501..1280693 100644 --- a/components/modules/macro/MacroMathModal.tsx +++ b/components/modules/macro/MacroMathModal.tsx @@ -26,7 +26,7 @@ export default function MacroMathModal({ isOpen, onClose }: MacroMathModalProps) if (!isOpen) return null; return ( -
+
{/* Modal Header */} @@ -70,13 +70,13 @@ export default function MacroMathModal({ isOpen, onClose }: MacroMathModalProps)

Buffett Ratio Equation:

- +

Where:
- - (originally FRED Series ID: 'WILL5000PR') represents the price performance of all active US equities. Due to the discontinuation of Wilshire series on FRED in June 2024, the S&P 500 index ('SP500') scaled by 1000 serves as the active proxy. + - (originally FRED Series ID: 'WILL5000PR') represents the price performance of all active US equities. Due to the discontinuation of Wilshire series on FRED in June 2024, the S&P 500 index ('SP500') scaled by 1000 serves as the active proxy.
- - is nominal US GDP (FRED Series ID: 'GDPA'). + - is nominal US GDP (FRED Series ID: 'GDPA').

@@ -96,20 +96,20 @@ export default function MacroMathModal({ isOpen, onClose }: MacroMathModalProps)

Net Liquidity Equation:

- +

Where:
- - represents Total Federal Reserve Assets (the asset side of the Fed Balance Sheet). + - represents Total Federal Reserve Assets (the asset side of the Fed Balance Sheet).
- - represents the Treasury General Account balance (the US Government's cash account held at the Federal Reserve). + - represents the Treasury General Account balance (the US Government's cash account held at the Federal Reserve).
- - represents the Reverse Repurchase Agreement facility usage volume (liquidity parked overnight by money market funds at the Fed). + - represents the Reverse Repurchase Agreement facility usage volume (liquidity parked overnight by money market funds at the Fed).

Liquidity Dynamics: - An increase in (Quantitative Easing) injects reserves into the banking system. Conversely, when the Treasury increases the balance or when money market funds park cash in the , liquidity is drained from active circulation. A shrinking Net Liquidity Proxy acts as a powerful brake on risk assets (Equities & Cryptocurrencies), whereas expanding liquidity acts as a tailwind. + An increase in (Quantitative Easing) injects reserves into the banking system. Conversely, when the Treasury increases the balance or when money market funds park cash in the , liquidity is drained from active circulation. A shrinking Net Fed Liquidity Proxy acts as a powerful brake on risk assets (Equities & Cryptocurrencies), whereas expanding liquidity acts as a tailwind.

@@ -125,7 +125,7 @@ export default function MacroMathModal({ isOpen, onClose }: MacroMathModalProps)

2S10S Spread Equation:

- +

Where:
@@ -135,7 +135,7 @@ export default function MacroMathModal({ isOpen, onClose }: MacroMathModalProps)

- Inversion & Un-Inversion: A negative spread () represents an inverted yield curve, which has historically preceded US economic recessions. The "un-inversion" process, where the spread returns to positive territory, typically occurs during late-cycle phases or central bank pivot periods, signaling imminent macroeconomic contraction as short-term yields fall rapidly in anticipation of rate cuts. + Inversion & Un-Inversion: A negative spread () represents an inverted yield curve, which has historically preceded US economic recessions. The "un-inversion" process, where the spread returns to positive territory, typically occurs during late-cycle phases or central bank pivot periods, signaling imminent macroeconomic contraction as short-term yields fall rapidly in anticipation of rate cuts.

@@ -151,13 +151,13 @@ export default function MacroMathModal({ isOpen, onClose }: MacroMathModalProps)

Consumer Credit Distress Index (CDI):

- +

Where:
- - measures the delinquency rate on credit card loans at top 100 commercial banks (FRED Series ID: 'DRCCLACBS'). + - measures the delinquency rate on credit card loans at top 100 commercial banks (FRED Series ID: 'DRCCLACBS').
- - represents personal savings as a percentage of disposable personal income (FRED Series ID: 'PSAVERT'). + - represents personal savings as a percentage of disposable personal income (FRED Series ID: 'PSAVERT').

@@ -182,7 +182,7 @@ export default function MacroMathModal({ isOpen, onClose }: MacroMathModalProps)

II. Mortgage Applications Index Proxy [FRED: MORTGAGE30US]: - Tracks the weekly demand for residential purchase mortgages. Because direct MBA applications index data is proprietary, the system computes a mortgage application index proxy derived from the 30-Year Fixed Rate Mortgage Average: . + Tracks the weekly demand for residential purchase mortgages. Because direct MBA applications index data is proprietary, the system computes a mortgage application index proxy derived from the 30-Year Fixed Rate Mortgage Average: .
III. Case-Shiller Home Price Index [FRED: CSUSHPISA]: diff --git a/components/modules/sandbox/SandboxBlueprintModal.tsx b/components/modules/sandbox/SandboxBlueprintModal.tsx new file mode 100644 index 0000000..70081d2 --- /dev/null +++ b/components/modules/sandbox/SandboxBlueprintModal.tsx @@ -0,0 +1,92 @@ +import React from 'react'; +import { Settings, X } from 'lucide-react'; + +interface SandboxBlueprintModalProps { + isOpen: boolean; + onClose: () => void; +} + +export default function SandboxBlueprintModal({ isOpen, onClose }: SandboxBlueprintModalProps) { + React.useEffect(() => { + const handleKeyDown = (e: KeyboardEvent) => { + if (e.key === 'Escape') { + onClose(); + } + }; + if (isOpen) { + window.addEventListener('keydown', handleKeyDown); + } + return () => { + window.removeEventListener('keydown', handleKeyDown); + }; + }, [isOpen, onClose]); + + if (!isOpen) return null; + + return ( +
+
+ + {/* Modal Header */} +
+
+

+ Portfolio Sandbox - Operational Blueprint +

+

System User Manual & Interface Mechanics

+
+ +
+ + {/* Modal Body */} +
+ +
+

Portfolio Optimization Controls

+

Operational specifications of the portfolio management sandbox cockpit.

+
+ + {/* Core Mechanics */} +
+
+

1. Kelly Sizing Controls

+

+ Uses success probability inputs and payout odds ratios (average win size / average loss size) to calculate the theoretical optimal leverage size. Enforces a **Half-Kelly** safety buffer by scaling the target bet size by 0.5. This prevents severe downside variance and reduces capital depletion risk. +

+
+ +
+

2. Weight Calculations

+

+ Computes the dynamic percentage allocation weights of individual portfolio holdings. It adjusts weights in real-time as asset prices fluctuate or shares are added/removed, ensuring capital exposure remains aligned with target limits. +

+
+
+ + {/* Interface Specifications */} +
+

Interface Actions & Computes

+
+

+ Asset Allocation Cockpit: Allows editing absolute stock quantities and purchasing prices. Computes the aggregate portfolio value, average cost basis, and dollar/percentage changes. +

+

+ Synthetic Portfolio Return (Rpt): Aggregates historical daily log-returns of individual assets, weighted by current allocations, to chart the hypothetical historical equity curve of the combined portfolio. +

+

+ Swamy-Arora Panel Solver: Executes a server-side Swamy-Arora random effects regression. Estimates the beta coefficients, residual errors, and variance parameters across panel data structures, allowing architects to model multi-asset risk dynamics. +

+
+
+ +
+
+
+ ); +} diff --git a/components/modules/sandbox/SandboxDemo.tsx b/components/modules/sandbox/SandboxDemo.tsx index b0cd866..2d2ff35 100644 --- a/components/modules/sandbox/SandboxDemo.tsx +++ b/components/modules/sandbox/SandboxDemo.tsx @@ -7,6 +7,7 @@ import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContai import 'katex/dist/katex.min.css'; import { BlockMath, InlineMath } from 'react-katex'; import SandboxMathModal from './SandboxMathModal'; +import SandboxBlueprintModal from './SandboxBlueprintModal'; import { TrendingUp, Wallet, ArrowDownRight, ArrowUpRight, Percent, Plus, FolderSync, HelpCircle, Settings, Calendar, DollarSign, Tag, Check, AlertCircle, ChevronDown, ChevronUp, Sparkles, @@ -59,6 +60,7 @@ export default function SandboxDemo() { const [showMathAccordion, setShowMathAccordion] = useState(false); const [isMathModalOpen, setIsMathModalOpen] = useState(false); + const [isBlueprintModalOpen, setIsBlueprintModalOpen] = useState(false); const [showMsciBenchmark, setShowMsciBenchmark] = useState(true); // Kelly Position Sizing states @@ -411,6 +413,14 @@ export default function SandboxDemo() { 📖 Quantitative Handbook + + {/* Net Worth Card */}
Total Value
@@ -1356,6 +1366,7 @@ export default function SandboxDemo() {
setIsMathModalOpen(false)} /> + setIsBlueprintModalOpen(false)} />
); } diff --git a/components/modules/sandbox/SandboxMathModal.tsx b/components/modules/sandbox/SandboxMathModal.tsx index 481cdf3..e8148b7 100644 --- a/components/modules/sandbox/SandboxMathModal.tsx +++ b/components/modules/sandbox/SandboxMathModal.tsx @@ -26,7 +26,7 @@ export default function SandboxMathModal({ isOpen, onClose }: SandboxMathModalPr if (!isOpen) return null; return ( -
+
{/* Modal Header */} @@ -39,7 +39,7 @@ export default function SandboxMathModal({ isOpen, onClose }: SandboxMathModalPr
@@ -80,19 +80,19 @@ export default function SandboxMathModal({ isOpen, onClose }: SandboxMathModalPr

Panel Model Specification with VIX Controls:

- +

where:
- - is the relative day offset from event date . + - is the relative day offset from event date .
- - and are relative phase indicators. + - and are relative phase indicators.
- is the background market-wide volatility covariate.
- - is the random group intercept (event instance shock). + - is the random group intercept (event instance shock).
- - is the residual error. + - is the residual error.

@@ -109,7 +109,7 @@ export default function SandboxMathModal({ isOpen, onClose }: SandboxMathModalPr

Theoretical Kelly Fraction () Equation:

- +

where:
@@ -120,9 +120,9 @@ export default function SandboxMathModal({ isOpen, onClose }: SandboxMathModalPr

Fractional Kelly (Half-Kelly) Safety Buffer:

- +

- To mitigate estimation variance and protect against catastrophic drawdown due to model error or fat-tailed market returns, the cockpit clips the suggested sizing to a **Half-Kelly** multiplier ($0.5$). + To mitigate estimation variance and protect against catastrophic drawdown due to model error or fat-tailed market returns, the cockpit clips the suggested sizing to a **Half-Kelly** multiplier ().

diff --git a/components/modules/scanner/ScannerBlueprintModal.tsx b/components/modules/scanner/ScannerBlueprintModal.tsx new file mode 100644 index 0000000..f9e1831 --- /dev/null +++ b/components/modules/scanner/ScannerBlueprintModal.tsx @@ -0,0 +1,99 @@ +import React from 'react'; +import { Settings, X } from 'lucide-react'; + +interface ScannerBlueprintModalProps { + isOpen: boolean; + onClose: () => void; +} + +export default function ScannerBlueprintModal({ isOpen, onClose }: ScannerBlueprintModalProps) { + React.useEffect(() => { + const handleKeyDown = (e: KeyboardEvent) => { + if (e.key === 'Escape') { + onClose(); + } + }; + if (isOpen) { + window.addEventListener('keydown', handleKeyDown); + } + return () => { + window.removeEventListener('keydown', handleKeyDown); + }; + }, [isOpen, onClose]); + + if (!isOpen) return null; + + return ( +
+
+ + {/* Modal Header */} +
+
+

+ Anomalies Scanner - Operational Blueprint +

+

System User Manual & Interface Mechanics

+
+ +
+ + {/* Modal Body */} +
+ +
+

Scanner Metrics & Signals

+

Operational details of the anomaly scanner and valuation filters.

+
+ + {/* Core Mechanics */} +
+
+

1. 52-Week Drop Mechanics

+

+ Filters the stock database for liquid companies trading at significant percentage discounts relative to their 52-week peak. Isolates severe drawdowns caused by asymmetric market overreactions. +

+
+ +
+

2. Welles Wilder RSI-14 Velocity

+

+ Uses the smoothed Wilder Relative Strength Index to identify deep oversold thresholds (RSI < 25). Momentum velocity measures standard deviation shocks in the indicator to forecast buy-exhaustion and selloff capitulations. +

+
+ +
+

3. FMP Valuation Overlay

+

+ Parses active valuation multiples: Price-to-Earnings (P/E), Price-to-Book (P/B), Dividend Yield, and Price/Earnings-to-Growth (PEG) ratios. Analyzes whether the selloff is justified fundamentally or is a dislocation from value. +

+
+
+ + {/* Interface Specifications */} +
+

User Actions & Interface Mechanics

+
+

+ Diagnostic Drawers: Clicking on any row in the scanner table opens an interactive drawer where you can analyze the drop catalyst: *Systemic Selloff, Supply Chain Disruption, Executive Shift, Regulatory Issue / Fine,* or *Earnings Miss*. +

+

+ GJR-GARCH Rebound Probability: The drawer displays a real-time rebound probability score. The GJR-GARCH model calculates conditional downside volatility, while the selected catalyst dynamically adjusts the rebound expectations based on historical asset-recovery statistics. +

+

+ Deep-Check Search Mask: Permits manual lookup of individual tickers. Ingests cash flow and balance sheet metrics from the backend API, displaying current Sloan ratios and GJR-GARCH conditional Value-at-Risk limits. +

+
+
+ +
+
+
+ ); +} diff --git a/components/modules/scanner/ScannerDemo.tsx b/components/modules/scanner/ScannerDemo.tsx index 19be456..f7a8553 100644 --- a/components/modules/scanner/ScannerDemo.tsx +++ b/components/modules/scanner/ScannerDemo.tsx @@ -7,6 +7,7 @@ import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContai import 'katex/dist/katex.min.css'; import { BlockMath, InlineMath } from 'react-katex'; import ScannerMathModal from './ScannerMathModal'; +import ScannerBlueprintModal from './ScannerBlueprintModal'; import { ShieldAlert, Sparkles, RefreshCw, Flame, Search, Plus, Trash2, ChevronDown, ChevronUp, AlertTriangle, CheckCircle2, XCircle, Info, Clock, Play, @@ -48,6 +49,7 @@ export default function ScannerDemo() { const [showMathAccordion, setShowMathAccordion] = useState(false); const [isMathModalOpen, setIsMathModalOpen] = useState(false); + const [isBlueprintModalOpen, setIsBlueprintModalOpen] = useState(false); const [isShieldActive, setIsShieldActive] = useState(false); // Cache for metadata and prices retrieved dynamically @@ -344,7 +346,7 @@ export default function ScannerDemo() { const renderCategoryTable = (title: string, description: string, assets: any[]) => { return ( -
+

{title}

@@ -586,6 +588,14 @@ export default function ScannerDemo() { 📖 Quantitative Handbook + +
); } diff --git a/components/modules/scanner/ScannerMathModal.tsx b/components/modules/scanner/ScannerMathModal.tsx index 8021557..165f16b 100644 --- a/components/modules/scanner/ScannerMathModal.tsx +++ b/components/modules/scanner/ScannerMathModal.tsx @@ -26,7 +26,7 @@ export default function ScannerMathModal({ isOpen, onClose }: ScannerMathModalPr if (!isOpen) return null; return ( -
+
{/* Modal Header */} @@ -60,15 +60,15 @@ export default function ScannerMathModal({ isOpen, onClose }: ScannerMathModalPr Scans the entire corporate equity universe daily, segmenting equities into three distinct market capitalization classes to identify localized overreactions:

-
+
Mega Caps > $100B
-
+
Mid Caps $10B - $100B
-
+
Small Caps < $10B
@@ -80,21 +80,21 @@ export default function ScannerMathModal({ isOpen, onClose }: ScannerMathModalPr

Calculates price distance ratios relative to support levels:

-
+

1. 52-Week High Deviation:

- +

2. 50-Day Moving Average Drop:

- +

3. Relative Strength Index (RSI-14) with smoothing:

- - + +

- where smoothed elements use Welles Wilder alpha = 1/14. Deep oversold signals trigger at RSI < 30. + where smoothed elements use Welles Wilder . Deep oversold signals trigger at .

@@ -105,21 +105,21 @@ export default function ScannerMathModal({ isOpen, onClose }: ScannerMathModalPr

To avoid value traps, technical drop factors are coupled with valuation metrics fetched in real-time from FMP:

-
+
  • Trailing P/E: Measures the price relative to trailing 12-month earnings.
  • Price-to-Book: Measures the asset backing relative to equity capital.
  • Dividend Yield (%): Tangible dividend payouts to measure cash backflow support.
  • PEG Ratio: Relates PE multiple to annual earnings growth: - +

Implicit Forward P/E calculation from PEG relationship:

- - + +

- If PEG is unavailable, a default growth rate of 10% is assumed as a conservative fallback baseline. + If PEG is unavailable, a default growth rate of is assumed as a conservative fallback baseline.

diff --git a/components/modules/tech/AiSpecialSilo.tsx b/components/modules/tech/AiSpecialSilo.tsx index ba30953..718c7b0 100644 --- a/components/modules/tech/AiSpecialSilo.tsx +++ b/components/modules/tech/AiSpecialSilo.tsx @@ -4,6 +4,7 @@ import React, { useState, useEffect } from 'react'; import { LineChart, Line, ResponsiveContainer } from 'recharts'; import 'katex/dist/katex.min.css'; import TechMathModal from './TechMathModal'; +import TechBlueprintModal from './TechBlueprintModal'; import { Cpu, AlertCircle, BookOpen, Activity, Zap, TrendingUp, TrendingDown, ArrowUpRight, ArrowDownRight, Minus, Server, Wallet @@ -89,7 +90,9 @@ export default function AiSpecialSilo() { const [loading, setLoading] = useState(true); const [error, setError] = useState(null); const [payload, setPayload] = useState(null); + const [activeTab, setActiveTab] = useState<'matrix' | 'supply_chain'>('matrix'); const [isMathModalOpen, setIsMathModalOpen] = useState(false); + const [isBlueprintModalOpen, setIsBlueprintModalOpen] = useState(false); const [isShieldActive, setIsShieldActive] = useState(false); useEffect(() => { @@ -230,13 +233,21 @@ export default function AiSpecialSilo() {
+ + -
+
Archive State
{new Date(payload.timestamp).toLocaleTimeString()} @@ -418,7 +429,7 @@ export default function AiSpecialSilo() { : '#f43f5e'; return ( -
+
{ticker}
@@ -483,7 +494,7 @@ export default function AiSpecialSilo() { : '#10b981'; return ( -
+
{ticker}
@@ -543,7 +554,7 @@ export default function AiSpecialSilo() { : '#10b981'; return ( -
+
{ticker}
@@ -592,7 +603,7 @@ export default function AiSpecialSilo() {

-
+
NVDA Inventory: {supplyChain.data[supplyChain.data.length - 1].aggregateObligations / 1000}B$
@@ -629,7 +640,7 @@ export default function AiSpecialSilo() { : 'text-emerald-400'; return ( - + {row.quarter} {row.nvdaInvTurnover.toFixed(2)}x {(row.aggregateObligations / 1000).toFixed(1)}B$ @@ -648,6 +659,10 @@ export default function AiSpecialSilo() { isOpen={isMathModalOpen} onClose={() => setIsMathModalOpen(false)} /> + setIsBlueprintModalOpen(false)} + />
); diff --git a/components/modules/tech/TechBlueprintModal.tsx b/components/modules/tech/TechBlueprintModal.tsx new file mode 100644 index 0000000..7a9b84b --- /dev/null +++ b/components/modules/tech/TechBlueprintModal.tsx @@ -0,0 +1,96 @@ +import React from 'react'; +import { Settings, X } from 'lucide-react'; + +interface TechBlueprintModalProps { + isOpen: boolean; + onClose: () => void; +} + +export default function TechBlueprintModal({ isOpen, onClose }: TechBlueprintModalProps) { + React.useEffect(() => { + const handleKeyDown = (e: KeyboardEvent) => { + if (e.key === 'Escape') { + onClose(); + } + }; + if (isOpen) { + window.addEventListener('keydown', handleKeyDown); + } + return () => { + window.removeEventListener('keydown', handleKeyDown); + }; + }, [isOpen, onClose]); + + if (!isOpen) return null; + + return ( +
+
+ + {/* Modal Header */} +
+
+

+ AI & Tech Silo - Operational Blueprint +

+

System User Manual & Interface Mechanics

+
+ +
+ + {/* Modal Body */} +
+ +
+

CapEx Cycle & Infrastructure Indicators

+

Operational details of tech overcapacity diagnosis.

+
+ + {/* Core Mechanics */} +
+
+

1. Monetization Gap & ROI-to-CapEx

+

+ Monitors segment revenues (e.g. Azure, AWS, Google Cloud, Meta Family of Apps) against capital spending growth. A negative monetization gap signals segment revenues are growing slower than capital investments. A collapsing ROI-to-CapEx ratio highlights write-down risks. +

+
+ +
+

2. Supply-Chain Velocity Index

+

+ Compares cloud buyers' future purchase obligations (disclosed in notes of 10-Q reports) against Nvidia's spot inventory turnover speeds. A collapsing velocity index indicates buyers are cutting back forward purchase commitments relative to hardware supplier stockpiles. +

+
+ +
+

3. Cluster Leverage (D/E & CapEx/Dep)

+

+ Monitors CapEx-to-depreciation ratios (ratios > 3x indicate hyper-aggressive server capacity additions) alongside Debt-to-Equity changes to assess whether the AI cluster construction is funded by leverage, exposing firms to massive future amortization drag. +

+
+
+ + {/* Interface Specifications */} +
+

Interface Layout & Mechanics

+
+

+ Sloan Accrual Card & Indicators: Integrates the Sloan Ratio indicator at the top of the silo dashboard, classifying reported revenues into Safe or Anomaly regimes. +

+

+ Silo Dashboard Sparklines: Displays quarterly trajectories for MSFT, GOOGL, META, AMZN, and AMD segment revenue and capital growth rates. +

+
+
+ +
+
+
+ ); +} diff --git a/components/modules/tech/TechMathModal.tsx b/components/modules/tech/TechMathModal.tsx index c663688..ddf45ef 100644 --- a/components/modules/tech/TechMathModal.tsx +++ b/components/modules/tech/TechMathModal.tsx @@ -26,7 +26,7 @@ export default function TechMathModal({ isOpen, onClose }: TechMathModalProps) { if (!isOpen) return null; return ( -
+
{/* Modal Header */} @@ -67,28 +67,28 @@ export default function TechMathModal({ isOpen, onClose }: TechMathModalProps) {

When technology companies deploy huge amounts of capital for AI clusters and computing nodes, standard revenue metrics may hide margin pressure. The Monetization Gap and ROI-to-CapEx metrics track this by isolating the growth of targeted cloud/AI segments against the velocity of capital investments:

-
+

- {"Formula for Monetization Gap (\\(G_{\\text{monetization}}\\)):"} + {"Formula for Monetization Gap ("}{"):"}

- +

- {"Formula for ROI-to-CapEx Ratio (\\(R_{\\text{ROI}}\\)):"} + {"Formula for ROI-to-CapEx Ratio ("}{"):"}

- +

{"Where:"}
- {"- "}{" is the quarter-over-quarter percentage growth rate of isolated Cloud/Segment revenue (e.g., Azure for MSFT, Google Cloud for GOOGL, Data Center for NVDA/AMD, Family of Apps for META)."} + {"- "}{" is the quarter-over-quarter percentage growth rate of isolated Cloud/Segment revenue (e.g., Azure for MSFT, Google Cloud for GOOGL, Data Center for NVDA/AMD, Family of Apps for META)."}
- {"- "}{" is the quarter-over-quarter percentage growth rate of Capital Expenditures."} + {"- "}{" is the quarter-over-quarter percentage growth rate of Capital Expenditures."}
- {"- "}{" is the absolute quarterly capital expenditure of the firm in millions."} + {"- "}{" is the absolute quarterly capital expenditure of the firm in millions."}

- Strategic Rationale:{" A negative Monetization Gap (\\(G_{\\text{monetization}} < 0\\)) indicates that capital spending is growing faster than segment monetization, suggesting diminishing marginal returns. A collapsing ROI-to-CapEx ratio signals that the capital investment is failing to spark immediate segment growth, leading to eventual asset write-downs."} + Strategic Rationale:{" A negative Monetization Gap ("}{") indicates that capital spending is growing faster than segment monetization, suggesting diminishing marginal returns. A collapsing "}{" ratio signals that the capital investment is failing to spark immediate segment growth, leading to eventual asset write-downs."}

@@ -101,22 +101,22 @@ export default function TechMathModal({ isOpen, onClose }: TechMathModalProps) {

Supply-chain stress is a reliable leading indicator of demand contraction. We monitor the relationship between the key hardware supplier (Nvidia) and the primary cloud buyers (MSFT, GOOGL, META) by comparing buyers' future purchase commitments with the supplier's inventory speeds:

-
+

Nvidia Inventory Turnover (Annualized):

- +

- {"Supply-Chain Velocity Index (\\(V_{\\text{sc}}\\)):"} + {"Supply-Chain Velocity Index ("}{"):"}

- +

{"Where:"}
- {"- "}{" is Nvidia's quarterly Cost of Goods Sold."} + {"- "}{" is Nvidia's quarterly Cost of Goods Sold."}
- {"- "}{" is Nvidia's total inventory value on its balance sheet."} + {"- "}{" is Nvidia's total inventory value on its balance sheet."}
- {"- "}{" represents the forward purchase commitments disclosed in the notes of 10-Q filing reports by the buyers (MSFT, GOOGL, META)."} + {"- "}{" represents the forward purchase commitments disclosed in the notes of 10-Q filing reports by the buyers (MSFT, GOOGL, META)."}

@@ -133,20 +133,20 @@ export default function TechMathModal({ isOpen, onClose }: TechMathModalProps) {

Aggressive cluster construction requires significant debt or capital consumption. We measure the balance sheet risk of massive computing nodes using the Debt-to-Equity (D/E) and CapEx-to-Depreciation ratios:

-
+

Debt-to-Equity Shift Ratio:

- +

- {"CapEx-to-Depreciation Ratio (\\(R_{\\text{capex-dep}}\\)):"} + {"CapEx-to-Depreciation Ratio ("}{"):"}

- +

{"Where:"}
- {"- "}{" represents short-term and long-term interest-bearing debt."} + {"- "}{" represents short-term and long-term interest-bearing debt."}
- {"- "}{" represents the quarterly depreciation expense, reflecting the wear-and-tear of existing physical server arrays."} + {"- "}{" represents the quarterly depreciation expense, reflecting the wear-and-tear of existing physical server arrays."}

@@ -163,24 +163,24 @@ export default function TechMathModal({ isOpen, onClose }: TechMathModalProps) {

Investment hyper-leverage creates systematic feedback loops in equity markets. We model the amplification of tech sector risk (asymmetric beta expansion) using a non-linear scaling model:

-
+

Systemic Tech Beta Model:

- +

{"Where:"}
- {"- "}{" is the baseline systematic tech beta (historically ~1.10)."} + {"- "}{" is the baseline systematic tech beta (historically ~1.10)."}
- {"- "}{" represents the investment intensity multiplier (e.g. 0.05)."} + {"- "}{" represents the investment intensity multiplier (e.g. 0.05)."}
- {"- "}{" represents the supply-chain velocity damping constant (e.g. 0.12)."} + {"- "}{" represents the supply-chain velocity damping constant (e.g. 0.12)."}
- {"- "}{" is the Supply-Chain Velocity Index calculated in Section 2."} + {"- "}{" is the Supply-Chain Velocity Index calculated in Section 2."}

- Economic Rationale:{" This equation demonstrates that tech equity risk is not static. As CapEx outstrips depreciation (building massive infrastructure) and the Supply-Chain Velocity Index collapses (build-up of unsellable inventory), the systemic beta "}{" expands exponentially. Under these parameters, any minor disappointment in earnings results in an asymmetric downward repricing."} + Economic Rationale:{" This equation demonstrates that tech equity risk is not static. As CapEx outstrips depreciation (building massive infrastructure) and the Supply-Chain Velocity Index collapses (build-up of unsellable inventory), the systemic beta "}{" expands exponentially. Under these parameters, any minor disappointment in earnings results in an asymmetric downward repricing."}

@@ -193,26 +193,26 @@ export default function TechMathModal({ isOpen, onClose }: TechMathModalProps) {

The Sloan Ratio identifies discrepancies between reported net income and actual cash flows. A high proportion of non-cash accruals signals low earnings quality and is a historically proven accounting anomaly predictor:

-
+

- {"Formula for Accruals (\\(\\text{Accruals}\\)):"} + {"Formula for Accruals ("}{"):"}

- +

- {"Formula for Sloan Ratio (\\(\\text{Sloan Ratio}\\)):"} + {"Formula for Sloan Ratio ("}{"):"}

- +

{"Where:"}
- {"- "}{" is the company's net income for the fiscal period."} + {"- "}{" is the company's net income for the fiscal period."}
- {"- "}{" is Cash Flow from Operations (operating cash flow)."} + {"- "}{" is Cash Flow from Operations (operating cash flow)."}
- {"- "}{" is Cash Flow from Investing activities."} + {"- "}{" is Cash Flow from Investing activities."}
- {"- "}{" is the total assets reported on the balance sheet at the end of the period."} + {"- "}{" is the total assets reported on the balance sheet at the end of the period."}

diff --git a/components/modules/whale/WhaleBlueprintModal.tsx b/components/modules/whale/WhaleBlueprintModal.tsx new file mode 100644 index 0000000..44fbac6 --- /dev/null +++ b/components/modules/whale/WhaleBlueprintModal.tsx @@ -0,0 +1,106 @@ +import React from 'react'; +import { Settings, X } from 'lucide-react'; + +interface WhaleBlueprintModalProps { + isOpen: boolean; + onClose: () => void; +} + +export default function WhaleBlueprintModal({ isOpen, onClose }: WhaleBlueprintModalProps) { + React.useEffect(() => { + const handleKeyDown = (e: KeyboardEvent) => { + if (e.key === 'Escape') { + onClose(); + } + }; + if (isOpen) { + window.addEventListener('keydown', handleKeyDown); + } + return () => { + window.removeEventListener('keydown', handleKeyDown); + }; + }, [isOpen, onClose]); + + if (!isOpen) return null; + + return ( +

+
+ + {/* Modal Header */} +
+
+

+ Whale Satellites - Operational Blueprint +

+

System User Manual & Interface Mechanics

+
+ +
+ + {/* Modal Body */} +
+ +
+

Whale Ingestion & Filters

+

Operational details of boutique manager tracking and conviction scoring.

+
+ + {/* Core Mechanics */} +
+
+

1. Boutique Manager Filter

+

+ The universe is restricted to active boutique investment firms holding between $100M and $5B in Assets Under Management (AUM), exhibiting an Active Share exceeding 80%. This excludes large index-trackers and highlights alpha-generating concentrated stock pickers. +

+
+ +
+

2. Concentration Index (CI)

+

+ Prioritizes portfolios where the top 10 holdings represent more than 50% of the total reported holdings value. This ensures that the positions tracked reflect high-conviction ideas where managers are willing to expose significant capital. +

+
+ +
+

3. Velocity of Conviction (VoC)

+

+ Measures the quarterly change in portfolio weighting for each asset. It isolates managers' active additions or liquidations ($\Delta W_i$), sorting the dashboard holdings strictly by positive conviction velocity to find accumulating trends. +

+
+ +
+

4. 13F Filing Lag Warning

+

+ Form 13F filings are submitted up to 45 days after the end of the calendar quarter. The system displays these shifts as lagging indicators and overlays them with volume markers to confirm whether the manager is still actively buying. +

+
+
+ + {/* Interface Specifications */} +
+

Interface Layout & Mechanics

+
+

+ Whale Profile Cards: The left sidebar allows selecting the active boutique manager (e.g. Scion Asset Management, Akre Capital, Mairs & Power). Displays their current AUM, Concentration index, and top holdings size. +

+

+ Transactions Ledger: The right table shows the selected manager's quarterly additions and reductions. Shows security names, tickers, shares held, reported values, portfolio weights, and calculated VoC deltas. +

+

+ DEV_MODE Offline Protection: When offline, the `/api/whale/screener` endpoint bypasses SEC EDGAR connections and returns stored mock files, indicating isShieldActive: true. +

+
+
+ +
+
+
+ ); +} diff --git a/components/modules/whale/WhaleMathModal.tsx b/components/modules/whale/WhaleMathModal.tsx index 4f59ac2..223bf53 100644 --- a/components/modules/whale/WhaleMathModal.tsx +++ b/components/modules/whale/WhaleMathModal.tsx @@ -26,8 +26,8 @@ export default function WhaleMathModal({ isOpen, onClose }: WhaleMathModalProps) if (!isOpen) return null; return ( -
-
+
+
{/* Modal Header */}
@@ -50,7 +50,7 @@ export default function WhaleMathModal({ isOpen, onClose }: WhaleMathModalProps)
{/* Executive Overview */} -
+

Executive Overview

@@ -67,10 +67,10 @@ export default function WhaleMathModal({ isOpen, onClose }: WhaleMathModalProps)

Institutional investment managers with over $100 million in Assets Under Management (AUM) are legally mandated by the SEC to submit Form 13F within 45 days after the end of each calendar quarter. This lag presents a structural challenge for quantitative models, as holdings data represents historical positions:

-
+
I. Retrospective Analysis: - Positions disclosed on day \(T + 45\) reflect the portfolio state at day \(T\). As a result, short-term momentum models cannot directly trade 13F filings. + Positions disclosed on day reflect the portfolio state at day . As a result, short-term momentum models cannot directly trade 13F filings.
II. Informational Asymmetry: @@ -87,26 +87,26 @@ export default function WhaleMathModal({ isOpen, onClose }: WhaleMathModalProps)

Rather than tracking the absolute number of shares bought or sold, the screener measures changes in the relative portfolio weight of each asset. This normalizes for AUM changes caused by overall market movements:

-
+

Velocity of Conviction (VoC) Delta:

- +

Asset Portfolio Weight Calculation:

- +

Where:
- - is the portfolio weight of asset \(i\) at the end of the current quarter \(t\) (expressed as a percentage). + - is the portfolio weight of asset at the end of the current quarter (expressed as a percentage).
- - is the portfolio weight of asset \(i\) at the end of the previous quarter \(t-1\). + - is the portfolio weight of asset at the end of the previous quarter .
- - is the market value of the position in asset \(i\) as reported in the 13F filing for quarter \(t\). + - is the market value of the position in asset as reported in the 13F filing for quarter .
- - represents the total market value of all reported equity holdings in the filing for quarter \(t\) (AUM proxy). + - represents the total market value of all reported equity holdings in the filing for quarter (AUM proxy).

- Strategic Rationale: A positive VoC delta {"\\(\\text{VoC}_i > 0\\)"} indicates that the manager has actively allocated capital to the asset relative to other holdings, suggesting high-conviction buying. Conversely, a negative delta {"\\(\\text{VoC}_i < 0\\)"} indicates relative allocation decreases, showing active selling or profit-taking. + Strategic Rationale: A positive VoC delta indicates that the manager has actively allocated capital to the asset relative to other holdings, suggesting high-conviction buying. Conversely, a negative delta indicates relative allocation decreases, showing active selling or profit-taking.

diff --git a/components/modules/whale/WhaleScreener.tsx b/components/modules/whale/WhaleScreener.tsx index ab9c234..9181d1f 100644 --- a/components/modules/whale/WhaleScreener.tsx +++ b/components/modules/whale/WhaleScreener.tsx @@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react'; import WhaleMathModal from './WhaleMathModal'; +import WhaleBlueprintModal from './WhaleBlueprintModal'; import { Compass, ArrowUpRight, ArrowDownRight, Minus, BookOpen, AlertCircle, RefreshCw, Layers, DollarSign, Calendar, TrendingUp } from 'lucide-react'; @@ -33,6 +34,7 @@ export default function WhaleScreener() { const [positions, setPositions] = useState([]); const [isShieldActive, setIsShieldActive] = useState(false); const [isMathModalOpen, setIsMathModalOpen] = useState(false); + const [isBlueprintModalOpen, setIsBlueprintModalOpen] = useState(false); const [refreshKey, setRefreshKey] = useState(0); useEffect(() => { @@ -123,18 +125,26 @@ export default function WhaleScreener() {
+ +
@@ -259,6 +269,7 @@ export default function WhaleScreener() {
setIsMathModalOpen(false)} /> + setIsBlueprintModalOpen(false)} />
); }