The Market API splits a swap into price discovery (off-chain) and execution (on-chain). You ask for a route, you build calldata against that route, and your user signs and broadcasts the transaction. Settlement is atomic — the swap either completes in one transaction or reverts.Documentation Index
Fetch the complete documentation index at: https://new-docs.velora.xyz/llms.txt
Use this file to discover all available pages before exploring further.
The flow at a glance
The four stages
1. Price
You callGET /prices with srcToken, destToken, amount, side (SELL or BUY), and network. The aggregator scans liquidity across every DEX it supports on that chain, evaluates multi-hop and multi-DEX paths, and returns a priceRoute containing the best path, the expected destAmount, the gas estimate, and a USD breakdown (srcUSD, destUSD, gasCostUSD).
The priceRoute is stateless and unsigned — it’s just a routing plan. It expires quickly (prices move) but holds no commitment.
2. Build
YouPOST /transactions/:chainId with the full priceRoute from step 1, the user’s address, and a slippage tolerance. The API returns ready-to-broadcast calldata — to (the Augustus v6.2 router on that chain), data (encoded swap call), value (native token to send, if any), and a gas estimate.
3. Approve (ERC-20 only)
If the source token is an ERC-20, the user must approve the Augustus v6.2 router as a spender before the swap. This is a standardapprove(spender, amount) call. Native source tokens (ETH, MATIC, etc.) skip this step — value is sent with the swap tx directly.
You can avoid this round-trip by passing permit or permit2 data in the build call. See Permit & Permit2 patterns.
4. Settle
The user signs the swap transaction and broadcasts it. The Augustus router pullssrcToken, walks the path returned by the aggregator (each hop calls into the underlying DEX), checks the final destAmount against the user’s minDestAmount (price × 1 − slippage), and delivers destToken to the user. If any hop fails or slippage is exceeded, the entire transaction reverts — no partial-fill state.
Why this design
Atomic execution
The swap completes in one transaction or reverts. No half-filled state to clean up.
Composable
Augustus calldata can be wrapped in any contract call — vaults, batches, multicalls.
Best-price routing
Multi-hop, multi-DEX paths across every venue the aggregator supports on each chain.
Full user control
The user signs and broadcasts. No off-chain solver custody, no auction delay.
Related pages
- Quickstart — run the flow end-to-end with cURL.
- Market API reference — endpoints, parameters, response schemas.
- Permit & Permit2 patterns — skip the separate approve transaction.
- Augustus router — per-chain router addresses.