Skip to main content
POST
https://starknet.api.avnu.fi
/
swap
/
v3
/
build
curl -X POST "https://starknet.api.avnu.fi/swap/v3/build" \
  -H "Content-Type: application/json" \
  -d '{
    "quoteId": "0a5e3c8e-b5d2-4f1a-9c3d-7e6f5a4b3c2d",
    "takerAddress": "0x0123...abc",
    "slippage": 0.01,
    "includeApprove": true
  }'
{
  "calls": [
    {
      "contractAddress": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
      "entrypoint": "approve",
      "calldata": ["0x123...", "1000000000000000000", "0"]
    },
    {
      "contractAddress": "0x123abc...",
      "entrypoint": "swap",
      "calldata": ["0x049d...", "0x053c...", "1000000000000000000", "3150000000", "0"]
    }
  ]
}

Overview

Returns transaction calls needed to execute a swap based on a quote. You execute these calls with your account/wallet to complete the swap on-chain.

Request

quoteId
string
required
Unique quote identifier (UUID) from the /quotes endpoint
takerAddress
string
Address executing the swap (optional if provided during quote request)
slippage
number
required
Maximum acceptable slippage (range: 0-1, e.g., 0.01 for 1%, default: 0.05 for 5%)
includeApprove
boolean
required
If true, response includes approve call if necessary

Response

chainId
string
Network identifier (e.g., “0x534e5f4d41494e”)
calls
array
required
Transaction calls to execute
curl -X POST "https://starknet.api.avnu.fi/swap/v3/build" \
  -H "Content-Type: application/json" \
  -d '{
    "quoteId": "0a5e3c8e-b5d2-4f1a-9c3d-7e6f5a4b3c2d",
    "takerAddress": "0x0123...abc",
    "slippage": 0.01,
    "includeApprove": true
  }'
{
  "calls": [
    {
      "contractAddress": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
      "entrypoint": "approve",
      "calldata": ["0x123...", "1000000000000000000", "0"]
    },
    {
      "contractAddress": "0x123abc...",
      "entrypoint": "swap",
      "calldata": ["0x049d...", "0x053c...", "1000000000000000000", "3150000000", "0"]
    }
  ]
}