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.
Lifecycle tracks the write progression (off-chain → on-chain), not the on-chain status: once a quote is on-chain it is ONCHAIN whether it is OPENED or CLOSE_PENDING — read quoteStatus for that distinction (e.g. a resting limit close is ONCHAIN + quoteStatus: CLOSE_PENDING). The off-chain stages (OPTIMISTIC*, *PRICE_FILLED) and the WRITE_ONCHAIN* “awaiting the RPC” 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",
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) or the limit-close anchor (InstantRequestToLimitClose) 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 ONCHAIN (with quoteStatus: CLOSE_PENDING) once
the on-chain read returns the quote.
CLOSED"closed"The position is fully closed.
FAILED"failed"A hedger or notification reported the open/close failed.
The WRITE_ONCHAIN* stages are exactly the ones shouldAccelerateOnchainReads treats as awaiting on-chain confirmation; every mid-transition stage above drives shouldAccelerateQuotePolling.
Related
- UnifiedQuote — carries
lifecycle. - QuoteStatus — the on-chain status this overlays, and what each one lets partyA do.
- applyNotificationToQuotes — advances a row’s lifecycle from notifications.
- shouldAccelerateQuotePolling — reads these stages to gate polling.