Skip to main content
POST
/
transactions
/
{chainId}
Build calldata for a Market Swap
curl --request POST \
  --url https://api.velora.xyz/transactions/{chainId} \
  --header 'Content-Type: application/json' \
  --data '
{
  "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>"
  },
  "srcToken": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
  "destToken": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
  "userAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
  "srcDecimals": 123,
  "destDecimals": 123,
  "srcAmount": "1000000000000000000",
  "destAmount": "1000000000000000000",
  "slippage": 5000,
  "txOrigin": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
  "receiver": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
  "partner": "my-app-name",
  "partnerAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
  "partnerFeeBps": "<string>",
  "permit": "<string>",
  "deadline": 123,
  "isCapSurplus": true,
  "takeSurplus": false,
  "isSurplusToUser": false,
  "isDirectFeeTransfer": false
}
'
import requests

url = "https://api.velora.xyz/transactions/{chainId}"

payload = {
"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>"
},
"srcToken": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"destToken": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"userAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"srcDecimals": 123,
"destDecimals": 123,
"srcAmount": "1000000000000000000",
"destAmount": "1000000000000000000",
"slippage": 5000,
"txOrigin": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"receiver": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"partner": "my-app-name",
"partnerAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"partnerFeeBps": "<string>",
"permit": "<string>",
"deadline": 123,
"isCapSurplus": True,
"takeSurplus": False,
"isSurplusToUser": False,
"isDirectFeeTransfer": False
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
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>'
},
srcToken: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
destToken: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
userAddress: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
srcDecimals: 123,
destDecimals: 123,
srcAmount: '1000000000000000000',
destAmount: '1000000000000000000',
slippage: 5000,
txOrigin: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
receiver: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
partner: 'my-app-name',
partnerAddress: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
partnerFeeBps: '<string>',
permit: '<string>',
deadline: 123,
isCapSurplus: true,
takeSurplus: false,
isSurplusToUser: false,
isDirectFeeTransfer: false
})
};

fetch('https://api.velora.xyz/transactions/{chainId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.velora.xyz/transactions/{chainId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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>'
],
'srcToken' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'destToken' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'userAddress' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'srcDecimals' => 123,
'destDecimals' => 123,
'srcAmount' => '1000000000000000000',
'destAmount' => '1000000000000000000',
'slippage' => 5000,
'txOrigin' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'receiver' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'partner' => 'my-app-name',
'partnerAddress' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'partnerFeeBps' => '<string>',
'permit' => '<string>',
'deadline' => 123,
'isCapSurplus' => true,
'takeSurplus' => false,
'isSurplusToUser' => false,
'isDirectFeeTransfer' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.velora.xyz/transactions/{chainId}"

payload := strings.NewReader("{\n \"priceRoute\": {\n \"blockNumber\": 123,\n \"network\": 1,\n \"srcToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"srcDecimals\": 123,\n \"srcAmount\": \"1000000000000000000\",\n \"destToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"destDecimals\": 123,\n \"destAmount\": \"1000000000000000000\",\n \"bestRoute\": [\n {}\n ],\n \"gasCostUSD\": \"<string>\",\n \"gasCost\": \"<string>\",\n \"version\": \"<string>\",\n \"contractAddress\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"tokenTransferProxy\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"contractMethod\": \"<string>\",\n \"partnerFee\": 123,\n \"srcUSD\": \"<string>\",\n \"destUSD\": \"<string>\",\n \"partner\": \"<string>\",\n \"maxImpactReached\": true,\n \"hmac\": \"<string>\"\n },\n \"srcToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"destToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"userAddress\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"srcDecimals\": 123,\n \"destDecimals\": 123,\n \"srcAmount\": \"1000000000000000000\",\n \"destAmount\": \"1000000000000000000\",\n \"slippage\": 5000,\n \"txOrigin\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"receiver\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"partner\": \"my-app-name\",\n \"partnerAddress\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"partnerFeeBps\": \"<string>\",\n \"permit\": \"<string>\",\n \"deadline\": 123,\n \"isCapSurplus\": true,\n \"takeSurplus\": false,\n \"isSurplusToUser\": false,\n \"isDirectFeeTransfer\": false\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.velora.xyz/transactions/{chainId}")
.header("Content-Type", "application/json")
.body("{\n \"priceRoute\": {\n \"blockNumber\": 123,\n \"network\": 1,\n \"srcToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"srcDecimals\": 123,\n \"srcAmount\": \"1000000000000000000\",\n \"destToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"destDecimals\": 123,\n \"destAmount\": \"1000000000000000000\",\n \"bestRoute\": [\n {}\n ],\n \"gasCostUSD\": \"<string>\",\n \"gasCost\": \"<string>\",\n \"version\": \"<string>\",\n \"contractAddress\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"tokenTransferProxy\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"contractMethod\": \"<string>\",\n \"partnerFee\": 123,\n \"srcUSD\": \"<string>\",\n \"destUSD\": \"<string>\",\n \"partner\": \"<string>\",\n \"maxImpactReached\": true,\n \"hmac\": \"<string>\"\n },\n \"srcToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"destToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"userAddress\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"srcDecimals\": 123,\n \"destDecimals\": 123,\n \"srcAmount\": \"1000000000000000000\",\n \"destAmount\": \"1000000000000000000\",\n \"slippage\": 5000,\n \"txOrigin\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"receiver\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"partner\": \"my-app-name\",\n \"partnerAddress\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"partnerFeeBps\": \"<string>\",\n \"permit\": \"<string>\",\n \"deadline\": 123,\n \"isCapSurplus\": true,\n \"takeSurplus\": false,\n \"isSurplusToUser\": false,\n \"isDirectFeeTransfer\": false\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.velora.xyz/transactions/{chainId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"priceRoute\": {\n \"blockNumber\": 123,\n \"network\": 1,\n \"srcToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"srcDecimals\": 123,\n \"srcAmount\": \"1000000000000000000\",\n \"destToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"destDecimals\": 123,\n \"destAmount\": \"1000000000000000000\",\n \"bestRoute\": [\n {}\n ],\n \"gasCostUSD\": \"<string>\",\n \"gasCost\": \"<string>\",\n \"version\": \"<string>\",\n \"contractAddress\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"tokenTransferProxy\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"contractMethod\": \"<string>\",\n \"partnerFee\": 123,\n \"srcUSD\": \"<string>\",\n \"destUSD\": \"<string>\",\n \"partner\": \"<string>\",\n \"maxImpactReached\": true,\n \"hmac\": \"<string>\"\n },\n \"srcToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"destToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"userAddress\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"srcDecimals\": 123,\n \"destDecimals\": 123,\n \"srcAmount\": \"1000000000000000000\",\n \"destAmount\": \"1000000000000000000\",\n \"slippage\": 5000,\n \"txOrigin\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"receiver\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"partner\": \"my-app-name\",\n \"partnerAddress\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"partnerFeeBps\": \"<string>\",\n \"permit\": \"<string>\",\n \"deadline\": 123,\n \"isCapSurplus\": true,\n \"takeSurplus\": false,\n \"isSurplusToUser\": false,\n \"isDirectFeeTransfer\": false\n}"

response = http.request(request)
puts response.read_body
{
  "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
  "to": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
  "value": "0",
  "data": "<string>",
  "gasPrice": "16000000000",
  "maxFeePerGas": "<string>",
  "maxPriorityFeePerGas": "<string>",
  "gas": "<string>",
  "chainId": 1
}
{
"errorType": "PricingError",
"details": "Error getting price data"
}
{
"errorType": "PricingError",
"details": "Error getting price data"
}

Path Parameters

chainId
integer
required

EVM chain ID. Matches priceRoute.network. 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.

Example:

1

Query Parameters

gasPrice
string

Gas price to use for the transaction, in WEI.

ignoreChecks
boolean
default:false

Skip on-chain balance, allowance, and transaction-failure checks. The response omits the gas field when enabled.

ignoreGasEstimate
boolean
default:false

Skip the gas estimate. The response omits the gas field when enabled.

onlyParams
boolean
default:false

Return only the contract call parameters instead of a full transaction object.

eip1559
boolean
default:false

Return an EIP-1559 transaction with maxFeePerGas and maxPriorityFeePerGas in place of gasPrice.

Body

application/json
priceRoute
object
required

The priceRoute block returned by GET /prices, passed verbatim — do not recompute or re-encode.

srcToken
string
required

Source token address. A token symbol listed in /tokens can be used instead.

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"

destToken
string
required

Destination token address. A token symbol listed in /tokens can be used instead.

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"

userAddress
string
required

Address of the transaction caller (msg.sender). When using an intermediary contract, userAddress should correspond to msg.sender and receiver to the recipient.

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"

srcDecimals
integer

Source token decimals. Can be omitted if a token symbol is used in srcToken.

destDecimals
integer

Destination token decimals. Can be omitted if a token symbol is used in destToken.

srcAmount
string

Source amount in WEI/raw units. Required when side=SELL. On side=BUY it can be omitted if slippage is provided.

Example:

"1000000000000000000"

destAmount
string

Destination amount in WEI/raw units. Required when side=BUY. On side=SELL it can be omitted if slippage is provided.

Example:

"1000000000000000000"

slippage
integer

Allowed slippage in basis points (0–10000). 250 = 2.5%. Required when the non-fixed amount (destAmount on SELL, srcAmount on BUY) is omitted.

Required range: 0 <= x <= 10000
txOrigin
string

When msg.sender differs from the transaction sender, pass the sender here along with userAddress.

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"

receiver
string

Recipient of the swap output, for Swap & Transfer. Omit when userAddress receives.

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"

partner
string

Partner string. Used for analytics and fee attribution on your project's swaps.

Example:

"my-app-name"

partnerAddress
string

Address entitled to claim partner fees or surplus.

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"

partnerFeeBps
string

Partner fee in basis points, used with partnerAddress. 200 = 2%.

permit
string

Signed permit payload (hex). Lets the swap skip the separate approve transaction.

deadline
integer

Unix timestamp (seconds) after which the transaction is no longer valid.

isCapSurplus
boolean
default:true

Cap collected surplus at 1%.

takeSurplus
boolean
default:false

Collect positive slippage as surplus. Works with partnerAddress.

isSurplusToUser
boolean
default:false

Route positive slippage / surplus to the user instead of the partner.

isDirectFeeTransfer
boolean
default:false

Transfer the partner fee directly rather than accruing it in the Fee Vault.

Response

Augustus calldata + tx fields.

Augustus calldata + tx envelope ready to broadcast.

from
string

End-user wallet address (the userAddress from the request).

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"

to
string

The Augustus v6.2 router. Send the transaction here; it is also the ERC-20 spender to approve.

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"

value
string

Native token amount in WEI to send with the transaction. "0" for ERC-20 sources.

Example:

"0"

data
string

Encoded swap calldata.

gasPrice
string

Suggested gas price in WEI. Replaced by maxFeePerGas / maxPriorityFeePerGas when eip1559=true.

Example:

"16000000000"

maxFeePerGas
string

EIP-1559 max fee per gas in WEI. Present when eip1559=true.

maxPriorityFeePerGas
string

EIP-1559 max priority fee per gas in WEI. Present when eip1559=true.

gas
string

Gas limit estimate from the API's transaction checks. Returned by POST /transactions unless ignoreChecks or ignoreGasEstimate is set; omitted by GET /swap, where you estimate locally before broadcasting.

chainId
integer

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.

Example:

1

Last modified on June 14, 2026