Backtesting
Submit backtest run
Submits a strategy simulation job. Fees, slippage, and funding assumptions are required so results are reproducible and gate-eligible.
POST
/
api
/
v2
/
backtest
/
runs
Submit backtest run
curl --request POST \
--url https://api.quantdesk.app/api/v2/backtest/runs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dataset_id": "sol-perp-1h-2025",
"strategy": {},
"fees": 5,
"slippage": 3,
"funding": true
}
'import requests
url = "https://api.quantdesk.app/api/v2/backtest/runs"
payload = {
"dataset_id": "sol-perp-1h-2025",
"strategy": {},
"fees": 5,
"slippage": 3,
"funding": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dataset_id: 'sol-perp-1h-2025',
strategy: {},
fees: 5,
slippage: 3,
funding: true
})
};
fetch('https://api.quantdesk.app/api/v2/backtest/runs', 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.quantdesk.app/api/v2/backtest/runs",
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([
'dataset_id' => 'sol-perp-1h-2025',
'strategy' => [
],
'fees' => 5,
'slippage' => 3,
'funding' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.quantdesk.app/api/v2/backtest/runs"
payload := strings.NewReader("{\n \"dataset_id\": \"sol-perp-1h-2025\",\n \"strategy\": {},\n \"fees\": 5,\n \"slippage\": 3,\n \"funding\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
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.quantdesk.app/api/v2/backtest/runs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dataset_id\": \"sol-perp-1h-2025\",\n \"strategy\": {},\n \"fees\": 5,\n \"slippage\": 3,\n \"funding\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.quantdesk.app/api/v2/backtest/runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dataset_id\": \"sol-perp-1h-2025\",\n \"strategy\": {},\n \"fees\": 5,\n \"slippage\": 3,\n \"funding\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"run_id": "b4f1c2a0-6d3e-4f7a-9c1b-0a2d3e4f5a6b",
"status": "queued"
}
}{
"success": false,
"error": "PORTFOLIO_NOT_FOUND",
"code": "PORTFOLIO_NOT_FOUND",
"message": "Wallet has not initialized a V2 portfolio yet.",
"timestamp": "2023-11-07T05:31:56Z",
"request_id": "req_8f2a1c"
}Authorizations
Bearer JWT obtained from the wallet session flow. See the Authentication guide.
Body
application/json
⌘I
Submit backtest run
curl --request POST \
--url https://api.quantdesk.app/api/v2/backtest/runs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dataset_id": "sol-perp-1h-2025",
"strategy": {},
"fees": 5,
"slippage": 3,
"funding": true
}
'import requests
url = "https://api.quantdesk.app/api/v2/backtest/runs"
payload = {
"dataset_id": "sol-perp-1h-2025",
"strategy": {},
"fees": 5,
"slippage": 3,
"funding": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dataset_id: 'sol-perp-1h-2025',
strategy: {},
fees: 5,
slippage: 3,
funding: true
})
};
fetch('https://api.quantdesk.app/api/v2/backtest/runs', 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.quantdesk.app/api/v2/backtest/runs",
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([
'dataset_id' => 'sol-perp-1h-2025',
'strategy' => [
],
'fees' => 5,
'slippage' => 3,
'funding' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.quantdesk.app/api/v2/backtest/runs"
payload := strings.NewReader("{\n \"dataset_id\": \"sol-perp-1h-2025\",\n \"strategy\": {},\n \"fees\": 5,\n \"slippage\": 3,\n \"funding\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
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.quantdesk.app/api/v2/backtest/runs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dataset_id\": \"sol-perp-1h-2025\",\n \"strategy\": {},\n \"fees\": 5,\n \"slippage\": 3,\n \"funding\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.quantdesk.app/api/v2/backtest/runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dataset_id\": \"sol-perp-1h-2025\",\n \"strategy\": {},\n \"fees\": 5,\n \"slippage\": 3,\n \"funding\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"run_id": "b4f1c2a0-6d3e-4f7a-9c1b-0a2d3e4f5a6b",
"status": "queued"
}
}{
"success": false,
"error": "PORTFOLIO_NOT_FOUND",
"code": "PORTFOLIO_NOT_FOUND",
"message": "Wallet has not initialized a V2 portfolio yet.",
"timestamp": "2023-11-07T05:31:56Z",
"request_id": "req_8f2a1c"
}