fix(pricing): correct relative hedge payoff calculations

This commit is contained in:
Bu5hm4nn
2026-03-25 19:27:26 +01:00
parent 5217304624
commit bfb6c71be3
6 changed files with 241 additions and 50 deletions

View File

@@ -134,29 +134,36 @@ class StrategyTemplateService:
def catalog_items(self) -> list[dict[str, Any]]:
ui_defaults = {
"protective_put_atm": {"estimated_cost": 6.25, "max_drawdown_floor": 210.0, "coverage": "High"},
"protective_put_otm_95": {"estimated_cost": 4.95, "max_drawdown_floor": 205.0, "coverage": "Balanced"},
"protective_put_otm_90": {"estimated_cost": 3.7, "max_drawdown_floor": 194.0, "coverage": "Cost-efficient"},
"protective_put_atm": {"estimated_cost": 6.25, "coverage": "High"},
"protective_put_otm_95": {"estimated_cost": 4.95, "coverage": "Balanced"},
"protective_put_otm_90": {"estimated_cost": 3.7, "coverage": "Cost-efficient"},
"laddered_put_50_50_atm_otm95": {
"estimated_cost": 4.45,
"max_drawdown_floor": 205.0,
"coverage": "Layered",
},
"laddered_put_33_33_33_atm_otm95_otm90": {
"estimated_cost": 3.85,
"max_drawdown_floor": 200.0,
"coverage": "Layered",
},
}
items: list[dict[str, Any]] = []
for template in self.list_active_templates():
strategy_name = self.strategy_name(template)
downside_put_legs = [
{
"allocation_weight": leg.allocation_weight,
"strike_pct": leg.strike_rule.value,
}
for leg in template.legs
if leg.side == "long" and leg.option_type == "put"
]
items.append(
{
"name": strategy_name,
"template_slug": template.slug,
"label": template.display_name,
"description": template.description,
"downside_put_legs": downside_put_legs,
**ui_defaults.get(strategy_name, {}),
}
)