Other
private/get_subaccount_value_history
POST
/
private
/
get_subaccount_value_history
private/get_subaccount_value_history
curl --request POST \
--url https://api.derive.xyz/v3/private/get_subaccount_value_history \
--header 'Content-Type: application/json' \
--data '
{
"end_timestamp": null,
"page": null,
"page_size": null,
"period": null,
"start_timestamp": null,
"subaccount_id": null,
"wallet": null
}
'import requests
url = "https://api.derive.xyz/v3/private/get_subaccount_value_history"
payload = {
"end_timestamp": None,
"page": None,
"page_size": None,
"period": None,
"start_timestamp": None,
"subaccount_id": None,
"wallet": None
}
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({
end_timestamp: null,
page: null,
page_size: null,
period: null,
start_timestamp: null,
subaccount_id: null,
wallet: null
})
};
fetch('https://api.derive.xyz/v3/private/get_subaccount_value_history', 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.derive.xyz/v3/private/get_subaccount_value_history",
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([
'end_timestamp' => null,
'page' => null,
'page_size' => null,
'period' => null,
'start_timestamp' => null,
'subaccount_id' => null,
'wallet' => null
]),
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://api.derive.xyz/v3/private/get_subaccount_value_history"
payload := strings.NewReader("{\n \"end_timestamp\": null,\n \"page\": null,\n \"page_size\": null,\n \"period\": null,\n \"start_timestamp\": null,\n \"subaccount_id\": null,\n \"wallet\": null\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://api.derive.xyz/v3/private/get_subaccount_value_history")
.header("Content-Type", "application/json")
.body("{\n \"end_timestamp\": null,\n \"page\": null,\n \"page_size\": null,\n \"period\": null,\n \"start_timestamp\": null,\n \"subaccount_id\": null,\n \"wallet\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.derive.xyz/v3/private/get_subaccount_value_history")
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 \"end_timestamp\": null,\n \"page\": null,\n \"page_size\": null,\n \"period\": null,\n \"start_timestamp\": null,\n \"subaccount_id\": null,\n \"wallet\": null\n}"
response = http.request(request)
puts response.read_body{
"pagination": {
"count": 1,
"num_pages": 1
},
"subaccount_value_history": [
{
"currency": "<string>",
"initial_margin": "<string>",
"maintenance_margin": "<string>",
"margin_type": "<string>",
"subaccount_id": 1,
"subaccount_value": "<string>",
"timestamp": 123
}
]
}Body
application/json
wallet, when set, takes precedence over subaccount_id. The window is unix milliseconds; period is seconds and must be one the sampler's tables cover.
Required range:
x >= 0Required range:
x >= 0Required range:
x >= 0Required range:
x >= 0Required range:
x >= 0Required range:
x >= 0Response
Success
By-wallet lookups return every owned subaccount's samples, concatenated and tagged with subaccount_id — not a summed wallet total. Coverage is ragged by design: a subaccount contributes no entry for buckets in which it held nothing, rather than reporting a zero it never had. Callers plotting a wallet total must group by subaccount_id and carry each series forward.
Related topics
Migration skill for your coding agentprivate/get_interest_historyprivate/get_option_settlement_historyprivate/get_subaccount_value_history
curl --request POST \
--url https://api.derive.xyz/v3/private/get_subaccount_value_history \
--header 'Content-Type: application/json' \
--data '
{
"end_timestamp": null,
"page": null,
"page_size": null,
"period": null,
"start_timestamp": null,
"subaccount_id": null,
"wallet": null
}
'import requests
url = "https://api.derive.xyz/v3/private/get_subaccount_value_history"
payload = {
"end_timestamp": None,
"page": None,
"page_size": None,
"period": None,
"start_timestamp": None,
"subaccount_id": None,
"wallet": None
}
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({
end_timestamp: null,
page: null,
page_size: null,
period: null,
start_timestamp: null,
subaccount_id: null,
wallet: null
})
};
fetch('https://api.derive.xyz/v3/private/get_subaccount_value_history', 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.derive.xyz/v3/private/get_subaccount_value_history",
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([
'end_timestamp' => null,
'page' => null,
'page_size' => null,
'period' => null,
'start_timestamp' => null,
'subaccount_id' => null,
'wallet' => null
]),
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://api.derive.xyz/v3/private/get_subaccount_value_history"
payload := strings.NewReader("{\n \"end_timestamp\": null,\n \"page\": null,\n \"page_size\": null,\n \"period\": null,\n \"start_timestamp\": null,\n \"subaccount_id\": null,\n \"wallet\": null\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://api.derive.xyz/v3/private/get_subaccount_value_history")
.header("Content-Type", "application/json")
.body("{\n \"end_timestamp\": null,\n \"page\": null,\n \"page_size\": null,\n \"period\": null,\n \"start_timestamp\": null,\n \"subaccount_id\": null,\n \"wallet\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.derive.xyz/v3/private/get_subaccount_value_history")
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 \"end_timestamp\": null,\n \"page\": null,\n \"page_size\": null,\n \"period\": null,\n \"start_timestamp\": null,\n \"subaccount_id\": null,\n \"wallet\": null\n}"
response = http.request(request)
puts response.read_body{
"pagination": {
"count": 1,
"num_pages": 1
},
"subaccount_value_history": [
{
"currency": "<string>",
"initial_margin": "<string>",
"maintenance_margin": "<string>",
"margin_type": "<string>",
"subaccount_id": 1,
"subaccount_value": "<string>",
"timestamp": 123
}
]
}