Skip to content

Bug: StrategyType.BUTTERFLY mapped to _create_iron_condor — returns wrong strategy name, structure, and P&L #59

Description

@bradsmithmba

Summary

_get_builder_map() maps StrategyType.BUTTERFLY to _create_iron_condor. When a butterfly is recommended by the factory, the caller receives an iron condor payload: strategy_name: 'Iron Condor', 4 OTM legs, net_credit semantics, and iron condor P&L math. A butterfly has a different leg structure, different max profit location, and different risk profile. This is not an approximation — the returned data is factually wrong for a butterfly.

Evidence

src/api/enhanced_strategy_recommender.py line 106:

StrategyType.BUTTERFLY: self._create_iron_condor,

_create_iron_condor returns strategy_name: 'Iron Condor' with no butterfly-specific fields.

Fix

Implement _create_butterfly with the correct 3-strike structure (buy 1 ITM, sell 2 ATM, buy 1 OTM call), or remove BUTTERFLY from the builder map so it is explicitly skipped rather than silently misrepresented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions