curl --request POST \
--url https://raptor.solanatracker.io/swap-instructions \
--header 'Content-Type: application/json' \
--data '
{
"userPublicKey": "YOUR_WALLET_ADDRESS",
"quoteResponse": {
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amountIn": "100000000",
"amountOut": "11703794",
"minAmountOut": "11645275",
"priceImpact": 0,
"slippageBps": 50,
"routePlan": [
{
"programId": "9H6tua7jkLhdm3w8BvgpTn5LZNU7g4ZynDmCiNN3q6Rp",
"dex": "Humidifi",
"pool": "8sKQHfjNhvmAw94PhfvfMcytmqW6jmxvwieYyzXCCPu",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amountIn": "100000000",
"amountOut": "11703794",
"priceImpact": 0,
"percent": 100
}
],
"contextSlot": 454215309,
"timeTaken": 0.026,
"quoteId": "AbvXxjPyBhaxiDuRNB5XM54c_V8e-S0jPyMceNLpJQmU"
}
}
'import requests
url = "https://raptor.solanatracker.io/swap-instructions"
payload = {
"userPublicKey": "YOUR_WALLET_ADDRESS",
"quoteResponse": {
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amountIn": "100000000",
"amountOut": "11703794",
"minAmountOut": "11645275",
"priceImpact": 0,
"slippageBps": 50,
"routePlan": [
{
"programId": "9H6tua7jkLhdm3w8BvgpTn5LZNU7g4ZynDmCiNN3q6Rp",
"dex": "Humidifi",
"pool": "8sKQHfjNhvmAw94PhfvfMcytmqW6jmxvwieYyzXCCPu",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amountIn": "100000000",
"amountOut": "11703794",
"priceImpact": 0,
"percent": 100
}
],
"contextSlot": 454215309,
"timeTaken": 0.026,
"quoteId": "AbvXxjPyBhaxiDuRNB5XM54c_V8e-S0jPyMceNLpJQmU"
}
}
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({
userPublicKey: 'YOUR_WALLET_ADDRESS',
quoteResponse: {
inputMint: 'So11111111111111111111111111111111111111112',
outputMint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
amountIn: '100000000',
amountOut: '11703794',
minAmountOut: '11645275',
priceImpact: 0,
slippageBps: 50,
routePlan: [
{
programId: '9H6tua7jkLhdm3w8BvgpTn5LZNU7g4ZynDmCiNN3q6Rp',
dex: 'Humidifi',
pool: '8sKQHfjNhvmAw94PhfvfMcytmqW6jmxvwieYyzXCCPu',
inputMint: 'So11111111111111111111111111111111111111112',
outputMint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
amountIn: '100000000',
amountOut: '11703794',
priceImpact: 0,
percent: 100
}
],
contextSlot: 454215309,
timeTaken: 0.026,
quoteId: 'AbvXxjPyBhaxiDuRNB5XM54c_V8e-S0jPyMceNLpJQmU'
}
})
};
fetch('https://raptor.solanatracker.io/swap-instructions', 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://raptor.solanatracker.io/swap-instructions",
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([
'userPublicKey' => 'YOUR_WALLET_ADDRESS',
'quoteResponse' => [
'inputMint' => 'So11111111111111111111111111111111111111112',
'outputMint' => 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
'amountIn' => '100000000',
'amountOut' => '11703794',
'minAmountOut' => '11645275',
'priceImpact' => 0,
'slippageBps' => 50,
'routePlan' => [
[
'programId' => '9H6tua7jkLhdm3w8BvgpTn5LZNU7g4ZynDmCiNN3q6Rp',
'dex' => 'Humidifi',
'pool' => '8sKQHfjNhvmAw94PhfvfMcytmqW6jmxvwieYyzXCCPu',
'inputMint' => 'So11111111111111111111111111111111111111112',
'outputMint' => 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
'amountIn' => '100000000',
'amountOut' => '11703794',
'priceImpact' => 0,
'percent' => 100
]
],
'contextSlot' => 454215309,
'timeTaken' => 0.026,
'quoteId' => 'AbvXxjPyBhaxiDuRNB5XM54c_V8e-S0jPyMceNLpJQmU'
]
]),
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://raptor.solanatracker.io/swap-instructions"
payload := strings.NewReader("{\n \"userPublicKey\": \"YOUR_WALLET_ADDRESS\",\n \"quoteResponse\": {\n \"inputMint\": \"So11111111111111111111111111111111111111112\",\n \"outputMint\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"amountIn\": \"100000000\",\n \"amountOut\": \"11703794\",\n \"minAmountOut\": \"11645275\",\n \"priceImpact\": 0,\n \"slippageBps\": 50,\n \"routePlan\": [\n {\n \"programId\": \"9H6tua7jkLhdm3w8BvgpTn5LZNU7g4ZynDmCiNN3q6Rp\",\n \"dex\": \"Humidifi\",\n \"pool\": \"8sKQHfjNhvmAw94PhfvfMcytmqW6jmxvwieYyzXCCPu\",\n \"inputMint\": \"So11111111111111111111111111111111111111112\",\n \"outputMint\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"amountIn\": \"100000000\",\n \"amountOut\": \"11703794\",\n \"priceImpact\": 0,\n \"percent\": 100\n }\n ],\n \"contextSlot\": 454215309,\n \"timeTaken\": 0.026,\n \"quoteId\": \"AbvXxjPyBhaxiDuRNB5XM54c_V8e-S0jPyMceNLpJQmU\"\n }\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://raptor.solanatracker.io/swap-instructions")
.header("Content-Type", "application/json")
.body("{\n \"userPublicKey\": \"YOUR_WALLET_ADDRESS\",\n \"quoteResponse\": {\n \"inputMint\": \"So11111111111111111111111111111111111111112\",\n \"outputMint\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"amountIn\": \"100000000\",\n \"amountOut\": \"11703794\",\n \"minAmountOut\": \"11645275\",\n \"priceImpact\": 0,\n \"slippageBps\": 50,\n \"routePlan\": [\n {\n \"programId\": \"9H6tua7jkLhdm3w8BvgpTn5LZNU7g4ZynDmCiNN3q6Rp\",\n \"dex\": \"Humidifi\",\n \"pool\": \"8sKQHfjNhvmAw94PhfvfMcytmqW6jmxvwieYyzXCCPu\",\n \"inputMint\": \"So11111111111111111111111111111111111111112\",\n \"outputMint\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"amountIn\": \"100000000\",\n \"amountOut\": \"11703794\",\n \"priceImpact\": 0,\n \"percent\": 100\n }\n ],\n \"contextSlot\": 454215309,\n \"timeTaken\": 0.026,\n \"quoteId\": \"AbvXxjPyBhaxiDuRNB5XM54c_V8e-S0jPyMceNLpJQmU\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://raptor.solanatracker.io/swap-instructions")
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 \"userPublicKey\": \"YOUR_WALLET_ADDRESS\",\n \"quoteResponse\": {\n \"inputMint\": \"So11111111111111111111111111111111111111112\",\n \"outputMint\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"amountIn\": \"100000000\",\n \"amountOut\": \"11703794\",\n \"minAmountOut\": \"11645275\",\n \"priceImpact\": 0,\n \"slippageBps\": 50,\n \"routePlan\": [\n {\n \"programId\": \"9H6tua7jkLhdm3w8BvgpTn5LZNU7g4ZynDmCiNN3q6Rp\",\n \"dex\": \"Humidifi\",\n \"pool\": \"8sKQHfjNhvmAw94PhfvfMcytmqW6jmxvwieYyzXCCPu\",\n \"inputMint\": \"So11111111111111111111111111111111111111112\",\n \"outputMint\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"amountIn\": \"100000000\",\n \"amountOut\": \"11703794\",\n \"priceImpact\": 0,\n \"percent\": 100\n }\n ],\n \"contextSlot\": 454215309,\n \"timeTaken\": 0.026,\n \"quoteId\": \"AbvXxjPyBhaxiDuRNB5XM54c_V8e-S0jPyMceNLpJQmU\"\n }\n}"
response = http.request(request)
puts response.read_body{
"computeBudgetInstructions": [
{
"programId": "ComputeBudget111111111111111111111111111111",
"accounts": [],
"data": "AsBcFQA="
}
],
"setupInstructions": [
{
"programId": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
"accounts": [
{
"pubkey": "YOUR_WALLET_ADDRESS",
"isSigner": true,
"isWritable": true
}
],
"data": "AQ=="
}
],
"tokenLedgerInstruction": null,
"swapInstruction": {
"programId": "RaptorD5ojtsqDDtJeRsunPLg6GvLYNnwKJWxYE4m87",
"accounts": [
{
"pubkey": "YOUR_WALLET_ADDRESS",
"isSigner": true,
"isWritable": true
}
],
"data": "…"
},
"cleanupInstruction": null,
"addressLookupTableAddresses": [
"…"
]
}{
"error": "Invalid amount: must be greater than 0",
"code": 400
}{
"error": "Failed to get quote: No multi-hop route found",
"code": 422
}{
"error": "Failed to build swap: Execution plan expired",
"code": 500
}Build swap instructions
Same input as /swap, but returns the individual instructions so you can add your own and build the transaction yourself.
The swap is built as an ordinary swap unless you send jitRouting: true, so it can be called from your own program. If the response includes quoteResponse, use its amounts. When topLevelOnly is true, put swapInstruction last in the transaction and do not call it through CPI.
curl --request POST \
--url https://raptor.solanatracker.io/swap-instructions \
--header 'Content-Type: application/json' \
--data '
{
"userPublicKey": "YOUR_WALLET_ADDRESS",
"quoteResponse": {
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amountIn": "100000000",
"amountOut": "11703794",
"minAmountOut": "11645275",
"priceImpact": 0,
"slippageBps": 50,
"routePlan": [
{
"programId": "9H6tua7jkLhdm3w8BvgpTn5LZNU7g4ZynDmCiNN3q6Rp",
"dex": "Humidifi",
"pool": "8sKQHfjNhvmAw94PhfvfMcytmqW6jmxvwieYyzXCCPu",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amountIn": "100000000",
"amountOut": "11703794",
"priceImpact": 0,
"percent": 100
}
],
"contextSlot": 454215309,
"timeTaken": 0.026,
"quoteId": "AbvXxjPyBhaxiDuRNB5XM54c_V8e-S0jPyMceNLpJQmU"
}
}
'import requests
url = "https://raptor.solanatracker.io/swap-instructions"
payload = {
"userPublicKey": "YOUR_WALLET_ADDRESS",
"quoteResponse": {
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amountIn": "100000000",
"amountOut": "11703794",
"minAmountOut": "11645275",
"priceImpact": 0,
"slippageBps": 50,
"routePlan": [
{
"programId": "9H6tua7jkLhdm3w8BvgpTn5LZNU7g4ZynDmCiNN3q6Rp",
"dex": "Humidifi",
"pool": "8sKQHfjNhvmAw94PhfvfMcytmqW6jmxvwieYyzXCCPu",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amountIn": "100000000",
"amountOut": "11703794",
"priceImpact": 0,
"percent": 100
}
],
"contextSlot": 454215309,
"timeTaken": 0.026,
"quoteId": "AbvXxjPyBhaxiDuRNB5XM54c_V8e-S0jPyMceNLpJQmU"
}
}
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({
userPublicKey: 'YOUR_WALLET_ADDRESS',
quoteResponse: {
inputMint: 'So11111111111111111111111111111111111111112',
outputMint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
amountIn: '100000000',
amountOut: '11703794',
minAmountOut: '11645275',
priceImpact: 0,
slippageBps: 50,
routePlan: [
{
programId: '9H6tua7jkLhdm3w8BvgpTn5LZNU7g4ZynDmCiNN3q6Rp',
dex: 'Humidifi',
pool: '8sKQHfjNhvmAw94PhfvfMcytmqW6jmxvwieYyzXCCPu',
inputMint: 'So11111111111111111111111111111111111111112',
outputMint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
amountIn: '100000000',
amountOut: '11703794',
priceImpact: 0,
percent: 100
}
],
contextSlot: 454215309,
timeTaken: 0.026,
quoteId: 'AbvXxjPyBhaxiDuRNB5XM54c_V8e-S0jPyMceNLpJQmU'
}
})
};
fetch('https://raptor.solanatracker.io/swap-instructions', 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://raptor.solanatracker.io/swap-instructions",
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([
'userPublicKey' => 'YOUR_WALLET_ADDRESS',
'quoteResponse' => [
'inputMint' => 'So11111111111111111111111111111111111111112',
'outputMint' => 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
'amountIn' => '100000000',
'amountOut' => '11703794',
'minAmountOut' => '11645275',
'priceImpact' => 0,
'slippageBps' => 50,
'routePlan' => [
[
'programId' => '9H6tua7jkLhdm3w8BvgpTn5LZNU7g4ZynDmCiNN3q6Rp',
'dex' => 'Humidifi',
'pool' => '8sKQHfjNhvmAw94PhfvfMcytmqW6jmxvwieYyzXCCPu',
'inputMint' => 'So11111111111111111111111111111111111111112',
'outputMint' => 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
'amountIn' => '100000000',
'amountOut' => '11703794',
'priceImpact' => 0,
'percent' => 100
]
],
'contextSlot' => 454215309,
'timeTaken' => 0.026,
'quoteId' => 'AbvXxjPyBhaxiDuRNB5XM54c_V8e-S0jPyMceNLpJQmU'
]
]),
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://raptor.solanatracker.io/swap-instructions"
payload := strings.NewReader("{\n \"userPublicKey\": \"YOUR_WALLET_ADDRESS\",\n \"quoteResponse\": {\n \"inputMint\": \"So11111111111111111111111111111111111111112\",\n \"outputMint\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"amountIn\": \"100000000\",\n \"amountOut\": \"11703794\",\n \"minAmountOut\": \"11645275\",\n \"priceImpact\": 0,\n \"slippageBps\": 50,\n \"routePlan\": [\n {\n \"programId\": \"9H6tua7jkLhdm3w8BvgpTn5LZNU7g4ZynDmCiNN3q6Rp\",\n \"dex\": \"Humidifi\",\n \"pool\": \"8sKQHfjNhvmAw94PhfvfMcytmqW6jmxvwieYyzXCCPu\",\n \"inputMint\": \"So11111111111111111111111111111111111111112\",\n \"outputMint\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"amountIn\": \"100000000\",\n \"amountOut\": \"11703794\",\n \"priceImpact\": 0,\n \"percent\": 100\n }\n ],\n \"contextSlot\": 454215309,\n \"timeTaken\": 0.026,\n \"quoteId\": \"AbvXxjPyBhaxiDuRNB5XM54c_V8e-S0jPyMceNLpJQmU\"\n }\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://raptor.solanatracker.io/swap-instructions")
.header("Content-Type", "application/json")
.body("{\n \"userPublicKey\": \"YOUR_WALLET_ADDRESS\",\n \"quoteResponse\": {\n \"inputMint\": \"So11111111111111111111111111111111111111112\",\n \"outputMint\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"amountIn\": \"100000000\",\n \"amountOut\": \"11703794\",\n \"minAmountOut\": \"11645275\",\n \"priceImpact\": 0,\n \"slippageBps\": 50,\n \"routePlan\": [\n {\n \"programId\": \"9H6tua7jkLhdm3w8BvgpTn5LZNU7g4ZynDmCiNN3q6Rp\",\n \"dex\": \"Humidifi\",\n \"pool\": \"8sKQHfjNhvmAw94PhfvfMcytmqW6jmxvwieYyzXCCPu\",\n \"inputMint\": \"So11111111111111111111111111111111111111112\",\n \"outputMint\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"amountIn\": \"100000000\",\n \"amountOut\": \"11703794\",\n \"priceImpact\": 0,\n \"percent\": 100\n }\n ],\n \"contextSlot\": 454215309,\n \"timeTaken\": 0.026,\n \"quoteId\": \"AbvXxjPyBhaxiDuRNB5XM54c_V8e-S0jPyMceNLpJQmU\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://raptor.solanatracker.io/swap-instructions")
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 \"userPublicKey\": \"YOUR_WALLET_ADDRESS\",\n \"quoteResponse\": {\n \"inputMint\": \"So11111111111111111111111111111111111111112\",\n \"outputMint\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"amountIn\": \"100000000\",\n \"amountOut\": \"11703794\",\n \"minAmountOut\": \"11645275\",\n \"priceImpact\": 0,\n \"slippageBps\": 50,\n \"routePlan\": [\n {\n \"programId\": \"9H6tua7jkLhdm3w8BvgpTn5LZNU7g4ZynDmCiNN3q6Rp\",\n \"dex\": \"Humidifi\",\n \"pool\": \"8sKQHfjNhvmAw94PhfvfMcytmqW6jmxvwieYyzXCCPu\",\n \"inputMint\": \"So11111111111111111111111111111111111111112\",\n \"outputMint\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"amountIn\": \"100000000\",\n \"amountOut\": \"11703794\",\n \"priceImpact\": 0,\n \"percent\": 100\n }\n ],\n \"contextSlot\": 454215309,\n \"timeTaken\": 0.026,\n \"quoteId\": \"AbvXxjPyBhaxiDuRNB5XM54c_V8e-S0jPyMceNLpJQmU\"\n }\n}"
response = http.request(request)
puts response.read_body{
"computeBudgetInstructions": [
{
"programId": "ComputeBudget111111111111111111111111111111",
"accounts": [],
"data": "AsBcFQA="
}
],
"setupInstructions": [
{
"programId": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
"accounts": [
{
"pubkey": "YOUR_WALLET_ADDRESS",
"isSigner": true,
"isWritable": true
}
],
"data": "AQ=="
}
],
"tokenLedgerInstruction": null,
"swapInstruction": {
"programId": "RaptorD5ojtsqDDtJeRsunPLg6GvLYNnwKJWxYE4m87",
"accounts": [
{
"pubkey": "YOUR_WALLET_ADDRESS",
"isSigner": true,
"isWritable": true
}
],
"data": "…"
},
"cleanupInstruction": null,
"addressLookupTableAddresses": [
"…"
]
}{
"error": "Invalid amount: must be greater than 0",
"code": 400
}{
"error": "Failed to get quote: No multi-hop route found",
"code": 422
}{
"error": "Failed to build swap: Execution plan expired",
"code": 500
}Body
Wallet that signs and pays for the swap
Quote returned by GET /quote. Send it back unchanged as quoteResponse.
Show child attributes
Show child attributes
Wrap and unwrap native SOL automatically
Transaction format. Case-sensitive. LEGACY and V1 do not support JIT routes; quote with jitRouting=false to use them.
V0, LEGACY, V1 A level (min, low, medium, auto, high, veryHigh, turbo, unsafeMax) or a total fee in lamports as a string, such as "50000". Default auto.
"high"
Cap on the compute unit price, in micro-lamports
Exact compute unit price in micro-lamports. Overrides priorityFee.
Compute unit limit
Account that receives a SOL tip, such as a Jito tip account
Tip amount in lamports
Wallet that receives your platform fee
Platform fee in basis points
Take the platform fee from the input token
Fee on positive slippage, in basis points
On /swap, auto keeps the quote's route. On /swap-instructions, you get a JIT swap only when this is true.
auto, true, false Response
Instructions
Put the instructions in this order: computeBudgetInstructions, setupInstructions, tokenLedgerInstruction, swapInstruction, cleanupInstruction, tipInstruction. Skip any that are null. Exception: if topLevelOnly is true, swapInstruction must be last.
Show child attributes
Show child attributes
Creates missing token accounts and wraps SOL
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Unwraps SOL
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Address lookup tables to load when compiling a V0 transaction
true for a JIT swap: swapInstruction must be the last instruction and must not be called through CPI
The quote these instructions were built for. Use its amounts.
Show child attributes
Show child attributes
Compute budget settings, returned when txVersion is V1
Was this page helpful?