aggregateGroupMetrics
Compute the pure, price-independent QuoteGroupMetrics for a set of child quotes. Called for you by groupQuotes; exported so a consumer can re-aggregate an arbitrary subset (for example, only the legs a user selected).
openQuantity/quantityare plain sums.initialNotional = Σ(quantity × (initialOpenedPrice ?? requestedOpenPrice))— the frozen at-open notional; partial closes do not shrink it.weightedOpenPrice = Σ(openQuantity × openPrice) / Σ openQuantity, suppressed when there is no open size or any child has an unsettled open price.leveragedivides the at-open notional by Σ of every locked leg, each child preferring its frozeninitialLockedValues.
Pure and order-independent. Empty input yields all-zero amounts with the optional fields undefined.
Parameters
The group’s child quotes.
Returns
The aggregated metrics.
Last updated on