getZapQuote.
How to Request Zap Quotes
To get started, here is a simple example of how to request a quote for zapping 1 USDC into a yield-bearing position on Arbitrum.buildZapTxn.
Zap Quote Request Parameters
ThegetZapQuote function expects a ZapQuoteRequest object, which specifies a desired zap operation and includes all the information needed to calculate the most efficient route.
Request Parameters
account, recipient, and refundee are optional for quoting but become
required when building the transaction with buildZapTxn.Integrator Fee Configuration
Theintegrator field allows you to configure integrator fees for your transactions. This enables you to earn fees on transactions routed through your integration.
ZapIntegratorConfig Type
Example with Integrator Fee
Integrator fees are optional and only need to be included if you want to earn
fees on transactions. The fee is deducted from the input amount and sent to
the specified integrator wallet.
Understanding the Response
The response contains detailed information about the zap route:Key Response Fields
approvalData- Array of token approvals required before executing (empty array if none needed)output- The final output amount(s) of the whole zap (top-level, not per-step)dust- Any leftover/unswept amounts produced by the routepath- Array of steps that will be executed in the zap operationpath[].action- The type of operation (swap, deposit, withdraw, etc.)path[].protocol- Information about the protocol used for this steppath[].input/output- Detailed asset information including amounts and USD values (eachoutputentry includesminAmount, the minimum guaranteed return)path[].fee- Fee breakdown for each steppath[].estimatedDuration- Expected time for this step to complete
Working with Zap Quote Results
Advanced Examples
Cross-Chain Liquidity Provision
Bundling Multiple Actions
UsegetZapBundleQuote to quote several zap actions (e.g. multiple deposits, or a swap plus a deposit) in a single request. It returns the same ZapQuoteResponse shape as getZapQuote.
ZapBundleSrcToken is { address: string; amount?: string }, srcToken on each action accepts either a single object or an array of them.
Next Steps
Once you have received a zap quote, you can proceed to:- Execute the zap transaction on the blockchain
- Track the status of your zap
Before executing zaps, tokens typically require approval to allow the DZap
contracts to spend them on your behalf. Learn more about gas-optimized
approval mechanisms in the Approval Mechanisms
section.