Skip to Content
Symmio Trading-SDK — the SDK surface for builders on HyperEVM
CoreUnified QuotestoUnifiedQuoteFromInstantClose

toUnifiedQuoteFromInstantClose

Build a CLOSING UnifiedQuote from a pending instant-close record, without merging.

A close record carries only the quote id and close amounts (already wei), so the market/side metadata is supplied via context — typically copied from the matching on-chain row. Reconciliation overlays closes onto the existing on-chain row directly; this helper is exposed for consumers that want to render a standalone close-only row when the on-chain row is not available.

import { toUnifiedQuoteFromInstantClose } from "@symmio/trading-core"; const row = toUnifiedQuoteFromInstantClose(pending, { partyA, symbolId, positionType, orderType, });

Parameters

pendingPendingInstantCloserequired

A normalized pending instant-close record (from getInstantCloses).

contextToUnifiedQuoteFromInstantCloseContextrequired

Market/side metadata for the targeted position — the fields a close record does not carry. See below.

The context object (ToUnifiedQuoteFromInstantCloseContext) identifies the position the close targets:

partyAAddressrequired

Sub-account (partyA) that owns the position being closed.

symbolIdbigintrequired

Market identifier of the position being closed.

positionTypePositionTyperequired

Side of the position being closed.

orderTypeOrderTyperequired

Order type of the position being closed.

Returns

The unified row, origin: "onchain", lifecycle: CLOSING, keyed onchain:<quoteId>. Open-side fields (requestedOpenPrice, quantity, openQuantity) are 0n — they come from the on-chain row when available.

  • UnifiedQuote — the returned shape.
  • reconcileQuotes — overlays closes onto the on-chain row directly, rather than producing standalone close rows.
  • SolversgetInstantCloses produces the PendingInstantClose input.
Last updated on