Overview
Get the best quotes from on-chain and off-chain liquidity sources. The SDK automatically converts amounts to the correct format and handles response parsing.SDK Method
Parameters
Quote request parameters
Optional SDK configuration
Returns
ReturnsPromise<Quote[]> - Array of quotes sorted by best output first.
Quote Interface
Fee Interface
Route Interface
Example
Quote Response
Best Practices
Use the avnu Token List
Use the avnu Token List
For the most reliable trading experience, always use the avnu Token List to filter for verified tokens. This avoids scams and ensures compatibility.SDK Method:
Always use fresh quotes
Always use fresh quotes
With Starknet’s block time of ~2 seconds, the likelihood of a quote becoming stale increases exponentially with each passing block. For the highest success rate, refresh quotes every block before execution.
Use bigint for amounts
Use bigint for amounts
The SDK uses native
bigint for all token amounts. Use parseUnits() from ethers to convert decimal amounts:Handle no routes case
Handle no routes case
Set integrator name
Set integrator name
Always include your app name for better support:
Related
Execute Swap
Execute the swap using a quote