QuoteLifecycle
The stage of a quote’s lifecycle as tracked across the on-chain and off-chain merge. Drives row styling and polling acceleration in the consumer. Enumerated so consumers can switch on it.
The off-chain stages (OPTIMISTIC, PRICE_FILLED), the WRITE_ONCHAIN* “awaiting the RPC” stages, and the transient close stages are SDK-side overlays — they do not exist on the on-chain QuoteStatus; reconciliation assigns them from notifications and hedger records.
enum QuoteLifecycle {
OPTIMISTIC = "optimistic",
PRICE_FILLED = "price-filled",
WRITE_ONCHAIN = "write-onchain",
ONCHAIN = "onchain",
OPTIMISTIC_CLOSE = "optimistic-close",
CLOSE_PRICE_FILLED = "close-price-filled",
WRITE_ONCHAIN_CLOSE = "write-onchain-close",
CLOSING = "closing",
CLOSED = "closed",
FAILED = "failed",
}Members
OPTIMISTIC"optimistic"Submitted to a hedger; no on-chain quote and no fill report yet.
PRICE_FILLED"price-filled"A hedger reported a fill price (InstantRFQ success) but the on-chain quote has not landed yet.
WRITE_ONCHAIN"write-onchain"The open anchored on-chain per the notification (the quoteId is known), but the on-chain read has not returned the
quote struct yet — shown with its anchored id while the SDK waits for the RPC. Resolves to ONCHAIN once the read
returns.
ONCHAIN"onchain"Anchored on-chain; mirrors a real QuoteStatus.
OPTIMISTIC_CLOSE"optimistic-close"A close was just submitted and the hedger’s pending-instant-close feed has it, but no close notification has
confirmed a price yet — the close-side analog of OPTIMISTIC.
CLOSE_PRICE_FILLED"close-price-filled"A close notification reported the close price/fill request (InstantRequestToClosePosition) — the close-side analog
of PRICE_FILLED.
WRITE_ONCHAIN_CLOSE"write-onchain-close"The close fill (FillMarketOrderInstantClose) was reported, or a pending instant-close overlays the row while the
on-chain status still shows the position open — the close is being written on-chain, awaiting the RPC. Resolves to
CLOSING once the on-chain status reflects the pending close.
CLOSING"closing"The close is confirmed pending on-chain — on-chain CLOSE_PENDING / CANCEL_CLOSE_PENDING.
CLOSED"closed"The position is fully closed.
FAILED"failed"A hedger or notification reported the open/close failed.
The WRITE_ONCHAIN* and CLOSING stages are exactly the ones shouldAccelerateOnchainReads treats as awaiting on-chain confirmation; every mid-transition stage above drives shouldAccelerateQuotePolling.
Related
- UnifiedQuote — carries
lifecycle. - applyNotificationToQuotes — advances a row’s lifecycle from notifications.
- shouldAccelerateQuotePolling — reads these stages to gate polling.