Skip to Content
Symmio Trading-SDK — the SDK surface for builders on Arbitrum
CoreTP/SLsummarizeQuoteGroupTpSl

summarizeQuoteGroupTpSl

Fold a grouped position’s children into one QuoteGroupTpSlSummary — per-side counts, the uniform-vs-mixed display state, and notional-weighted coverage — in a single pass.

This is the data model behind a TP/SL (N quotes) table cell. Three display states per side:

displayConditionRender
"none"No child carries a trigger”Not set”
"uniform"Every child carries the same trigger price and price typeThe price itself
"mixed"Some children carry one, or the values differThe count / covered share

Coverage is notional-weighted, not count-weighted. A group of one 9-unit leg and one 1-unit leg with only the small leg protected reports 10%, not 50% — because the number a trader needs is how much value is exposed, not how many rows are ticked.

import { summarizeQuoteGroupTpSl } from "@symmio/trading-core"; const summary = summarizeQuoteGroupTpSl(children); if (summary.isEmpty) return "Not set"; if (summary.takeProfit.display === "uniform") return summary.takeProfit.price; return `${summary.takeProfit.count} TP`;

Pass an editor’s buffer as overrides for a live readout while the trader types — an explicit "" trigger price clears that side.

Parameters

The grouped position’s children, from toGroupTpSlChildren.

options.overridesGroupTpSlDesiredMapoptional

Pending per-child edits that win over the confirmed snapshot, keyed by GroupTpSlChild.key. Omit for the confirmed-only view.

Returns

Per-side summaries plus the group’s total open notional and an isEmpty flag.

Last updated on