getTradeQuotes.
Rate Limits: Our API and SDK have rate limits in place to ensure fair
usage. If you need increased rate limits for your application, please reach
out to our team on Telegram.
How to Request Trade Quotes
To get started, here is a simple example of how to request quotes to bridge and swap 1 USDC on Arbitrum to ETH on Base.recommendedSource, bestReturnSource (fallback), and quoteRates. Transaction data is not included and must be built separately for trade() or buildTradeTxn().
Trade Quotes Request Parameters
ThegetTradeQuotes function expects a TradeQuotesRequest object, which specifies a desired trade and includes all the information needed to calculate the most efficient routes.
Request Parameters
TradeQuotesRequestData Parameters
Quote Filter Options
You can filter quotes based on different criteria:all- Returns all available quotes. This is the default option and provides the fastest response time.best- Return only the best quotefastest- Return the fastest execution time quote (for bridge operations)
Advanced Quote Configuration
For applications requiring fine-tuned control over quote optimization, the SDK provides advanced configuration options:Advanced Parameters
TimingStrategy Configuration
ThetimingStrategy parameter allows fine-grained control over how the SDK optimizes quote collection:
minWaitTimeMs
maxWaitTimeMs
subsequentDelayMs
preferredResultCount
relaxMinSuccessOnDelay
Advanced Configuration Example
TypeScript Type Definition
Understanding the Response
The response contains detailed information about available routes:Key Response Fields
pair- Unique identifier for the trade pair (e.g.,42161_0xaf88..._8453_0x4200...). Can be generated usinggetTokensPairKey.recommendedSource- The provider ID of the recommended route; use this when building the trade request.bestReturnSource- Best return provider for this pair;quoteRates- Object containing detailed quotes per provider (keyed by provider ID).tokensWithoutPrice- Tokens that don’t have price data available.
Working with Quote Results
Next Steps
Once you have received quotes, you can proceed to:- Execute the trade (build
TradeBuildTxnRequestDatafrom the quote, then calltrade()) - Track the status of your trade
Before executing trades, 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.