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

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.

2. Build the transaction

Pass the priceRoute verbatim and a slippage tolerance (basis points):
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