Skip to main content

Function: isNoMarket

isNoMarket(error): boolean

True when a failure means "there is no market to trade this pair": NO_POOL_AVAILABLE (no pool at any fee tier), INSUFFICIENT_LIQUIDITY (a pool too thin to quote), UNKNOWN_TOKEN (the DEX has no trading symbol for the token), or a READ that was answered 404 (a quote the backend cannot find, error.notFound). It replaces an app's own code === ... || code === ... || notFound list, so the empty-state ("No market for this pair") has one definition.

A write that was answered 404 (it carries a uniqueKey) is a missing route, not a missing market, and is not this. Accepts an SDK error or a plain-object view (FailureView); every other value is false.

Parameters​

ParameterType
errorunknown

Returns​

boolean

Example​

if (isNoMarket(error)) showEmptyState(t('swap.noMarket')); else showError(error);