toUnifiedQuoteFromOnchain
Build a UnifiedQuote from an on-chain Quote, without merging. Useful for a single-row projection of a raw on-chain read.
The lifecycle is derived from the quote’s QuoteStatus — open and pending statuses stay ONCHAIN, a pending close becomes CLOSING, a closed/cancelled/expired quote becomes CLOSED, and a liquidated quote becomes FAILED. Every amount is already 18-decimal wei on the on-chain struct, so it carries through untouched.
import { toUnifiedQuoteFromOnchain } from "@symmio/trading-core";
const row = toUnifiedQuoteFromOnchain(quote);Parameters
quoteQuoterequiredThe on-chain quote/position struct (from getQuote / getPartyAOpenPositions).
Returns
The unified row, origin: "onchain", keyed onchain:<id>, with raw.onchain carrying the source struct.
Related
- UnifiedQuote — the returned shape.
getQuote— the raw on-chain struct this folds.- reconcileQuotes — runs this internally over the on-chain inputs.
Last updated on