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": {}
}Create DCA Order
Create a recurring dollar-cost averaging 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
JWT token from the challenge-response auth flow
Body
requestId from the deposit craft response
Base64-encoded signed deposit transaction
Your wallet public key (must match the JWT)
Mint of the token to sell
Mint of the token to buy
Total amount to DCA in smallest units. Dust from uneven division is added to the last round.
Number of rounds to split the deposit into (minimum 2). No fixed upper limit, but each round must be worth at least 10 USD, so the practical maximum is floor(total deposit USD / 10).
x >= 2Seconds between rounds (60 to 31,536,000, i.e. 1 minute to 1 year)
60 <= x <= 31536000time_based runs every interval; price_conditional only fills while the trigger mint price is within the band.
time_based, price_conditional Lower USD price bound. Price-conditional only.
Upper USD price bound. Price-conditional only.
Mint whose USD price is checked against the band. Required for price_conditional. Must be a mint with a supported USD price (in practice the volatile leg / outputMint); a stablecoin such as USDC returns "Trigger mint is not supported". Ignored for time_based.
ISO-8601 time to start the first round. Defaults to now, max 30 days in the future.
Earn While You Wait. When true, idle funds earn Jupiter Lend yield between rounds. Requires orderType time_based, a supported stablecoin input, and a deposit crafted with jlMint. Default false.
Jupiter Lend earn token for the input stablecoin (from GET /lend/v1/earn/tokens, the address whose assetAddress is the inputMint). Required when jlEnabled is true.
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?
