White-label crypto swap: what you still need to build
Compare a swap widget, SDK and direct API integration, including ownership of wallet state, fee disclosure, support and operational controls.
Explore the reference
Handle precision, validation, reliability and the operating details behind a swap interface.
69 guides · Page 1 of 4
Compare a swap widget, SDK and direct API integration, including ownership of wallet state, fee disclosure, support and operational controls.
Preserve unknown transaction outcomes after broadcast timeouts and reconcile before constructing another swap.
Distinguish contract reverts from insufficient gas when a swap transaction cannot be estimated.
Use receipt status and actual output evidence to distinguish submitted, mined, successful and economically reconciled swaps.
Deduplicate intent fill events and keep settled amounts, remaining quantity and terminal status independently reconcilable.
Coordinate account nonces for approval and swap transactions, including concurrent workers and external wallet activity.
Calculate a native-asset Max amount with a fee reserve and revalidate it when the route or gas estimate changes.
Track intent submission, acceptance and settlement as separate states with distinct order and transaction identities.
Build a compact fixture matrix around dangerous state transitions, provider responses and numerical edge cases.
Represent cancellation as a requested action until the provider or chain confirms that the unfilled order can no longer execute.
Verify each RPC endpoint’s chain identity before using its balances, allowances, simulations or transaction submission.
Compare net quote economics by identifying included fees, separate gas costs and uncertainty in token-to-USD conversions.
Parse decimal token inputs into exact base-unit integers and preserve them through JSON and wallet serialization.
Specify origin checks, wallet authority and verified settlement events at the boundary between a swap widget and its host.
Monitor provider response contracts with semantic assertions and safe preview requests, while avoiding unintended firm-order traffic.
Apply explicit integer rounding policies to tiny swap amounts, minimum outputs and display values.
Apply bounded retries and shared backpressure to throttled quote requests, respecting Retry-After without assuming fixed quotas.
Handle ERC-20 false returns and missing return data according to compatible contract wrappers rather than assuming every token behaves identically.
Implement a receipt-aware zero-first allowance sequence for tokens that reject replacing one nonzero approval with another.
Bind quote, allowance and signature state to the connected account and protect it from late results after a wallet switch.