Swap APIs & SDKs

Use the 0x issues object to drive the swap screen

Turn 0x quote issues into separate allowance, funding, simulation and request-configuration states.

The 0x issues object should influence application state before a wallet prompt appears. Collapsing every issue into “quote failed” hides actions the interface can explain precisely.

The official issue reference distinguishes allowance, balance, incomplete simulation and invalid source filters. These observations have different remedies:

ObservationApplication response
Allowance issueShow the required token permission and documented spender
Balance issueExplain the funding shortfall and keep execution unavailable
Simulation incompleteResolve validation uncertainty before treating the payload as ready
Invalid sourcesCorrect adapter configuration rather than asking the user to approve

Do not confuse a price with readiness

A browsing price can remain useful when a user lacks sufficient balance. Label it as an estimate and preserve its request context. The same observation at final review should prevent the interface from presenting a misleading executable state.

Likewise, incomplete simulation is not proof that the swap will fail, but it is not a successful validation. Check whether the actual taker was supplied, whether prerequisites have settled and whether a supported local simulation can resolve the uncertainty.

Re-evaluate after prerequisites change

After an approval receipt, refresh the relevant allowance and request a current quote. Clearing an issue in local state without reading new evidence can leave a stale spender or amount attached to the form.

Preserve structured issue information for diagnostics, but translate it into concise user-facing actions. A malformed source filter belongs in engineering telemetry; repeatedly telling the user to reconnect a wallet will not fix it.

A focused fixture combines sufficient funds with insufficient allowance, then sufficient allowance with incomplete simulation. The screen should choose distinct next actions rather than applying one generic retry button to both.

Sources & verification (1)

Source-check date is recorded in the article details. URLs are provided for manual verification. Use Copy to keep this page open.

  1. Issues & Error Codes

    Distinct allowance, balance and incomplete simulation issues

    https://docs.0x.org/docs/introduction/api-issues

Continue reading

Handle liquidityAvailable false in 0x responses Implement the 0x AllowanceHolder swap path