Skip to main content

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

QuoteRequest
required
Quote request parameters
AvnuOptions
Optional SDK configuration

Returns

Returns Promise<Quote[]> - Array of quotes sorted by best output first.

Quote Interface

Fee Interface

Route Interface

Example

Quote Response

Best Practices

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:
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.
The SDK uses native bigint for all token amounts. Use parseUnits() from ethers to convert decimal amounts:
Always include your app name for better support:

Execute Swap

Execute the swap using a quote