Skip to main content
POST
/
api
/
v1
/
swap
Build swap transaction
curl --request POST \
  --url https://api.vulcx.xyz/api/v1/swap \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "userWallet": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
  "inputMint": "So11111111111111111111111111111111111111112",
  "outputMint": "uSd2czE61Evaf76RNbq4KPpXnkiL3irdzgLFUMe3NoG",
  "amount": "1000000000",
  "swapMode": "ExactIn",
  "slippageBps": 50,
  "skipSimulation": false
}
'
import requests

url = "https://api.vulcx.xyz/api/v1/swap"

payload = {
    "userWallet": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
    "inputMint": "So11111111111111111111111111111111111111112",
    "outputMint": "uSd2czE61Evaf76RNbq4KPpXnkiL3irdzgLFUMe3NoG",
    "amount": "1000000000",
    "swapMode": "ExactIn",
    "slippageBps": 50,
    "skipSimulation": False
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.text)
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    userWallet: '9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM',
    inputMint: 'So11111111111111111111111111111111111111112',
    outputMint: 'uSd2czE61Evaf76RNbq4KPpXnkiL3irdzgLFUMe3NoG',
    amount: '1000000000',
    swapMode: 'ExactIn',
    slippageBps: 50,
    skipSimulation: false
  })
};

fetch('https://api.vulcx.xyz/api/v1/swap', 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.vulcx.xyz/api/v1/swap",
  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([
    'userWallet' => '9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM',
    'inputMint' => 'So11111111111111111111111111111111111111112',
    'outputMint' => 'uSd2czE61Evaf76RNbq4KPpXnkiL3irdzgLFUMe3NoG',
    'amount' => '1000000000',
    'swapMode' => 'ExactIn',
    'slippageBps' => 50,
    'skipSimulation' => false
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "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.vulcx.xyz/api/v1/swap"

	payload := strings.NewReader("{\n  \"userWallet\": \"9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM\",\n  \"inputMint\": \"So11111111111111111111111111111111111111112\",\n  \"outputMint\": \"uSd2czE61Evaf76RNbq4KPpXnkiL3irdzgLFUMe3NoG\",\n  \"amount\": \"1000000000\",\n  \"swapMode\": \"ExactIn\",\n  \"slippageBps\": 50,\n  \"skipSimulation\": false\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	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.vulcx.xyz/api/v1/swap")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"userWallet\": \"9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM\",\n  \"inputMint\": \"So11111111111111111111111111111111111111112\",\n  \"outputMint\": \"uSd2czE61Evaf76RNbq4KPpXnkiL3irdzgLFUMe3NoG\",\n  \"amount\": \"1000000000\",\n  \"swapMode\": \"ExactIn\",\n  \"slippageBps\": 50,\n  \"skipSimulation\": false\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.vulcx.xyz/api/v1/swap")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"userWallet\": \"9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM\",\n  \"inputMint\": \"So11111111111111111111111111111111111111112\",\n  \"outputMint\": \"uSd2czE61Evaf76RNbq4KPpXnkiL3irdzgLFUMe3NoG\",\n  \"amount\": \"1000000000\",\n  \"swapMode\": \"ExactIn\",\n  \"slippageBps\": 50,\n  \"skipSimulation\": false\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "data": {
    "transaction": "<string>",
    "lastValidBlockHeight": 245832190,
    "amountIn": "1000000000",
    "amountOut": "145320000",
    "feeAmount": "0",
    "route": [
      "<string>"
    ],
    "hopCount": 1,
    "pools": [
      "<string>"
    ],
    "minAmountOut": "<string>",
    "maxAmountIn": "<string>",
    "simulation": {
      "success": true,
      "logs": [
        "<string>"
      ],
      "computeUnitsConsumed": 85000,
      "insufficientFunds": true,
      "slippageExceeded": true,
      "error": "<string>"
    },
    "computeUnitsEstimate": 85000,
    "isSplitRoute": false,
    "splitPercents": [
      123
    ]
  }
}
{
  "success": false,
  "error": "no route found"
}
{
  "success": false,
  "error": "no route found"
}
{
  "success": false,
  "error": "no route found"
}

Authorizations

Authorization
string
header
required

API key sent as Authorization: Bearer vulcx_.... Required on every endpoint except GET /health and GET /api/v1/tokens.

Body

application/json

Parameters for building a swap transaction.

userWallet
string
required

User's wallet address that will sign and execute the transaction.

Example:

"9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM"

inputMint
string
required

Input token mint address.

Example:

"So11111111111111111111111111111111111111112"

outputMint
string
required

Output token mint address.

Example:

"uSd2czE61Evaf76RNbq4KPpXnkiL3irdzgLFUMe3NoG"

amount
string
required

Amount in smallest token units.

Example:

"1000000000"

swapMode
enum<string>
required

ExactIn: amount is exact input. ExactOut: amount is exact desired output.

Available options:
ExactIn,
ExactOut
Example:

"ExactIn"

slippageBps
integer
default:50

Slippage tolerance in basis points. Default: 50 (0.5%).

Example:

50

skipSimulation
boolean
default:false

Skip transaction simulation. Faster but no pre-flight validation. Default: false.

Example:

false

Response

Swap transaction built successfully.

success
boolean
Example:

true

data
object

Unsigned swap transaction and execution details.

Last modified on July 5, 2026