toUnifiedQuoteFromInstantOpen
Build an optimistic UnifiedQuote from a pending instant-open record, without merging. Useful when a consumer wants a single-row projection — e.g. adding an optimistic row before the reconciler has run.
The hedger reports human-scaled decimal strings; this normalizes price, quantity, and the locked legs to 18-decimal wei. The row is OPTIMISTIC (no fill, no on-chain id yet) and keyed temp:<tempId>.
import { toUnifiedQuoteFromInstantOpen } from "@symmio/trading-core";
const row = toUnifiedQuoteFromInstantOpen(pending);Parameters
pendingPendingInstantOpenrequiredA normalized pending instant-open record (from getInstantOpens).
Returns
The unified row, origin: "offchain", lifecycle: OPTIMISTIC, keyed temp:<tempQuoteId>.
Related
- UnifiedQuote — the returned shape.
- reconcileQuotes — runs this internally over the
instantOpensinput. - Solvers —
getInstantOpensproduces thePendingInstantOpeninput.
Last updated on