feat(EXEC-001A): add named strategy templates

This commit is contained in:
Bu5hm4nn
2026-03-24 12:27:39 +01:00
parent 78a01d9fc5
commit 2161e10626
10 changed files with 949 additions and 61 deletions

View File

@@ -6,6 +6,8 @@ from typing import Any
from nicegui import ui
from app.services.strategy_templates import StrategyTemplateService
NAV_ITEMS: list[tuple[str, str, str]] = [
("overview", "/", "Overview"),
("hedge", "/hedge", "Hedge Analysis"),
@@ -38,33 +40,7 @@ def portfolio_snapshot() -> dict[str, float]:
def strategy_catalog() -> list[dict[str, Any]]:
return [
{
"name": "protective_put",
"label": "Protective Put",
"description": "Full downside protection below the hedge strike with uncapped upside.",
"estimated_cost": 6.25,
"max_drawdown_floor": 210.0,
"coverage": "High",
},
{
"name": "collar",
"label": "Collar",
"description": "Lower premium by financing puts with covered call upside caps.",
"estimated_cost": 2.10,
"max_drawdown_floor": 208.0,
"upside_cap": 228.0,
"coverage": "Balanced",
},
{
"name": "laddered_puts",
"label": "Laddered Puts",
"description": "Multiple maturities and strikes reduce roll concentration and smooth protection.",
"estimated_cost": 4.45,
"max_drawdown_floor": 205.0,
"coverage": "Layered",
},
]
return StrategyTemplateService().catalog_items()
def quick_recommendations(portfolio: dict[str, Any] | None = None) -> list[dict[str, str]]:
@@ -73,7 +49,7 @@ def quick_recommendations(portfolio: dict[str, Any] | None = None) -> list[dict[
return [
{
"title": "Balanced hedge favored",
"summary": "A collar keeps the current LTV comfortably below the margin threshold while limiting upfront spend.",
"summary": "A 95% protective put balances margin-call protection with a lower upfront hedge cost.",
"tone": "positive",
},
{