curl --request GET \
--url https://api.velora.xyz/swap{
"priceRoute": {
"blockNumber": 123,
"network": 1,
"srcToken": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"srcDecimals": 123,
"srcAmount": "1000000000000000000",
"destToken": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"destDecimals": 123,
"destAmount": "1000000000000000000",
"bestRoute": [
{}
],
"gasCostUSD": "<string>",
"gasCost": "<string>",
"version": "<string>",
"contractAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"tokenTransferProxy": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"contractMethod": "<string>",
"partnerFee": 123,
"srcUSD": "<string>",
"destUSD": "<string>",
"partner": "<string>",
"maxImpactReached": true,
"hmac": "<string>"
},
"txParams": {
"from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"to": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"value": "0",
"data": "<string>",
"gasPrice": "16000000000",
"maxFeePerGas": "<string>",
"maxPriorityFeePerGas": "<string>",
"gas": "<string>",
"chainId": 1
}
}/swap
Price and calldata in one call: GET /prices and POST /transactions fused into a single Market request.
curl --request GET \
--url https://api.velora.xyz/swap{
"priceRoute": {
"blockNumber": 123,
"network": 1,
"srcToken": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"srcDecimals": 123,
"srcAmount": "1000000000000000000",
"destToken": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"destDecimals": 123,
"destAmount": "1000000000000000000",
"bestRoute": [
{}
],
"gasCostUSD": "<string>",
"gasCost": "<string>",
"version": "<string>",
"contractAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"tokenTransferProxy": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"contractMethod": "<string>",
"partnerFee": 123,
"srcUSD": "<string>",
"destUSD": "<string>",
"partner": "<string>",
"maxImpactReached": true,
"hmac": "<string>"
},
"txParams": {
"from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"to": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"value": "0",
"data": "<string>",
"gasPrice": "16000000000",
"maxFeePerGas": "<string>",
"maxPriorityFeePerGas": "<string>",
"gas": "<string>",
"chainId": 1
}
}GET /swap fuses the two Market steps into one request: it runs aggregator pricing and calldata generation server-side and hands back both the priceRoute and ready-to-broadcast txParams. One round-trip takes you from “what’s the rate?” to a transaction you can sign and send.
GET /prices → POST /transactions/:chainId) when you need to inspect or cache the route before committing, manage allowances yourself, or attach permit / permit2 data. /swap trades that control for a single call.When to use it
Reach for /swap when… | Use the two-step flow when… |
|---|---|
| You want the fastest path from quote to signable tx | You need to inspect, display, or cache the priceRoute first |
| One server round-trip matters (latency, simplicity) | You attach permit / permit2 to skip the approve tx |
| Server-built calldata with defaults is fine | You need RFQ liquidity or finer routing/fee control |
Response
A200 returns two objects:
priceRoute— the routing plan:bestRoute,srcAmount/destAmount,gasCost/gasCostUSD,srcUSD/destUSD,contractMethod,version, and anhmacintegrity tag. Same shape asGET /prices.txParams— a broadcastable tx envelope:from,to(the Augustus v6.2 router),value,data(encoded swap),gasPrice, andchainId. Nogasfield — estimate it locally.
{
"priceRoute": {
"blockNumber": 20184108,
"network": 1,
"srcToken": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"srcDecimals": 6,
"srcAmount": "1000000",
"destToken": "0x6b175474e89094c44da98b954eedeac495271d0f",
"destDecimals": 18,
"destAmount": "997620341641628401",
"bestRoute": ["…"],
"gasCostUSD": "5.932529",
"contractMethod": "swapExactAmountIn",
"version": "6.2",
"hmac": "…"
},
"txParams": {
"from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"to": "0x6a000f20005980200259b80c5102003040001068",
"value": "0",
"data": "0xe3ead59e…",
"gasPrice": "16000000000",
"chainId": 1
}
}
Broadcasting the transaction
txParams is ready to send, but /swap skips allowance and balance checks and returns no gas field. Before broadcasting:
Approve (ERC-20 source only)
txParams.to) to spend srcToken with a standard approve(to, amount). Native sources (ETH, etc.) skip this; the amount rides along in txParams.value. To drop the extra transaction, switch to the two-step flow and pass Permit / Permit2 data in the build call.Estimate gas
eth_estimateGas on txParams (or simulate the call). The response omits gas by design; never broadcast with a hardcoded limit.Limitations
/swap runs at lower rate limits than the individual endpoints (Pro API accounts lift them) and excludes RFQ liquidity (AugustusRFQ). For best price across every venue, or to inspect the route before building, use GET /prices.- The endpoint validates neither allowance nor balance; your client must ensure the user has approved and funded the swap.
- The response carries no
gasfield. Always estimate locally before broadcasting. - Swap & Transfer and fees don’t apply to the
swapOnUniswap*/swapOnZeroXv*contract methods. When you set areceiveror a partner fee, constrain routing withincludeContractMethods=simpleSwap,multiSwap,megaSwap. - For tax tokens, DEXs and methods that can’t handle transfer-fee tokens are filtered out; declare the fee via
srcTokenTransferFee/destTokenTransferFee.
Key parameters
userAddress(required) — the caller, used as the txfromand for fee/surplus accounting. When using an intermediary contract,userAddressshould correspond tomsg.senderandreceiverto the recipient.slippage— basis points:100= 1%,250= 2.5%, max10000.version— always pass6.2(Augustus v6.2); when omitted the API falls back to the legacy v5 router.partner/partnerFeeBps/partnerAddress— monetize the swap;isSurplusToUserandisDirectFeeTransfercontrol surplus and fee routing. See Monetization.
Related pages
GET /prices
POST /transactions/:chainId
How Market works
Troubleshooting
Query Parameters
Source token address. A token symbol listed in /tokens can be used instead. Example uses ETH.
EVM address (20 bytes, hex-encoded with 0x prefix). Use the mixed-case placeholder 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for native ETH.
^0x[a-fA-F0-9]{40}$"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
Source token decimals. Can be omitted if a token symbol is used in srcToken.
Destination token address. A token symbol listed in /tokens can be used instead. Example uses USDC.
EVM address (20 bytes, hex-encoded with 0x prefix). Use the mixed-case placeholder 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for native ETH.
^0x[a-fA-F0-9]{40}$"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
Destination token decimals. Can be omitted if a token symbol is used in destToken.
srcToken amount (SELL) or destToken amount (BUY), in WEI/raw units. Token amount in WEI / raw units (no decimal point). Serialized as a string to preserve precision for amounts that exceed JavaScript Number range.
"1000000000000000000"
SELL, BUY EVM chain ID. Default: 1 (Mainnet). Market uses network; Delta uses chainId.
EVM chain ID. Supported values today include 1 (Mainnet), 10 (Optimism), 56 (BSC), 137 (Polygon), 8453 (Base), 42161 (Arbitrum), 43114 (Avalanche), 100 (Gnosis). The set is open — call GET /chains for the live list.
1
Allowed slippage in basis points (0–10000). 100 = 1%.
0 <= x <= 10000Caller wallet address. Used as the transaction from. When using an intermediary contract, userAddress should correspond to msg.sender and receiver to the recipient.
EVM address (20 bytes, hex-encoded with 0x prefix). Use the mixed-case placeholder 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for native ETH.
^0x[a-fA-F0-9]{40}$"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
Output recipient for Swap & Transfer. Omit when swapping from/to the same account.
EVM address (20 bytes, hex-encoded with 0x prefix). Use the mixed-case placeholder 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for native ETH.
^0x[a-fA-F0-9]{40}$"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
Partner string. Defaults to anon which charges 1bps fee for all swaps.
Partner fee / surplus recipient address.
EVM address (20 bytes, hex-encoded with 0x prefix). Use the mixed-case placeholder 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for native ETH.
^0x[a-fA-F0-9]{40}$"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
Partner fee in basis points.
If true, the response includes competitor price quotes in an others object.
Comma-separated list of DEXs to include.
Comma-separated list of DEXs to exclude.
Comma-separated list of contract methods to include.
Comma-separated list of contract methods to exclude.
Bypass API price-impact check (default = 15%). Value in %.
Dash-separated list of tokens for the price route. Max 4 tokens.
Tax in basis points charged on srcToken transfers.
Tax in basis points charged on destToken transfers.
DEX-specific tax in basis points charged on srcToken transfers.
DEX-specific tax in basis points charged on destToken transfers.
Protocol version. Always pass 6.2 (Augustus v6.2, what these docs cover); when omitted the API falls back to the legacy v5 router.
5, 6.2 Skip the USD-price availability check.
Collect positive slippage as surplus. Works with partnerAddress.
Cap collected surplus at 1%.
Route positive slippage / surplus to the user instead of the partner.
Transfer the partner fee directly rather than accruing it in the Fee Vault.
Response
Optimal route plus ready-to-broadcast tx params. Calldata targets Augustus v6.2 when version=6.2.
Was this page helpful?