# SVRGNW (pronounced "Sovereign Wealth") Technical Specification & Agent Interface Guide Version: 1.2.0 Domain: https://www.svrgnw.com License: Private / Sovereign Software Author: Matthäus Rojek ## 1. System Overview SVRGNW is a progressive web application architected for local execution. It runs completely within the user's browser sandbox, utilizing native web standards without requiring an application backend server. ### Technical Stack - Runtime: Browser (Chromium 109+, Safari 16.4+, Firefox 115+) - Bundler: Vite 5 (Pure ES Modules) - Styling: Custom CSS variables with Dark-Mode Obsidian/Gold theme, glass-morphism, responsive tablet/mobile breakpoints - Typography: Self-hosted local `@font-face` WOFF2 (`Inter` and `JetBrains Mono`) - Cryptography: Web Crypto API (AES-256-GCM for encrypted peer sync) - Storage: `navigator.storage.persist()`, `IndexedDB`, `localStorage` ## 2. Data Models & Schemas ### 2.1 Backup Snapshot Schema (`svrgnw_backup_*.json`) ```json { "version": 1, "app": "SVRGNW Local Wealth Engine", "exportedAt": "2026-09-26T19:00:00.000Z", "clientOrigin": "https://www.svrgnw.com", "activePortfolio": "aggregated", "data": { "portfolios": { "scalable": { "name": "Scalable Capital", "currency": "EUR" }, "traderepublic": { "name": "Trade Republic", "currency": "EUR" }, "schwab": { "name": "Charles Schwab RSUs", "currency": "USD" }, "fidelity": { "name": "Fidelity Investments", "currency": "USD" }, "trading212": { "name": "Trading 212", "currency": "EUR" }, "crypto_vault": { "name": "Cold Storage & Cash", "currency": "EUR" } }, "holdings": [ { "ticker": "VWCE.DE", "name": "Vanguard FTSE All-World UCITS ETF", "assetClass": "Equity ETF", "shares": 520.4, "avgBuyPrice": 98.40, "currentPrice": 128.60, "portfolio": "scalable", "currency": "EUR" } ], "fiPlan": { "targetNestEgg": 1000000, "annualSavings": 36000, "expectedReturnRate": 0.07, "inflationRate": 0.02, "safeWithdrawalRate": 0.035 } } } ``` ### 2.2 Model Context Protocol (MCP) Server SVRGNW includes a local MCP server (`dos-comas-mcp-server`) conforming to the Model Context Protocol specification: #### Portfolio Tools (Local Storage / SQLite WASM): - `get_portfolio_summary`: Retrieves aggregated net worth, invested capital, total P&L, and TWR across all sub-portfolios. - `get_holdings`: Lists individual securities, asset classes, share quantities, and allocation weights. - `get_transactions`: Queries transaction history with flexible filters (broker, ticker, type, date range). - `get_dividends`: Returns annual projected dividend cashflows, monthly breakdowns, and dividend ranking by ticker. - `get_fi_status`: Calculates progress toward the sovereign target (€1M+), years to FI, and safe perpetual monthly payout. #### Stateless Financial Calculator Tools (100% Client-Side & Deterministic): - `calculate_german_salary`: Computes German net take-home salary, employer total cost (Arbeitgeber-Brutto), statutory social security (KV, PV, RV, AV), wage tax (§ 39b EStG 2025–2028), total government wedge (Staatsquote), and Tax Freedom Day. - `calculate_vorabpauschale`: Computes German ETF Vorabpauschale advance tax (§ 18 InvStG) with Bundesbank Basiszins, Teilfreistellung (30% equity ETF), and Sparer-Pauschbetrag. - `calculate_coast_fire`: Calculates Financial Independence (FI) Number, Coast FIRE threshold today, real inflation-adjusted return, and years to retirement. - `calculate_compound_interest`: Models exponential compounding with monthly contributions, annual dynamic step-up, inflation adjustments, and German ETF tax drag. - `calculate_monte_carlo`: Runs 1,000-run stochastic Box-Muller retirement decumulation simulations with Guyton-Klinger dynamic spending guardrails and cash buffer runways. - `calculate_portfolio_rebalancing`: Computes tax-neutral cashflow rebalancing buy orders to eliminate portfolio allocation drift without selling shares. - `calculate_real_estate_cashflow`: Calculates buy-to-let rental yield, closing costs, mortgage amortization, statutory AfA depreciation tax shields (§ 7 Abs. 4 EStG), and after-tax cashflow. - `calculate_paypal_fees`: Computes PayPal merchant transaction fees and exact reverse gross invoice amounts needed for specific net payouts. - `calculate_crisis_stress_test`: Simulates portfolio drawdown, trough valuation, and recovery duration across historical market crashes (2008 GFC, 2000 Dot-Com, 1929, 1973, 2022). - `calculate_sankey_cashflow`: Computes household net savings rate, tax wedge, and cashflow distribution across income, taxes, investments, and living expenses. ## 3. Mathematical Specifications of Sovereign Calculators ### 3.1 German Wage Tax (§ 39b EStG) & Social Insurance - Health Insurance (KV): General statutory rate 14.6% + average Zusatzbeitrag (2.5% in 2025/2026), split 50/50 between employee and employer up to the Beitragsbemessungsgrenze (BBG_KV = €69,750 in 2026; €76,500 in 2027). - Nursing Care (PV): 3.4% base (AG 1.7%, AN 1.7% base + 0.6% childless surcharge = 2.3% AN; discounts of 0.25% per child from 2nd to 5th child). - Pension (RV): 18.6% split 50/50 = 9.3% each up to BBG_RV (€101,400 in 2026; €106,200 in 2027; rising to 19.2% in 2028 under Rentenpaket II). - Unemployment (AV): 2.6% split 50/50 = 1.3% each up to BBG_RV. - Employer Levies: ~2.1% (U1, U2, U3 Insolvenzgeldumlage). - Arbeitgeber-Brutto = Gross Salary + Employer Social Contributions + Levies. - Formula for Tax Freedom Day: `Days = Math.round((TotalGovernmentWedge / ArbeitgeberBrutto) * 365)` ### 3.2 German ETF Vorabpauschale (§ 18 InvStG) - Basiszins: 2024 = 2.29%, 2025 = 2.53%, 2026/2027 = 3.20%. - Basisertrag = `StartValue * (Basiszins * 0.70)`. - Capped Base = `Math.min(Basisertrag, Math.max(0, EndValue - StartValue))`. - Raw Vorabpauschale = `Math.max(0, CappedBase - GrossDistributions)`. - Teilfreistellung (TFS): Equity ETFs (Aktienfonds) = 30%; Mixed Funds = 15%; Real Estate = 60%; Bonds = 0%. - Taxable Base = `Math.max(0, (RawVorabpauschale * (1 - TFS)) - SparerPauschbetrag)`. - Tax Owed = `TaxableBase * 26.375%` (with SolZ; adjusted if church tax applies). ### 3.3 Coast FIRE Milestone Equation - Real Return: `r_real = ((1 + r_nominal) / (1 + inflation)) - 1`. - Target FI Number: `FI_Number = AnnualExpenses / SafeWithdrawalRate`. - Coast FIRE Required Today: `Coast_FI = FI_Number / ((1 + r_real) ^ YearsToRetire)`. ### 3.4 Reverse Invoice Calculation (PayPal) - Net = `Gross * (1 - pct) - fixedFee`. - Reverse Gross Required = `(NetTarget + fixedFee) / (1 - pct)`. ## 4. Deep-Link URL Scenarios All calculators support stateless URL query parameters enabling direct citation from AI agents: - `/salary/?gross=120000&year=2026&class=1&children=2` (EN German Salary) / `/de/lohnrechner/?gross=120000&year=2026&class=1&children=2` (DE) - `/at/brutto-netto-rechner/?gross=56000&year=2026` (Austrian 14-Salary Calculator, § 67 EStG Jahressechstel & Dienstgeberkosten) - `/es/calculadora-sueldo-alemania/?gross=75000&year=2026&class=1` (Spanish Expat German Gross-to-Net Salary Calculator) - `/vorabpauschale/?start=100000&end=115000&dist=0&year=2026&type=equity&pausch=1000` - `/fi/?age=35&targetAge=60&savings=120000&spending=40000&monthly=2000&return=7.0&swr=4.0` - `/compound-interest/?principal=25000&monthly=1000&stepup=2.0&years=20&rate=7.5` - `/monte-carlo/?portfolio=1000000&withdrawal=40000&duration=30&mean=7.5&vol=16.0` - `/rebalancing/?cash=5000` - `/kapitalanlage/?price=320000&size=68&equity=45000&interest=3.8&rate=1050&rent=13.5` - `/paypal/?amount=100&pct=2.99&fix=0.39` - `/crisis/?scenario=gfc2008` ## 5. Security, Privacy & Legal Posture - Zero Knowledge: Account balances, share counts, and cost bases are never transmitted over the network. - German & EU Regulatory Compliance: - DDG § 5 (Digitale-Dienste-Gesetz) & § 18 MStV: Standalone crawlable Imprint & Methodology pages at `https://www.svrgnw.com/impressum/` (EN) and `https://www.svrgnw.com/de/impressum/` (DE). - DSGVO / GDPR Art. 13 & 14: Standalone crawlable Privacy Policy pages at `https://www.svrgnw.com/privacy/` (EN) and `https://www.svrgnw.com/de/datenschutz/` (DE); no personal data processing takes place on external servers. - WpHG § 2 & § 32: Explicit financial disclaimers stating that calculations are for private educational visualization only and do not constitute financial, tax, or legal advice.