Skip to main content
GET
https://starknet.api.avnu.fi
/
swap
/
v3
/
quotes
curl "https://starknet.api.avnu.fi/swap/v3/quotes?sellTokenAddress=0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7&buyTokenAddress=0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d&sellAmount=0x2386f26fc10000"
[
  {
    "quoteId": "69ee30c9-5051-479e-9366-bde0584a2614",
    "sellTokenAddress": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
    "sellAmount": "0x2386f26fc10000",
    "sellAmountInUsd": 28.2265,
    "buyTokenAddress": "0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
    "buyAmount": "0xd005a71ea99678000",
    "buyAmountInUsd": 28.25618,
    "fee": {
      "feeToken": "0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
      "avnuFees": "0xda475abf000",
      "avnuFeesInUsd": 0.000002,
      "avnuFeesBps": "0xf",
      "integratorFees": "0x0",
      "integratorFeesInUsd": 0.0,
      "integratorFeesBps": "0x0"
    },
    "chainId": "0x534e5f4d41494e",
    "blockNumber": "0x3ca1b4",
    "expiry": null,
    "routes": [
      {
        "name": "Nostra",
        "address": "0x49ff5b3a7d38e2b50198f408fa8281635b5bc81ee49ab87ac36c8324c214427",
        "percent": 0.55,
        "sellTokenAddress": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
        "buyTokenAddress": "0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
        "routes": [],
        "alternativeSwapCount": 0
      },
      {
        "name": "Ekubo",
        "address": "0x5dd3d2f4429af886cd1a3b08289dbcea99a294197e9eb43b0e0325b4b",
        "percent": 0.45,
        "sellTokenAddress": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
        "buyTokenAddress": "0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
        "routes": [],
        "alternativeSwapCount": 0
      }
    ],
    "gasFees": "0x19b1b3cb5956130",
    "gasFeesInUsd": 0.013633,
    "priceImpact": 10.51,
    "sellTokenPriceInUsd": 2825.618,
    "buyTokenPriceInUsd": 0.117692,
    "estimatedSlippage": 0.00032
  }
]

Overview

The quotes endpoint returns the best available swap routes with unique quote IDs for execution. Each quote includes:
  • Optimized routing across multiple DEXs
  • Gas estimation and fees
  • Slippage protection

Request

sellTokenAddress
string
required
Token address to sell (hex format)
buyTokenAddress
string
required
Token address to buy (hex format)
sellAmount
string
The amount of token user wants to sell. Either sellAmount or buyAmount required
buyAmount
string
The exact amount of token user wants to buy. Either sellAmount or buyAmount required
takerAddress
string
Address that will execute the swap
size
integer
Maximum number of quotes to return (range: 1-5)
integratorFees
string
Fee in basis points (e.g., “30” for 0.3%). When specified, integratorFeeRecipient and integratorName are required.
integratorFeeRecipient
string
Address to receive integrator fees. Required when integratorFees is specified.
integratorName
string
Your integration identifier for tracking
onlyDirect
boolean
If true, only return direct swap routes (no multi-hop)

Response

quoteId
string
required
Unique identifier for executing this quote (UUID)
sellTokenAddress
string
required
Token address being sold
sellAmount
string
required
Amount of token to sell (hex format)
sellAmountInUsd
number
required
USD value of sell amount
buyTokenAddress
string
required
Token address being purchased
buyAmount
string
required
Amount of token to receive (hex format). Already includes all fees.
buyAmountInUsd
number
required
USD value of buy amount
fee
object
required
Fee breakdown for the swap
chainId
string
required
Network identifier (e.g., “0x534e5f4d41494e”)
blockNumber
string
Block at which quote was generated (hex format)
expiry
number
Unix timestamp when quote expires in seconds
routes
array
required
Swap routing paths with protocol details
gasFees
string
required
Estimated gas cost in STRK (hex format)
gasFeesInUsd
number
Gas fees converted to USD
priceImpact
number
required
Price impact in USD and in bps
sellTokenPriceInUsd
number
Current market price of sell token in USD
buyTokenPriceInUsd
number
Current market price of buy token in USD
estimatedSlippage
number
Projected slippage percentage
curl "https://starknet.api.avnu.fi/swap/v3/quotes?sellTokenAddress=0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7&buyTokenAddress=0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d&sellAmount=0x2386f26fc10000"
[
  {
    "quoteId": "69ee30c9-5051-479e-9366-bde0584a2614",
    "sellTokenAddress": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
    "sellAmount": "0x2386f26fc10000",
    "sellAmountInUsd": 28.2265,
    "buyTokenAddress": "0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
    "buyAmount": "0xd005a71ea99678000",
    "buyAmountInUsd": 28.25618,
    "fee": {
      "feeToken": "0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
      "avnuFees": "0xda475abf000",
      "avnuFeesInUsd": 0.000002,
      "avnuFeesBps": "0xf",
      "integratorFees": "0x0",
      "integratorFeesInUsd": 0.0,
      "integratorFeesBps": "0x0"
    },
    "chainId": "0x534e5f4d41494e",
    "blockNumber": "0x3ca1b4",
    "expiry": null,
    "routes": [
      {
        "name": "Nostra",
        "address": "0x49ff5b3a7d38e2b50198f408fa8281635b5bc81ee49ab87ac36c8324c214427",
        "percent": 0.55,
        "sellTokenAddress": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
        "buyTokenAddress": "0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
        "routes": [],
        "alternativeSwapCount": 0
      },
      {
        "name": "Ekubo",
        "address": "0x5dd3d2f4429af886cd1a3b08289dbcea99a294197e9eb43b0e0325b4b",
        "percent": 0.45,
        "sellTokenAddress": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
        "buyTokenAddress": "0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
        "routes": [],
        "alternativeSwapCount": 0
      }
    ],
    "gasFees": "0x19b1b3cb5956130",
    "gasFeesInUsd": 0.013633,
    "priceImpact": 10.51,
    "sellTokenPriceInUsd": 2825.618,
    "buyTokenPriceInUsd": 0.117692,
    "estimatedSlippage": 0.00032
  }
]

Best Practices

With Starknet’s block time of ~2 seconds, quotes become stale after just 1 block. Refresh quotes every 2-3 blocks before execution.
Handle cases where no routes are available due to insufficient liquidity.