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

toGroupTpSlOrders

Flatten a grouped position’s children into one row per live-or-desired TP/SL order — the data behind an overview list where each order can be inspected or cancelled individually.

Take profit precedes stop loss within a child; children keep input order. sizePercent is the child’s share of the group’s total open notional (not of the covered notional), so a partially covered group’s rows sum to less than 100%.

import { toGroupTpSlOrders } from "@symmio/trading-core"; const orders = toGroupTpSlOrders(children); const live = orders.filter((order) => order.hasLiveOrder);

A row that exists only as a local edit reports the snapshot’s state ("canceled" when there is no server order) — branch on hasLiveOrder, not on state.

Parameters

The grouped position’s children.

options.overridesGroupTpSlDesiredMapoptional

Pending per-child edits that win over the confirmed snapshot.

Returns

One row per side that carries a trigger.

Last updated on