Create DCA order
curl --request POST \
--url https://api.jup.ag/trigger/v2/orders/dca \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"depositRequestId": "a8551844-fa46-41c7-af3a-70340c465bde",
"depositSignedTx": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAEN...",
"userPubkey": "BQ72nSv9f3PRyRKCBnHLVrerrv37CYTHm5h3s9VSGQDV",
"inputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"outputMint": "So11111111111111111111111111111111111111112",
"inputAmount": "20000000",
"orderCount": 2,
"intervalSeconds": 3600,
"orderType": "time_based"
}
'import requests
url = "https://api.jup.ag/trigger/v2/orders/dca"
payload = {
"depositRequestId": "a8551844-fa46-41c7-af3a-70340c465bde",
"depositSignedTx": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAEN...",
"userPubkey": "BQ72nSv9f3PRyRKCBnHLVrerrv37CYTHm5h3s9VSGQDV",
"inputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"outputMint": "So11111111111111111111111111111111111111112",
"inputAmount": "20000000",
"orderCount": 2,
"intervalSeconds": 3600,
"orderType": "time_based"
}
headers = {
"x-api-key": "<api-key>",
"Authorization": "Bearer <token>",
"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>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
depositRequestId: 'a8551844-fa46-41c7-af3a-70340c465bde',
depositSignedTx: 'AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAEN...',
userPubkey: 'BQ72nSv9f3PRyRKCBnHLVrerrv37CYTHm5h3s9VSGQDV',
inputMint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
outputMint: 'So11111111111111111111111111111111111111112',
inputAmount: '20000000',
orderCount: 2,
intervalSeconds: 3600,
orderType: 'time_based'
})
};
fetch('https://api.jup.ag/trigger/v2/orders/dca', 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.jup.ag/trigger/v2/orders/dca",
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([
'depositRequestId' => 'a8551844-fa46-41c7-af3a-70340c465bde',
'depositSignedTx' => 'AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAEN...',
'userPubkey' => 'BQ72nSv9f3PRyRKCBnHLVrerrv37CYTHm5h3s9VSGQDV',
'inputMint' => 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
'outputMint' => 'So11111111111111111111111111111111111111112',
'inputAmount' => '20000000',
'orderCount' => 2,
'intervalSeconds' => 3600,
'orderType' => 'time_based'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.jup.ag/trigger/v2/orders/dca"
payload := strings.NewReader("{\n \"depositRequestId\": \"a8551844-fa46-41c7-af3a-70340c465bde\",\n \"depositSignedTx\": \"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAEN...\",\n \"userPubkey\": \"BQ72nSv9f3PRyRKCBnHLVrerrv37CYTHm5h3s9VSGQDV\",\n \"inputMint\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"outputMint\": \"So11111111111111111111111111111111111111112\",\n \"inputAmount\": \"20000000\",\n \"orderCount\": 2,\n \"intervalSeconds\": 3600,\n \"orderType\": \"time_based\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.jup.ag/trigger/v2/orders/dca")
.header("x-api-key", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"depositRequestId\": \"a8551844-fa46-41c7-af3a-70340c465bde\",\n \"depositSignedTx\": \"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAEN...\",\n \"userPubkey\": \"BQ72nSv9f3PRyRKCBnHLVrerrv37CYTHm5h3s9VSGQDV\",\n \"inputMint\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"outputMint\": \"So11111111111111111111111111111111111111112\",\n \"inputAmount\": \"20000000\",\n \"orderCount\": 2,\n \"intervalSeconds\": 3600,\n \"orderType\": \"time_based\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jup.ag/trigger/v2/orders/dca")
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["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"depositRequestId\": \"a8551844-fa46-41c7-af3a-70340c465bde\",\n \"depositSignedTx\": \"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAEN...\",\n \"userPubkey\": \"BQ72nSv9f3PRyRKCBnHLVrerrv37CYTHm5h3s9VSGQDV\",\n \"inputMint\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"outputMint\": \"So11111111111111111111111111111111111111112\",\n \"inputAmount\": \"20000000\",\n \"orderCount\": 2,\n \"intervalSeconds\": 3600,\n \"orderType\": \"time_based\"\n}"
response = http.request(request)
puts response.read_body{
"id": "019f0530-36a7-77da-a38f-ed9414bb996b",
"txSignature": "PPbp1QbbKDPjpHM3ScKyZBnCtLKKqmWwDeVj7USdBeEoNQsA1hkN35UQfrY2cQpyAB1pfVi9FdfciYdz7qUXBQA"
}{
"error": "<string>",
"details": {}
}DCA
Create DCA Order
Create a recurring dollar-cost averaging order
POST
/
orders
/
dca
Create DCA order
curl --request POST \
--url https://api.jup.ag/trigger/v2/orders/dca \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"depositRequestId": "a8551844-fa46-41c7-af3a-70340c465bde",
"depositSignedTx": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAEN...",
"userPubkey": "BQ72nSv9f3PRyRKCBnHLVrerrv37CYTHm5h3s9VSGQDV",
"inputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"outputMint": "So11111111111111111111111111111111111111112",
"inputAmount": "20000000",
"orderCount": 2,
"intervalSeconds": 3600,
"orderType": "time_based"
}
'import requests
url = "https://api.jup.ag/trigger/v2/orders/dca"
payload = {
"depositRequestId": "a8551844-fa46-41c7-af3a-70340c465bde",
"depositSignedTx": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAEN...",
"userPubkey": "BQ72nSv9f3PRyRKCBnHLVrerrv37CYTHm5h3s9VSGQDV",
"inputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"outputMint": "So11111111111111111111111111111111111111112",
"inputAmount": "20000000",
"orderCount": 2,
"intervalSeconds": 3600,
"orderType": "time_based"
}
headers = {
"x-api-key": "<api-key>",
"Authorization": "Bearer <token>",
"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>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
depositRequestId: 'a8551844-fa46-41c7-af3a-70340c465bde',
depositSignedTx: 'AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAEN...',
userPubkey: 'BQ72nSv9f3PRyRKCBnHLVrerrv37CYTHm5h3s9VSGQDV',
inputMint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
outputMint: 'So11111111111111111111111111111111111111112',
inputAmount: '20000000',
orderCount: 2,
intervalSeconds: 3600,
orderType: 'time_based'
})
};
fetch('https://api.jup.ag/trigger/v2/orders/dca', 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.jup.ag/trigger/v2/orders/dca",
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([
'depositRequestId' => 'a8551844-fa46-41c7-af3a-70340c465bde',
'depositSignedTx' => 'AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAEN...',
'userPubkey' => 'BQ72nSv9f3PRyRKCBnHLVrerrv37CYTHm5h3s9VSGQDV',
'inputMint' => 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
'outputMint' => 'So11111111111111111111111111111111111111112',
'inputAmount' => '20000000',
'orderCount' => 2,
'intervalSeconds' => 3600,
'orderType' => 'time_based'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.jup.ag/trigger/v2/orders/dca"
payload := strings.NewReader("{\n \"depositRequestId\": \"a8551844-fa46-41c7-af3a-70340c465bde\",\n \"depositSignedTx\": \"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAEN...\",\n \"userPubkey\": \"BQ72nSv9f3PRyRKCBnHLVrerrv37CYTHm5h3s9VSGQDV\",\n \"inputMint\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"outputMint\": \"So11111111111111111111111111111111111111112\",\n \"inputAmount\": \"20000000\",\n \"orderCount\": 2,\n \"intervalSeconds\": 3600,\n \"orderType\": \"time_based\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.jup.ag/trigger/v2/orders/dca")
.header("x-api-key", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"depositRequestId\": \"a8551844-fa46-41c7-af3a-70340c465bde\",\n \"depositSignedTx\": \"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAEN...\",\n \"userPubkey\": \"BQ72nSv9f3PRyRKCBnHLVrerrv37CYTHm5h3s9VSGQDV\",\n \"inputMint\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"outputMint\": \"So11111111111111111111111111111111111111112\",\n \"inputAmount\": \"20000000\",\n \"orderCount\": 2,\n \"intervalSeconds\": 3600,\n \"orderType\": \"time_based\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jup.ag/trigger/v2/orders/dca")
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["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"depositRequestId\": \"a8551844-fa46-41c7-af3a-70340c465bde\",\n \"depositSignedTx\": \"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAEN...\",\n \"userPubkey\": \"BQ72nSv9f3PRyRKCBnHLVrerrv37CYTHm5h3s9VSGQDV\",\n \"inputMint\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"outputMint\": \"So11111111111111111111111111111111111111112\",\n \"inputAmount\": \"20000000\",\n \"orderCount\": 2,\n \"intervalSeconds\": 3600,\n \"orderType\": \"time_based\"\n}"
response = http.request(request)
puts response.read_body{
"id": "019f0530-36a7-77da-a38f-ed9414bb996b",
"txSignature": "PPbp1QbbKDPjpHM3ScKyZBnCtLKKqmWwDeVj7USdBeEoNQsA1hkN35UQfrY2cQpyAB1pfVi9FdfciYdz7qUXBQA"
}{
"error": "<string>",
"details": {}
}Authorizations
Get API key via https://developers.jup.ag/portal
Body
application/json
Response
DCA order created
Minimal create/cancel response carrying the order ID and an on-chain transaction signature. Returned by DCA create (deposit signature) and by confirm-cancel (withdrawal signature). Unlike price order create, it does not include depositConfirmed.
Was this page helpful?
