Invalidate quotes when the wallet changes chain
Reset wallet-dependent execution state on chain changes and reject late responses from the previously selected network.
Explore the reference
Handle precision, validation, reliability and the operating details behind a swap interface.
69 guides · Page 2 of 4
Reset wallet-dependent execution state on chain changes and reject late responses from the previously selected network.
Choose transport batching or contract Multicall according to state consistency, call context and failure isolation.
Persist stable swap attempt identities and reconcile them with receipts or order evidence after a reload.
Separate chain identity, token configuration, RPC settings and provider capabilities so unsupported combinations fail explicitly.
Design a narrow backend quote proxy that protects service credentials without taking control of users’ wallet keys.
Treat recent receipts as provisional and reconcile swaps when their inclusion block is no longer canonical.
Minimize and redact diagnostic data in quote and transaction logs while retaining identifiers needed for support.
Announce approval and swap status changes clearly without relying on color, focus jumps or constantly repeating quote updates.
Instrument the swap funnel by stage and correlate quote, approval, wallet, broadcast and receipt events without storing secrets.
Represent basket swaps with explicit asset amounts, output constraints and atomicity instead of reusing a single-pair form.
Translate native currency through a provider-specific adapter rather than assuming one placeholder address works everywhere.
Create a common quote model that preserves provider-specific execution types, cost units and missing values.
Convert slippage fractions, percentages and basis points explicitly and test provider boundaries with equivalent values.
Separate token approval to Permit2 from Permit2 permission to a downstream spender and track their different lifetimes.
Keep native transaction value intact through API normalization, simulation and wallet submission.
Refresh rebasing token balances from current state and avoid treating Transfer logs as a complete balance history.
Preserve quote and simulation block context so differences can be investigated without pretending routes are immutable.
Separate wallet connectivity from public transaction observation so disconnecting cannot erase or mislabel pending swaps.
Render token labels, logos and links as untrusted external data, even when they arrive from a legitimate quote API.
Collect evidence that a swap integration preserves user intent, handles uncertain outcomes and can stop new execution safely.