Initial commit: Vault Dashboard for options hedging

- FastAPI + NiceGUI web application
- QuantLib-based Black-Scholes pricing with Greeks
- Protective put, laddered, and LEAPS strategies
- Real-time WebSocket updates
- TradingView-style charts via Lightweight-Charts
- Docker containerization
- GitLab CI/CD pipeline for VPS deployment
- VPN-only access configuration
This commit is contained in:
Bu5hm4nn
2026-03-21 19:21:40 +01:00
commit 00a68bc767
63 changed files with 6239 additions and 0 deletions

40
app/strategies/base.py Normal file
View File

@@ -0,0 +1,40 @@
from __future__ import annotations
from abc import ABC, abstractmethod
from dataclasses import dataclass
from app.models.portfolio import LombardPortfolio
@dataclass(frozen=True)
class StrategyConfig:
"""Common research inputs used by all strategy implementations."""
portfolio: LombardPortfolio
spot_price: float
volatility: float
risk_free_rate: float
class BaseStrategy(ABC):
"""Abstract strategy interface for paper-based hedge analysis."""
def __init__(self, config: StrategyConfig) -> None:
self.config = config
@property
@abstractmethod
def name(self) -> str: # pragma: no cover - interface only
raise NotImplementedError
@abstractmethod
def calculate_cost(self) -> dict:
raise NotImplementedError
@abstractmethod
def calculate_protection(self) -> dict:
raise NotImplementedError
@abstractmethod
def get_scenarios(self) -> list[dict]:
raise NotImplementedError