public/get_liquidation_history
Returns a paginated history of liquidation auctions, newest first, for a single subaccount or across all of them, optionally bounded by a start/end timestamp window over the auction start. Each entry gives the auctioned subaccount, whether the auction was solvent or insolvent, the fee charged at start, the start and end timestamps, and the bids that filled it with the fraction of the account each absorbed and the cash it moved.
curl --request POST \
--url https://api.derive.xyz/v3/public/get_liquidation_history \
--header 'Content-Type: application/json' \
--data '
{
"end_timestamp": null,
"page": null,
"page_size": null,
"start_timestamp": null,
"subaccount_id": null
}
'import requests
url = "https://api.derive.xyz/v3/public/get_liquidation_history"
payload = {
"end_timestamp": None,
"page": None,
"page_size": None,
"start_timestamp": None,
"subaccount_id": 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,
start_timestamp: null,
subaccount_id: null
})
};
fetch('https://api.derive.xyz/v3/public/get_liquidation_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/public/get_liquidation_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,
'start_timestamp' => null,
'subaccount_id' => 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/public/get_liquidation_history"
payload := strings.NewReader("{\n \"end_timestamp\": null,\n \"page\": null,\n \"page_size\": null,\n \"start_timestamp\": null,\n \"subaccount_id\": 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/public/get_liquidation_history")
.header("Content-Type", "application/json")
.body("{\n \"end_timestamp\": null,\n \"page\": null,\n \"page_size\": null,\n \"start_timestamp\": null,\n \"subaccount_id\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.derive.xyz/v3/public/get_liquidation_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 \"start_timestamp\": null,\n \"subaccount_id\": null\n}"
response = http.request(request)
puts response.read_body{
"auctions": [
{
"auction_id": "<string>",
"auction_type": "solvent",
"bids": [
{
"amounts_liquidated": {},
"cash_received": "<string>",
"discount_pnl": "<string>",
"percent_liquidated": "<string>",
"positions_realized_pnl": {},
"positions_realized_pnl_excl_fees": {},
"realized_pnl": "<string>",
"realized_pnl_excl_fees": "<string>",
"timestamp": 1,
"tx_hash": "<string>"
}
],
"fee": "<string>",
"start_timestamp": 1,
"subaccount_id": 1,
"tx_hash": "<string>",
"end_timestamp": 1
}
],
"pagination": {
"count": 1,
"num_pages": 1
}
}Body
Parameters for public/get_liquidation_history. Omit subaccount_id to span every account. [start_timestamp, end_timestamp] is a unix-millisecond window over the auction start.
End of the window, unix milliseconds (default: unbounded).
x >= 0Page number, 1-based (default 1).
x >= 0Results per page (default 100, max 1000).
x >= 0Start of the window, unix milliseconds (default 0).
x >= 0x >= 0curl --request POST \
--url https://api.derive.xyz/v3/public/get_liquidation_history \
--header 'Content-Type: application/json' \
--data '
{
"end_timestamp": null,
"page": null,
"page_size": null,
"start_timestamp": null,
"subaccount_id": null
}
'import requests
url = "https://api.derive.xyz/v3/public/get_liquidation_history"
payload = {
"end_timestamp": None,
"page": None,
"page_size": None,
"start_timestamp": None,
"subaccount_id": 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,
start_timestamp: null,
subaccount_id: null
})
};
fetch('https://api.derive.xyz/v3/public/get_liquidation_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/public/get_liquidation_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,
'start_timestamp' => null,
'subaccount_id' => 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/public/get_liquidation_history"
payload := strings.NewReader("{\n \"end_timestamp\": null,\n \"page\": null,\n \"page_size\": null,\n \"start_timestamp\": null,\n \"subaccount_id\": 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/public/get_liquidation_history")
.header("Content-Type", "application/json")
.body("{\n \"end_timestamp\": null,\n \"page\": null,\n \"page_size\": null,\n \"start_timestamp\": null,\n \"subaccount_id\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.derive.xyz/v3/public/get_liquidation_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 \"start_timestamp\": null,\n \"subaccount_id\": null\n}"
response = http.request(request)
puts response.read_body{
"auctions": [
{
"auction_id": "<string>",
"auction_type": "solvent",
"bids": [
{
"amounts_liquidated": {},
"cash_received": "<string>",
"discount_pnl": "<string>",
"percent_liquidated": "<string>",
"positions_realized_pnl": {},
"positions_realized_pnl_excl_fees": {},
"realized_pnl": "<string>",
"realized_pnl_excl_fees": "<string>",
"timestamp": 1,
"tx_hash": "<string>"
}
],
"fee": "<string>",
"start_timestamp": 1,
"subaccount_id": 1,
"tx_hash": "<string>",
"end_timestamp": 1
}
],
"pagination": {
"count": 1,
"num_pages": 1
}
}