Skip to main content
A Market swap routes through DEX liquidity and settles in a single on-chain transaction that your user signs and broadcasts. This page walks the whole integration request by request: get a price route, build the calldata, approve the router, and send the transaction. Every example targets https://api.velora.xyz; no SDK required. Market is the right path when the user has gas and wants synchronous, atomic settlement. For gasless, MEV-protected swaps that Delta settles from a signed intent, use a Delta swap instead. For the conceptual model, see Market → How it works; for a typed wrapper, see SDK → Market.

The flow

1

Get a price route

GET /prices returns a priceRoute: the best path, the expected destAmount, and a gas estimate. See GET /prices.
2

Build the transaction

POST /transactions/{chainId} with the priceRoute passed verbatim and a slippage tolerance. You get ready-to-broadcast calldata. See build transaction.
3

Approve the router (ERC-20 only)

For an ERC-20 source, the user approves the Augustus v6.2 router as spender, or passes a permit in the build call to avoid the round-trip. Native source skips this. See Approvals and permit.
4

Sign and broadcast

The user signs the transaction and broadcasts it. Augustus walks the route and delivers destToken, or the whole transaction reverts.

1. Price

curl -G 'https://api.velora.xyz/prices' \
  --data-urlencode 'srcToken=0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE' \
  --data-urlencode 'destToken=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' \
  --data-urlencode 'amount=1000000000000000000' \
  --data-urlencode 'srcDecimals=18' \
  --data-urlencode 'destDecimals=6' \
  --data-urlencode 'side=SELL' \
  --data-urlencode 'network=1' \
  --data-urlencode 'userAddress=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045' \
  --data-urlencode 'partner=my-app-name' \
  --data-urlencode 'version=6.2'
The priceRoute is stateless and unsigned, just a routing plan, and it expires quickly as prices move. Market /prices takes network; the build call below takes chainId in its path.
{ "priceRoute": { "destAmount": "...", "gasCostUSD": "...", "...": "..." } }

2. Build the transaction

Pass the priceRoute verbatim and a slippage tolerance (basis points):
curl -X POST 'https://api.velora.xyz/transactions/1' \
  -H 'Content-Type: application/json' \
  -d '{
    "priceRoute": { "...": "the priceRoute from /prices, unchanged" },
    "srcToken": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
    "destToken": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
    "srcAmount": "1000000000000000000",
    "slippage": 50,
    "userAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
    "partner": "my-app-name"
  }'
{ "to": "0x...", "data": "0x...", "value": "1000000000000000000", "gas": "..." }
Pass the priceRoute exactly as /prices returned it. Mutating any field makes the build call reject.

3. Approve the router (ERC-20 only)

If the source token is an ERC-20, the user approves the Augustus v6.2 router (the to address) before swapping: a standard approve(spender, amount). Augustus v6.2 is the only spender to authorize. Native source tokens skip this; the build call returns the value to send with the swap directly. To avoid the extra round-trip, pass an EIP-2612 permit or Permit2 payload in the build call’s permit field instead of approving on-chain. See Approvals and permit for the full picture and build transaction for the field. Router addresses are in Chains & contracts.

4. Sign and broadcast

Send the { to, data, value } from the build response as a transaction from the user’s wallet. Augustus pulls the source token, walks the route, checks the result against the user’s minimum (price × 1 − slippage), and delivers destToken. If any hop fails or slippage is exceeded, the transaction reverts; there’s no partial-fill state.

Partner fee

Pass partner on /prices and the build call to attribute volume and capture a fee; add partnerAddress, partnerFeeBps, and partnerTakesSurplus to configure it. See Monetize for the field reference.
Last modified on June 17, 2026