UnifiedQuote
A single quote/position row merged from every source — on-chain reads, pending instant-opens, pending instant-closes, and notifications — into one stable, de-duplicated shape. This is the primary abstraction quote and position UIs build against; every other function in this module reads or produces it.
All amount and price fields are 18-decimal-wei bigint, matching the on-chain Quote. Off-chain hedger amounts are normalized to wei before they reach this type. The key is a stable identity for React lists and the removal ledger; it migrates from temp:<tempId> to onchain:<id> when a row anchors, but the row’s identity is preserved. raw carries the untouched source rows for advanced use.
import type { UnifiedQuote } from "@symmio/trading-core";Fields
keystringonchain:<id> or temp:<tempId>). Survives the temp → on-chain anchor transition.originQuoteOriginlifecycleQuoteLifecyclequoteIdbiginttempQuoteIdnumberpartyAAddresspartyBAddressvaAddressAddresssymbolIdbigintsymbolId).positionTypePositionTypeorderTypeOrderTypequoteStatusQuoteStatusOn-chain status, when the row is anchored on-chain — the field that decides which writes the quote accepts.
requestedOpenPricebigintopenedPricebigintinitialOpenedPricebigintavgClosedPricebigintrequestedClosePricebigintmarketPricebigintquantitybigintclosedAmountbigintopenQuantitybigintRemaining open size (wei): quantity − closedAmount, the live quantity still on the position (the figure a UI
shows as “position size”); 0 once fully closed. A size, never a state — a quote that has not opened yet still
reports its full quantity here, so classify with isPendingOrder /
isActivePosition, not with openQuantity > 0.
quantityToClosebigintlockedValuesLockedValuesinitialLockedValuesLockedValuesmaxFundingRatebigintaccumulatedPaidFundingbigintPer-unit cumulative funding-rate index at the quote’s last settlement (18-decimal fixed point, cost-positive), when
known — not an amount. The contract measures the next charge from it, so summing it across quotes is
meaningless. For money, read settled funding with getQuoteFunding and pending
funding with getQuotePendingFunding; see
Funding.
lastFundingPaymentTimestampbigintdeadlinebiginttradingFeebigintcloseFeebigintaffiliateAddresspartyBsWhiteListreadonly Address[]parentIdbigintdataHexcreateTimestampbigintstatusModifyTimestampbigintraw{ onchain?; instantOpen?; instantClose? }Quote (onchain), the PendingInstantOpen (instantOpen), and/or the PendingInstantClose (instantClose) it was merged from.Related
- QuoteOrigin — the
originfield. - QuoteLifecycle — the
lifecyclefield. - QuoteStatus — the
quoteStatusfield, and what each status lets partyA do. - toUnifiedQuoteFromOnchain — builds a row from an on-chain
Quote. - reconcileQuotes — produces the merged
UnifiedQuote[].