shouldAccelerateOnchainReads
Decide whether the on-chain reads specifically should poll at the accelerated interval — the RPC-lag retry. Unlike shouldAccelerateQuotePolling (which is true for every mid-transition stage, including the purely off-chain ones), this is true only while a row awaits on-chain confirmation: WRITE_ONCHAIN, WRITE_ONCHAIN_CLOSE, or CLOSING. The off-chain stages (OPTIMISTIC / PRICE_FILLED / OPTIMISTIC_CLOSE / CLOSE_PRICE_FILLED) have nothing on-chain to read before the anchor, so they must not drive on-chain polling.
import { shouldAccelerateOnchainReads } from "@symmio/trading-core";
const onchainInterval = shouldAccelerateOnchainReads(result) ? 1_500 : false;Parameters
resultReconcileQuotesResultrequiredThe latest reconciliation result from reconcileQuotes.
Returns
booleantrue when at least one row is awaiting on-chain confirmation (WRITE_ONCHAIN / WRITE_ONCHAIN_CLOSE / CLOSING).
Related
- shouldAccelerateQuotePolling — the broader predicate for all mid-transition stages.
- QuoteLifecycle — the stages this checks.
- reconcileQuotes — produces the
ReconcileQuotesResultinput.
Last updated on