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.

); }