Compute swap quote (base output)
curl --request GET \
--url https://transaction-v1.raydium.io/compute/swap-base-outimport requests
url = "https://transaction-v1.raydium.io/compute/swap-base-out"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://transaction-v1.raydium.io/compute/swap-base-out', 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://transaction-v1.raydium.io/compute/swap-base-out",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://transaction-v1.raydium.io/compute/swap-base-out"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://transaction-v1.raydium.io/compute/swap-base-out")
.asString();require 'uri'
require 'net/http'
url = URI("https://transaction-v1.raydium.io/compute/swap-base-out")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": "550e8400-e29b-41d4-a716-446655440000",
"success": true,
"version": "V1",
"data": {
"inputAmount": "<string>",
"outputAmount": "<string>",
"priceImpact": "<string>",
"routes": [
{}
]
}
}{
"id": "<string>",
"success": false,
"version": "V1",
"msg": "<string>"
}Compute
Compute swap quote (base output)
Calculate the required input amount to achieve a desired output amount. Useful for swaps where you know the target output.
GET
/
compute
/
swap-base-out
Compute swap quote (base output)
curl --request GET \
--url https://transaction-v1.raydium.io/compute/swap-base-outimport requests
url = "https://transaction-v1.raydium.io/compute/swap-base-out"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://transaction-v1.raydium.io/compute/swap-base-out', 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://transaction-v1.raydium.io/compute/swap-base-out",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://transaction-v1.raydium.io/compute/swap-base-out"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://transaction-v1.raydium.io/compute/swap-base-out")
.asString();require 'uri'
require 'net/http'
url = URI("https://transaction-v1.raydium.io/compute/swap-base-out")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": "550e8400-e29b-41d4-a716-446655440000",
"success": true,
"version": "V1",
"data": {
"inputAmount": "<string>",
"outputAmount": "<string>",
"priceImpact": "<string>",
"routes": [
{}
]
}
}{
"id": "<string>",
"success": false,
"version": "V1",
"msg": "<string>"
}Query Parameters
Mint address of the input token.
Mint address of the output token.
Desired output amount in the smallest unit (lamports).
Maximum slippage tolerance in basis points (0–10000).
Solana transaction version.
Available options:
V0, LEGACY Was this page helpful?

