investfly.models.portfolio.OptionPositionGroup
SDK model for a multi-leg option position group as exposed to user strategy code.
@dataclass
class
OptionContractSnapshot:
Per-leg view derived from a live open position matched to a persisted group leg.
Java persists only grouping keys. Price, quantity, contract unit, expiry, and option-right fields come from the currently-open broker/paper position and option symbol parsing.
@dataclass
class
OptionPositionGroup:
Group-level view used by strategy code (live + backtest).
Exit decisions (closeBeforeDte, profit/loss-based exits) are evaluated per-group rather than
per-leg. The runtime fills legs from Java's reconciled open-position-group endpoint, not
raw overlay table rows. Legs may include the underlying stock/ETF for buy-write structures
that were opened atomically.