Files
vault-dash/app/strategies/base.py
Bu5hm4nn 00a68bc767 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
2026-03-21 19:21:40 +01:00

41 lines
985 B
Python

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