curl --request POST \
--url https://core-api-dev.vanish.trade/trade/create \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"user_address": "<string>",
"source_token_address": "<string>",
"target_token_address": "<string>",
"amount": "<string>",
"jito_tip_amount": "<string>",
"swap_transaction": "<string>",
"loan_additional_sol": "<string>",
"timestamp": "<string>",
"user_signature": "<string>",
"split_repay": 9,
"one_time_wallet": "<string>",
"prefer_non_jito": {
"compute_unit_price": "<string>",
"compute_unit_limit": "<string>",
"custom_tip_address": "<string>",
"custom_tip_amount": "<string>"
}
}
'import requests
url = "https://core-api-dev.vanish.trade/trade/create"
payload = {
"user_address": "<string>",
"source_token_address": "<string>",
"target_token_address": "<string>",
"amount": "<string>",
"jito_tip_amount": "<string>",
"swap_transaction": "<string>",
"loan_additional_sol": "<string>",
"timestamp": "<string>",
"user_signature": "<string>",
"split_repay": 9,
"one_time_wallet": "<string>",
"prefer_non_jito": {
"compute_unit_price": "<string>",
"compute_unit_limit": "<string>",
"custom_tip_address": "<string>",
"custom_tip_amount": "<string>"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_address: '<string>',
source_token_address: '<string>',
target_token_address: '<string>',
amount: '<string>',
jito_tip_amount: '<string>',
swap_transaction: '<string>',
loan_additional_sol: '<string>',
timestamp: '<string>',
user_signature: '<string>',
split_repay: 9,
one_time_wallet: '<string>',
prefer_non_jito: {
compute_unit_price: '<string>',
compute_unit_limit: '<string>',
custom_tip_address: '<string>',
custom_tip_amount: '<string>'
}
})
};
fetch('https://core-api-dev.vanish.trade/trade/create', 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://core-api-dev.vanish.trade/trade/create",
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([
'user_address' => '<string>',
'source_token_address' => '<string>',
'target_token_address' => '<string>',
'amount' => '<string>',
'jito_tip_amount' => '<string>',
'swap_transaction' => '<string>',
'loan_additional_sol' => '<string>',
'timestamp' => '<string>',
'user_signature' => '<string>',
'split_repay' => 9,
'one_time_wallet' => '<string>',
'prefer_non_jito' => [
'compute_unit_price' => '<string>',
'compute_unit_limit' => '<string>',
'custom_tip_address' => '<string>',
'custom_tip_amount' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://core-api-dev.vanish.trade/trade/create"
payload := strings.NewReader("{\n \"user_address\": \"<string>\",\n \"source_token_address\": \"<string>\",\n \"target_token_address\": \"<string>\",\n \"amount\": \"<string>\",\n \"jito_tip_amount\": \"<string>\",\n \"swap_transaction\": \"<string>\",\n \"loan_additional_sol\": \"<string>\",\n \"timestamp\": \"<string>\",\n \"user_signature\": \"<string>\",\n \"split_repay\": 9,\n \"one_time_wallet\": \"<string>\",\n \"prefer_non_jito\": {\n \"compute_unit_price\": \"<string>\",\n \"compute_unit_limit\": \"<string>\",\n \"custom_tip_address\": \"<string>\",\n \"custom_tip_amount\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://core-api-dev.vanish.trade/trade/create")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_address\": \"<string>\",\n \"source_token_address\": \"<string>\",\n \"target_token_address\": \"<string>\",\n \"amount\": \"<string>\",\n \"jito_tip_amount\": \"<string>\",\n \"swap_transaction\": \"<string>\",\n \"loan_additional_sol\": \"<string>\",\n \"timestamp\": \"<string>\",\n \"user_signature\": \"<string>\",\n \"split_repay\": 9,\n \"one_time_wallet\": \"<string>\",\n \"prefer_non_jito\": {\n \"compute_unit_price\": \"<string>\",\n \"compute_unit_limit\": \"<string>\",\n \"custom_tip_address\": \"<string>\",\n \"custom_tip_amount\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core-api-dev.vanish.trade/trade/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_address\": \"<string>\",\n \"source_token_address\": \"<string>\",\n \"target_token_address\": \"<string>\",\n \"amount\": \"<string>\",\n \"jito_tip_amount\": \"<string>\",\n \"swap_transaction\": \"<string>\",\n \"loan_additional_sol\": \"<string>\",\n \"timestamp\": \"<string>\",\n \"user_signature\": \"<string>\",\n \"split_repay\": 9,\n \"one_time_wallet\": \"<string>\",\n \"prefer_non_jito\": {\n \"compute_unit_price\": \"<string>\",\n \"compute_unit_limit\": \"<string>\",\n \"custom_tip_address\": \"<string>\",\n \"custom_tip_amount\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"tx_id": "<string>",
"jito_bundle_id": "<string>",
"transaction": "<string>"
}"<unknown>""<string>"Create Trade
Creates a user’s trade transaction; supports both Jito and non-Jito routing based on parameters.
curl --request POST \
--url https://core-api-dev.vanish.trade/trade/create \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"user_address": "<string>",
"source_token_address": "<string>",
"target_token_address": "<string>",
"amount": "<string>",
"jito_tip_amount": "<string>",
"swap_transaction": "<string>",
"loan_additional_sol": "<string>",
"timestamp": "<string>",
"user_signature": "<string>",
"split_repay": 9,
"one_time_wallet": "<string>",
"prefer_non_jito": {
"compute_unit_price": "<string>",
"compute_unit_limit": "<string>",
"custom_tip_address": "<string>",
"custom_tip_amount": "<string>"
}
}
'import requests
url = "https://core-api-dev.vanish.trade/trade/create"
payload = {
"user_address": "<string>",
"source_token_address": "<string>",
"target_token_address": "<string>",
"amount": "<string>",
"jito_tip_amount": "<string>",
"swap_transaction": "<string>",
"loan_additional_sol": "<string>",
"timestamp": "<string>",
"user_signature": "<string>",
"split_repay": 9,
"one_time_wallet": "<string>",
"prefer_non_jito": {
"compute_unit_price": "<string>",
"compute_unit_limit": "<string>",
"custom_tip_address": "<string>",
"custom_tip_amount": "<string>"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_address: '<string>',
source_token_address: '<string>',
target_token_address: '<string>',
amount: '<string>',
jito_tip_amount: '<string>',
swap_transaction: '<string>',
loan_additional_sol: '<string>',
timestamp: '<string>',
user_signature: '<string>',
split_repay: 9,
one_time_wallet: '<string>',
prefer_non_jito: {
compute_unit_price: '<string>',
compute_unit_limit: '<string>',
custom_tip_address: '<string>',
custom_tip_amount: '<string>'
}
})
};
fetch('https://core-api-dev.vanish.trade/trade/create', 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://core-api-dev.vanish.trade/trade/create",
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([
'user_address' => '<string>',
'source_token_address' => '<string>',
'target_token_address' => '<string>',
'amount' => '<string>',
'jito_tip_amount' => '<string>',
'swap_transaction' => '<string>',
'loan_additional_sol' => '<string>',
'timestamp' => '<string>',
'user_signature' => '<string>',
'split_repay' => 9,
'one_time_wallet' => '<string>',
'prefer_non_jito' => [
'compute_unit_price' => '<string>',
'compute_unit_limit' => '<string>',
'custom_tip_address' => '<string>',
'custom_tip_amount' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://core-api-dev.vanish.trade/trade/create"
payload := strings.NewReader("{\n \"user_address\": \"<string>\",\n \"source_token_address\": \"<string>\",\n \"target_token_address\": \"<string>\",\n \"amount\": \"<string>\",\n \"jito_tip_amount\": \"<string>\",\n \"swap_transaction\": \"<string>\",\n \"loan_additional_sol\": \"<string>\",\n \"timestamp\": \"<string>\",\n \"user_signature\": \"<string>\",\n \"split_repay\": 9,\n \"one_time_wallet\": \"<string>\",\n \"prefer_non_jito\": {\n \"compute_unit_price\": \"<string>\",\n \"compute_unit_limit\": \"<string>\",\n \"custom_tip_address\": \"<string>\",\n \"custom_tip_amount\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://core-api-dev.vanish.trade/trade/create")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_address\": \"<string>\",\n \"source_token_address\": \"<string>\",\n \"target_token_address\": \"<string>\",\n \"amount\": \"<string>\",\n \"jito_tip_amount\": \"<string>\",\n \"swap_transaction\": \"<string>\",\n \"loan_additional_sol\": \"<string>\",\n \"timestamp\": \"<string>\",\n \"user_signature\": \"<string>\",\n \"split_repay\": 9,\n \"one_time_wallet\": \"<string>\",\n \"prefer_non_jito\": {\n \"compute_unit_price\": \"<string>\",\n \"compute_unit_limit\": \"<string>\",\n \"custom_tip_address\": \"<string>\",\n \"custom_tip_amount\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core-api-dev.vanish.trade/trade/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_address\": \"<string>\",\n \"source_token_address\": \"<string>\",\n \"target_token_address\": \"<string>\",\n \"amount\": \"<string>\",\n \"jito_tip_amount\": \"<string>\",\n \"swap_transaction\": \"<string>\",\n \"loan_additional_sol\": \"<string>\",\n \"timestamp\": \"<string>\",\n \"user_signature\": \"<string>\",\n \"split_repay\": 9,\n \"one_time_wallet\": \"<string>\",\n \"prefer_non_jito\": {\n \"compute_unit_price\": \"<string>\",\n \"compute_unit_limit\": \"<string>\",\n \"custom_tip_address\": \"<string>\",\n \"custom_tip_amount\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"tx_id": "<string>",
"jito_bundle_id": "<string>",
"transaction": "<string>"
}"<unknown>""<string>"Authorizations
Body
Details of the trade request.
The wallet address of the user making the trade.
The address of the token being traded (source token).
The address of the token the user wants to receive (target token).
The amount of the source token to be traded, expressed in the smallest unit (e.g., lamports for SOL). Can be provided as a string or a number
^[0-9]+$The amount of Jito tip, expressed in the smallest unit (e.g., lamports for SOL). Can be provided as a string or a number
^[0-9]+$Serialized or encoded swap transaction data. The transaction must be provided unsigned.
Additional SOL (in lamports) for ATA creation and account initialization. Recommended 12000000; the actual requirement may be lower, and any unused amount is refunded. Can be provided as a string or a number
^[0-9]+$Unix timestamp of when the trade was initiated (in milliseconds). Can be provided as a string or a number
^[0-9]+$A digital signature of 'By signing, I hereby agree to Vanish's Terms of Service and agree to be bound by them (docs.vanish.trade/legal/TOS)
Details: trade:{source_token_address}:{target_token_address}:{amount}:{loan_additional_sol}:{timestamp}:{jito_tip_amount}', signed by the user's wallet.
Number of trading accounts the purchased tokens are distributed across. Lower values keep the transaction smaller and work better with prefer_non_jito. Use 1 unless amount_out exceeds 0.5% of token supply.
x <= 10The wallet address for the swap transaction, returned by the /trade/one-time-wallet endpoint.
When provided, prioritizes single-transaction (non-Jito) routing, using the supplied priority fee fields. Works best with low split_repay values, since smaller transactions are likelier to fit in one transaction.
Show child attributes
Show child attributes
Response
Successful trade transaction data response.
