Multi-token execution

Batch and Multi-Token Swaps

Moving several assets through DeFi should not require manually comparing every liquidity source. DZap provides developer-facing route discovery and execution-building tools for supported swap and liquidity workflows.

Read DZap swap documentation

What is a batch swap?

A batch swap is a workflow where a user wants to exchange multiple input assets or allocate tokens across multiple destinations. The requested result may require separate liquidity routes, approvals, or transactions depending on network and provider constraints.

Batching is not automatically the same as a single atomic on-chain transaction. Integrators should confirm exactly which legs can execute together and what happens if one leg fails.

Plan the execution

Identify the starting chain and token addresses, fetch current token decimals and balances, and request available quotes from DZap. Present expected output, estimated fees and route selection before constructing a transaction.

  • Specify inputs and destination assets with exact chain/token identifiers.
  • Apply slippage bounds and compare net output after known fees.
  • Review approval and wallet-signature requirements for every step.
  • Track executed transactions and handle partial or failed routes explicitly.

For developers building wallets or dApps

DZap's API and SDK can reduce the need to build a separate quote or integration surface for each supported swap provider. The precise method signatures and supported batch functionality are described in the current documentation.

Keep API keys server-side where required, validate response freshness and display transaction-critical terms to the user before asking for a signature.

Where aggregation stops

Quotes can change as pools move, gas costs update and bridging conditions change. Multi-token flows can produce residual balances when a swap rounds down or a later step cannot execute. Simulate and reconcile expected versus actual balances before promising a no-dust outcome.

Frequently asked questions

Can I swap multiple tokens in one transaction?

Some supported routes can be combined, but one-transaction execution is not guaranteed for every chain, provider or set of tokens. Verify the selected route and contract execution path in the current product documentation.

How should I set slippage?

Use an explicit user-approved slippage bound, assess each route's minimum expected output, and account for price changes between quoting, simulation and transaction inclusion.

Is a failed leg refunded automatically?

Refunds and partial-completion behavior depend on the route and bridge/provider. Check per-provider status and fallback procedures before describing a workflow as atomic.