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

toGroupTpSlChildren

Build GroupTpSlChilds from a grouped position’s child quotes. This is the adapter every other grouped TP/SL helper takes as input — it is the only place in the slice that knows about UnifiedQuote.

Every quote produces a child, including off-chain ones. Those come back with quoteId: undefined so the summary still counts them — an unprotected leg genuinely drags coverage down — while planGroupTpSl skips them as "not-anchored".

Two derivations are worth knowing:

  • openPrice uses the same fallback aggregateGroupMetrics uses: openedPrice when settled and non-zero, else requestedOpenPrice.
  • virtualAccount is vaAddress ?? partyA, which for a Virtual-Account-scoped position is the VA itself — the address the conditional order must be signed for.
import { toGroupTpSlChildren, summarizeQuoteGroupTpSl } from "@symmio/trading-core"; const children = toGroupTpSlChildren(group.quotes, (quote) => tpslByKey.get(quote.key)); const summary = summarizeQuoteGroupTpSl(children);

Parameters

quotesreadonly UnifiedQuote[]required

The grouped position’s child quotes — QuoteGroup.quotes.

snapshotGroupTpSlSnapshotLookuprequired

Resolves each quote’s confirmed TP/SL snapshot. Receives the whole quote, so you can look up by key, by quoteId, or through a store index that aliases both. A missing snapshot becomes a blank one (both sides empty, both states "canceled").

Returns

One child per quote, in input order.

Last updated on