Skip to Content
Symmio Trading-SDK — the SDK surface for builders on Arbitrum
CoreUnified QuotessupportsQuoteGrouping

supportsQuoteGrouping

Whether grouped positions are defined for a sub-account’s isolation type. Only MARKET_DIRECTION groups.

import { groupQuotes, supportsQuoteGrouping } from "@symmio/trading-core"; const sub = await getSubAccount(config, { account: subAccount }); if (supportsQuoteGrouping(sub.isolationType)) { const groups = groupQuotes(positions, sub.isolationType); } else { // render flat rows — this account has no market + side cohorts }

Why only MARKET_DIRECTION

MARKET_DIRECTION is the one isolation where a market + side cohort is a real on-chain unit: the AccountLayer allocates one Virtual Account per market + direction, so every quote in the cohort shares a VA, a margin pool, and a liquidation fate. Folding them into a single row aggregates values that genuinely belong together, and a group-level action — group close, grouped TP/SL — acts on quotes the protocol already treats as one position.

Under the other isolations the same fold is a fiction:

IsolationWhat the account actually holdsWhy grouping misleads
POSITIONone VA per tradeA market + side row would merge separately-liquidated VAs into one buffer.
MARKETone VA per market, both sides in itSplitting by side cuts a VA in half; the row’s margin and equity understate it.
CUSTOMno automatic VAs — cross-margin on the sub-accountThere are no cohorts at all; every position shares one margin pool.

So groupQuotes rejects them outright rather than returning numbers that do not correspond to anything on-chain. When you want a different fold anyway, ask for it explicitly with a { keyOf }keyQuoteByMarket and keyQuotePerQuote cover the common shapes.

Parameters

isolationTypeSubAccountIsolationTyperequired

The subaccount’s on-chain isolation type, from getSubAccount(...).isolationType.

Returns

boolean
true only for SubAccountIsolationType.MARKET_DIRECTION.

assertQuoteGroupingSupported

The throwing counterpart, for call sites that would rather fail loudly than branch.

import { assertQuoteGroupingSupported } from "@symmio/trading-core"; assertQuoteGroupingSupported(sub.isolationType); // throws SymmError { kind: "validation", code: "UNSUPPORTED_GROUPING_ISOLATION" }
isolationTypeSubAccountIsolationTyperequired

The subaccount’s on-chain isolation type.

void

Returns nothing on success; throws SymmError with code UNSUPPORTED_GROUPING_ISOLATION for any isolation type other than MARKET_DIRECTION.

Last updated on