Skip to content

Repository files navigation

πŸ›οΈ Zenith Atlas β€” High-Performance Quantitative Analytics Terminal

License: MIT React 19 TypeScript Vitest Vite 6 PWA

An open-source, high-performance financial analytics and risk engine running 100% client-side with zero backend dependencies.

Live Terminal β€’ Architecture β€’ Benchmark β€’ Getting Started β€’ TΓΌrkΓ§e DokΓΌmantasyon


πŸ“Œ Executive Overview

Zenith Atlas is an open-source, high-performance financial analytics and risk modeling terminal designed for asset managers, researchers, and individual investors tracking Turkish and global capital markets (1,051 TEFAS mutual funds, Borsa Istanbul equities, FX, commodities, and CBRT macroeconomic indicators).

Operating under a Client-Side Memory Architecture, zero portfolio telemetry or trade data is transmitted to external servers. All factor regressions, Bayesian allocations, and 10,000-path Monte Carlo simulations execute entirely in-browser memory.


πŸ“Š Quantitative Engine Benchmark & Verification

All mathematical calculation modules and multi-agent coordination loops are covered and validated by an automated test suite (23 Unit & Benchmark Tests):

Mathematical Engine / Module Algorithm & Methodology Test Status Execution Latency
Monte Carlo Engine 10,000-Path Geometric Brownian Motion (GBM) 100% PASS 175ms (5-Yr Horizon)
Black-Litterman Model Bayesian Portfolio Equilibrium & View Shrinkage 100% PASS 0.21ms
Hierarchical Risk Parity (HRP) Marcos Lopez de Prado ML Tree Clustering 100% PASS 0.27ms
Fama-French 5-Factor Multi-Factor Regression & Jensen's Alpha 100% PASS 0.38ms
Adaptive Circuit Breaker 3-Tier Drawdown & Volatility State Machine 100% PASS < 0.1ms
Tax-Loss Harvesting Engine GVK 67 Exemption & HIFO Tax Shield 100% PASS < 0.2ms
Multi-Agent Hive Engine 5 Autonomous Sentinels & Memory Reflector 100% PASS Verified
Formula Injection Defense DDE Sanitization (sanitizeCsvCell) 100% PASS Verified

πŸ—οΈ Architecture & Data Flow

graph TD
    subgraph CLIENT [πŸ–₯️ Modern React 19 + TypeScript Terminal]
        UI[User Interface: Dashboard, Funds, Screener, Heatmap, Quant, Strategy, Engine]
        WS_CLIENT[Live WebSocket Client]
        IDB[(IndexedDB & LocalStorage Portfolio Store)]
        
        subgraph MODULES [βš™οΈ Modular Quant Engine: 5 Specialized Modules]
            A1[SyncSentinel: TEFAS Session & Data Reconciliation]
            A2[LeadQuant: Fama-French Alpha & Factor Attribution]
            A3[RiskBreaker: Circuit Breaker & Volatility Audit]
            A4[TaxHarvester: Withholding & Tax Optimization]
            A5[MacroStrategist: CBRT & Inflation Macro Allocation]
        end

        subgraph ENGINES [πŸ“ 11 Quantitative Mathematical Engines]
            E1[FactorAttributionEngine: Fama-French 5-Factor]
            E2[RollingCorrelationEngine: 30D/90D/365D Correlation & PCA]
            E3[BlackLittermanEngine: Bayesian Asset Allocation]
            E4[HrpEngine: Hierarchical Risk Parity]
            E5[MonteCarloEngine: 10,000-Path Simulation]
            E6[TaxLossHarvestingEngine: HIFO Tax Shield]
            E7[SyntheticStressEngine: Historical & Synthetic Crisis Stress]
            E8[SquarifiedTreemapEngine: Finviz-Style Treemap]
            E9[VoiceBriefingEngine: Web Speech AI Voice Engine]
            E10[P2pLiveSyncEngine: WebRTC & QR Teleport]
            E11[FinancialCircuitBreaker: 3-Tier Circuit Breaker]
        end
    end

    subgraph SOURCES [🌐 Official Data Feeds]
        S1[Takasbank TEFAS Dataset: 1,051 Funds]
        S2[wss://s.canlidoviz.com: Live FX, Gold & BIST]
        S3[CBRT & TUIK: Repo Rate %37 & CPI %31.75]
    end

    S2 -->|Real-Time WebSocket| WS_CLIENT
    S1 & S3 -->|Automated Sync & Bundled Data| IDB
    WS_CLIENT --> UI
    IDB --> MODULES
    MODULES --> ENGINES
    ENGINES --> UI
Loading

πŸš€ Core Capabilities & Modules

1. βš™οΈ Modular Quant Engine (5 Specialized Modules)

  • SyncSentinel: Monitors 1,051 TEFAS mutual funds and reconciles daily Takasbank 20:00 session settlement pricing.
  • LeadQuant: Computes Fama-French 5-Factor attribution, Jensen's Alpha, Beta, Sharpe, Sortino, and Calmar risk-adjusted performance ratios.
  • RiskBreaker: Continuously tracks volatility thresholds and portfolio concentration, enforcing a 3-tier circuit breaker (HEALTHY, WARNING, TRIPPED).
  • TaxHarvester: Simulates HIFO tax loss harvesting and optimizes allocations under Turkish Presidential Decree 9075 (0% withholding tax equity funds).
  • MacroStrategist: Evaluates macro regimes based on CBRT policy rates and inflation dynamics to recommend asset allocation tilts.

2. πŸ“ Advanced Quantitative Portfolio Analytics

  • Fama-French 5-Factor Decomposition: Decomposes returns across Market ($\beta$), Size (SMB), Value (HML), Profitability (RMW), and Investment (CMA) factors to isolate pure managerial alpha.
  • Black-Litterman Model: Blends market equilibrium with subjective investor views using Bayesian statistical shrinkage.
  • Hierarchical Risk Parity (HRP): Executes machine learning-based hierarchical tree clustering (Marcos Lopez de Prado) for robust diversification without matrix inversion instabilities.
  • Monte Carlo Simulation: 10,000-path Geometric Brownian Motion (GBM) projecting 1-to-5-year probabilistic return cones.
  • Crisis Stress Testing: Simulates portfolio drawdown under historical shocks: 2008 Global Financial Crisis, 2020 Pandemic Shock, and 2021 Turkish Lira FX Shock.

3. πŸ” 1,051 Mutual Funds Screener & Recognition Engine

  • Embedded offline database indexing all 1,051 official TEFAS mutual funds.
  • Sub-millisecond code lookup auto-populates fund metadata, category classification, and Takasbank settlement pricing.
  • Multi-criteria sorting and filtering by AUM, expense ratio, annualized alpha, and category.

4. πŸ“Š Squarified Treemap Heatmap

  • Visualizes 1,051 TEFAS funds and user portfolios via the Bruls-Huizing-van Wijk tiling algorithm using HSL dynamic color scales.

5. πŸ“‘ Automated 4-Page A4 PDF Institutional Report Generator

  • Generates comprehensive, high-resolution 4-page A4 executive PDF summaries client-side via jsPDF, containing factor attributions, risk metrics, and simulation paths.

6. πŸŽ™οΈ Voice Market Briefing

  • Web Speech API-powered voice engine synthesizing daily portfolio summaries, net asset values, and market opening briefings in Turkish.

7. πŸ“² Serverless P2P Mobile Teleportation

  • Zero-cloud, camera-based mobile portfolio synchronization via high-density URL hash QR teleportation.
  • Mobile-first responsive UI featuring bottom dock navigation, swipeable tabs, and touch drawers.

8. πŸ›‘οΈ Fault-Tolerant React 19 Error Boundary

  • Runtime resilience layer preventing white-screen crashes, isolating UI state faults, and enabling graceful local data recovery.

πŸ’» Getting Started

Live Terminal

Access the production build directly in your browser with zero setup: πŸ‘‰ https://cagrik34.github.io/zenith-atlas/

Local Development

Prerequisites:

  • Node.js v20+ (v22+ LTS recommended)
  • npm v10+
# 1. Clone repository
git clone https://github.com/Cagrik34/zenith-atlas.git
cd zenith-atlas

# 2. Install dependencies
npm install

# 3. Run automated unit & benchmark tests (23 Tests)
npm test

# 4. Start development server
npm run dev

# 5. Build for production (Strict TypeScript & PWA)
npm run build

πŸ“ Directory Structure

zenith-atlas/
β”œβ”€β”€ .github/workflows/      # GitHub Actions CI/CD test & deployment workflow
β”œβ”€β”€ public/                 # Static PWA assets, manifest, and icons
β”œβ”€β”€ scripts/                # Python-based data ingestion & sync utilities (sync.py)
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/         # Modular UI components (Dashboard, Quant, Screener, etc.)
β”‚   β”œβ”€β”€ context/            # React Contexts (Portfolio, Market, AgentHive)
β”‚   β”œβ”€β”€ data/               # Bundled static datasets
β”‚   β”œβ”€β”€ engines/            # 11 Quantitative mathematical analysis engines
β”‚   β”œβ”€β”€ hooks/              # Custom reactive hooks (useAutoSync, useLivePrices)
β”‚   β”œβ”€β”€ styles/             # Enterprise Glassmorphism design system
β”‚   β”œβ”€β”€ types/              # Strict TypeScript definitions
β”‚   β”œβ”€β”€ utils/              # Export formats, math helpers, and storage drivers
β”‚   β”œβ”€β”€ App.tsx             # Root Application & Modals
β”‚   └── main.tsx            # React 19 Entry Point
β”œβ”€β”€ tests/                  # Vitest Unit & Benchmark test suites (23 Tests)
β”‚   β”œβ”€β”€ benchmark/          # Sub-millisecond performance benchmarks
β”‚   └── unit/               # Quant engines, multi-agent hive & security tests
β”œβ”€β”€ index.html              # HTML5 Entry Document
β”œβ”€β”€ package.json            # Node.js dependencies, scripts & vitest runner
β”œβ”€β”€ tsconfig.json           # Strict TypeScript configuration
└── vite.config.ts          # Vite 6 + manualChunks Rollup optimization

πŸ”’ Security & Client-Side Privacy

  • Client-Side Execution: Portfolio balances, trade histories, and cost positions remain strictly in local browser storage (IndexedDB / localStorage).
  • Input Sanitization: Native React 19 DOM escaping safeguards.
  • Formula Injection Defense: CSV/Excel export cells sanitized via sanitizeCsvCell against Dynamic Data Exchange (DDE) formula execution (=, +, -, @).

πŸ“„ License & Copyright

Distributed under the MIT License. See LICENSE for details.

Author: Γ‡ağrΔ± Giray Keşan
Copyright: Β© 2026 Γ‡ağrΔ± Giray Keşan. All Rights Reserved.

About

Institutional quantitative finance terminal for TEFAS funds, factor attribution, Black-Litterman & Monte Carlo risk analytics. Client-side & zero-knowledge.

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages