private/liquidate
Bids on an open liquidation auction. Names the bidder’s own subaccount, the account being auctioned, the fraction of it to absorb as a whole percent (a multiple of 0.01), and a signed limit price. The limit is compared against the discounted price of the whole remaining account — the quote’s estimated_bid_price — not against the cash the bid actually moves, and it is negative for an insolvent auction where the security module pays the bidder. The realized fill is capped at the auction’s current maximum proportion, so it can land below the requested percent. Quote the auction first with public/get_live_auctions or the auctions.watch channel: both the price and the fraction on offer move with wall-clock and with the account’s mark.
curl --request POST \
--url https://api.derive.xyz/v3/private/liquidate \
--header 'Content-Type: application/json' \
--data '
{
"liquidate_subaccount_id": 1,
"nonce": "<string>",
"percent_of_acc": "<string>",
"price_limit": "<string>",
"signature": "<string>",
"signature_expiry_sec": 1,
"signer": "<string>",
"subaccount_id": 1
}
'import requests
url = "https://api.derive.xyz/v3/private/liquidate"
payload = {
"liquidate_subaccount_id": 1,
"nonce": "<string>",
"percent_of_acc": "<string>",
"price_limit": "<string>",
"signature": "<string>",
"signature_expiry_sec": 1,
"signer": "<string>",
"subaccount_id": 1
}
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({
liquidate_subaccount_id: 1,
nonce: '<string>',
percent_of_acc: '<string>',
price_limit: '<string>',
signature: '<string>',
signature_expiry_sec: 1,
signer: '<string>',
subaccount_id: 1
})
};
fetch('https://api.derive.xyz/v3/private/liquidate', 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/liquidate",
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([
'liquidate_subaccount_id' => 1,
'nonce' => '<string>',
'percent_of_acc' => '<string>',
'price_limit' => '<string>',
'signature' => '<string>',
'signature_expiry_sec' => 1,
'signer' => '<string>',
'subaccount_id' => 1
]),
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/liquidate"
payload := strings.NewReader("{\n \"liquidate_subaccount_id\": 1,\n \"nonce\": \"<string>\",\n \"percent_of_acc\": \"<string>\",\n \"price_limit\": \"<string>\",\n \"signature\": \"<string>\",\n \"signature_expiry_sec\": 1,\n \"signer\": \"<string>\",\n \"subaccount_id\": 1\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/liquidate")
.header("Content-Type", "application/json")
.body("{\n \"liquidate_subaccount_id\": 1,\n \"nonce\": \"<string>\",\n \"percent_of_acc\": \"<string>\",\n \"price_limit\": \"<string>\",\n \"signature\": \"<string>\",\n \"signature_expiry_sec\": 1,\n \"signer\": \"<string>\",\n \"subaccount_id\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.derive.xyz/v3/private/liquidate")
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 \"liquidate_subaccount_id\": 1,\n \"nonce\": \"<string>\",\n \"percent_of_acc\": \"<string>\",\n \"price_limit\": \"<string>\",\n \"signature\": \"<string>\",\n \"signature_expiry_sec\": 1,\n \"signer\": \"<string>\",\n \"subaccount_id\": 1\n}"
response = http.request(request)
puts response.read_body{
"op_uuid": "<string>",
"operation_id": 1
}Body
Subaccount being liquidated.
x >= 0Fraction of the account to liquidate ("1.0" = 100%), decimal string or JSON number. Must be a whole percent, i.e. a multiple of "0.01".
Max total cash paid for the filled portion; negative is a minimum payout in insolvent auctions. "0" opts out. Decimal string or JSON number.
x >= 0Bidder subaccount.
x >= 0curl --request POST \
--url https://api.derive.xyz/v3/private/liquidate \
--header 'Content-Type: application/json' \
--data '
{
"liquidate_subaccount_id": 1,
"nonce": "<string>",
"percent_of_acc": "<string>",
"price_limit": "<string>",
"signature": "<string>",
"signature_expiry_sec": 1,
"signer": "<string>",
"subaccount_id": 1
}
'import requests
url = "https://api.derive.xyz/v3/private/liquidate"
payload = {
"liquidate_subaccount_id": 1,
"nonce": "<string>",
"percent_of_acc": "<string>",
"price_limit": "<string>",
"signature": "<string>",
"signature_expiry_sec": 1,
"signer": "<string>",
"subaccount_id": 1
}
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({
liquidate_subaccount_id: 1,
nonce: '<string>',
percent_of_acc: '<string>',
price_limit: '<string>',
signature: '<string>',
signature_expiry_sec: 1,
signer: '<string>',
subaccount_id: 1
})
};
fetch('https://api.derive.xyz/v3/private/liquidate', 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/liquidate",
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([
'liquidate_subaccount_id' => 1,
'nonce' => '<string>',
'percent_of_acc' => '<string>',
'price_limit' => '<string>',
'signature' => '<string>',
'signature_expiry_sec' => 1,
'signer' => '<string>',
'subaccount_id' => 1
]),
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/liquidate"
payload := strings.NewReader("{\n \"liquidate_subaccount_id\": 1,\n \"nonce\": \"<string>\",\n \"percent_of_acc\": \"<string>\",\n \"price_limit\": \"<string>\",\n \"signature\": \"<string>\",\n \"signature_expiry_sec\": 1,\n \"signer\": \"<string>\",\n \"subaccount_id\": 1\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/liquidate")
.header("Content-Type", "application/json")
.body("{\n \"liquidate_subaccount_id\": 1,\n \"nonce\": \"<string>\",\n \"percent_of_acc\": \"<string>\",\n \"price_limit\": \"<string>\",\n \"signature\": \"<string>\",\n \"signature_expiry_sec\": 1,\n \"signer\": \"<string>\",\n \"subaccount_id\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.derive.xyz/v3/private/liquidate")
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 \"liquidate_subaccount_id\": 1,\n \"nonce\": \"<string>\",\n \"percent_of_acc\": \"<string>\",\n \"price_limit\": \"<string>\",\n \"signature\": \"<string>\",\n \"signature_expiry_sec\": 1,\n \"signer\": \"<string>\",\n \"subaccount_id\": 1\n}"
response = http.request(request)
puts response.read_body{
"op_uuid": "<string>",
"operation_id": 1
}