curl --request GET \
--url https://drb.coinbase.com/api/v2/private/get_settlement_history_by_instrument \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": 2192,
"jsonrpc": "2.0",
"method": "private/get_settlement_history_by_instrument",
"params": {
"count": 1,
"instrument_name": "ETH-22FEB19",
"type": "settlement"
}
}
'import requests
url = "https://drb.coinbase.com/api/v2/private/get_settlement_history_by_instrument"
payload = {
"id": 2192,
"jsonrpc": "2.0",
"method": "private/get_settlement_history_by_instrument",
"params": {
"count": 1,
"instrument_name": "ETH-22FEB19",
"type": "settlement"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: 2192,
jsonrpc: '2.0',
method: 'private/get_settlement_history_by_instrument',
params: {count: 1, instrument_name: 'ETH-22FEB19', type: 'settlement'}
})
};
fetch('https://drb.coinbase.com/api/v2/private/get_settlement_history_by_instrument', 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://drb.coinbase.com/api/v2/private/get_settlement_history_by_instrument",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'id' => 2192,
'jsonrpc' => '2.0',
'method' => 'private/get_settlement_history_by_instrument',
'params' => [
'count' => 1,
'instrument_name' => 'ETH-22FEB19',
'type' => 'settlement'
]
]),
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://drb.coinbase.com/api/v2/private/get_settlement_history_by_instrument"
payload := strings.NewReader("{\n \"id\": 2192,\n \"jsonrpc\": \"2.0\",\n \"method\": \"private/get_settlement_history_by_instrument\",\n \"params\": {\n \"count\": 1,\n \"instrument_name\": \"ETH-22FEB19\",\n \"type\": \"settlement\"\n }\n}")
req, _ := http.NewRequest("GET", 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.get("https://drb.coinbase.com/api/v2/private/get_settlement_history_by_instrument")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": 2192,\n \"jsonrpc\": \"2.0\",\n \"method\": \"private/get_settlement_history_by_instrument\",\n \"params\": {\n \"count\": 1,\n \"instrument_name\": \"ETH-22FEB19\",\n \"type\": \"settlement\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://drb.coinbase.com/api/v2/private/get_settlement_history_by_instrument")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": 2192,\n \"jsonrpc\": \"2.0\",\n \"method\": \"private/get_settlement_history_by_instrument\",\n \"params\": {\n \"count\": 1,\n \"instrument_name\": \"ETH-22FEB19\",\n \"type\": \"settlement\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 2192,
"jsonrpc": "2.0",
"result": {
"continuation": "xY7T6cusbMBNpH9SNmKb94jXSBxUPojJEdCPL4YociHBUgAhWQvEP",
"settlements": [
{
"index_price": 119.8,
"instrument_name": "ETH-22FEB19",
"mark_price": 121.67,
"position": -66,
"profit_loss": -0.001783937,
"session_profit_loss": 0.038358299,
"timestamp": 1550475692526,
"type": "settlement"
}
]
}
}private/get_settlement_history_by_instrument
Retrieves settlement, delivery, and bankruptcy events for a specific instrument that have affected your account. Settlements occur when futures or options contracts expire and are settled at the delivery price.
Results can be filtered by settlement type and timestamp. Use pagination parameters (count and continuation) to retrieve large settlement histories. This method is useful for tracking settlement events for a specific instrument.
curl --request GET \
--url https://drb.coinbase.com/api/v2/private/get_settlement_history_by_instrument \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": 2192,
"jsonrpc": "2.0",
"method": "private/get_settlement_history_by_instrument",
"params": {
"count": 1,
"instrument_name": "ETH-22FEB19",
"type": "settlement"
}
}
'import requests
url = "https://drb.coinbase.com/api/v2/private/get_settlement_history_by_instrument"
payload = {
"id": 2192,
"jsonrpc": "2.0",
"method": "private/get_settlement_history_by_instrument",
"params": {
"count": 1,
"instrument_name": "ETH-22FEB19",
"type": "settlement"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: 2192,
jsonrpc: '2.0',
method: 'private/get_settlement_history_by_instrument',
params: {count: 1, instrument_name: 'ETH-22FEB19', type: 'settlement'}
})
};
fetch('https://drb.coinbase.com/api/v2/private/get_settlement_history_by_instrument', 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://drb.coinbase.com/api/v2/private/get_settlement_history_by_instrument",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'id' => 2192,
'jsonrpc' => '2.0',
'method' => 'private/get_settlement_history_by_instrument',
'params' => [
'count' => 1,
'instrument_name' => 'ETH-22FEB19',
'type' => 'settlement'
]
]),
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://drb.coinbase.com/api/v2/private/get_settlement_history_by_instrument"
payload := strings.NewReader("{\n \"id\": 2192,\n \"jsonrpc\": \"2.0\",\n \"method\": \"private/get_settlement_history_by_instrument\",\n \"params\": {\n \"count\": 1,\n \"instrument_name\": \"ETH-22FEB19\",\n \"type\": \"settlement\"\n }\n}")
req, _ := http.NewRequest("GET", 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.get("https://drb.coinbase.com/api/v2/private/get_settlement_history_by_instrument")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": 2192,\n \"jsonrpc\": \"2.0\",\n \"method\": \"private/get_settlement_history_by_instrument\",\n \"params\": {\n \"count\": 1,\n \"instrument_name\": \"ETH-22FEB19\",\n \"type\": \"settlement\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://drb.coinbase.com/api/v2/private/get_settlement_history_by_instrument")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": 2192,\n \"jsonrpc\": \"2.0\",\n \"method\": \"private/get_settlement_history_by_instrument\",\n \"params\": {\n \"count\": 1,\n \"instrument_name\": \"ETH-22FEB19\",\n \"type\": \"settlement\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 2192,
"jsonrpc": "2.0",
"result": {
"continuation": "xY7T6cusbMBNpH9SNmKb94jXSBxUPojJEdCPL4YociHBUgAhWQvEP",
"settlements": [
{
"index_price": 119.8,
"instrument_name": "ETH-22FEB19",
"mark_price": 121.67,
"position": -66,
"profit_loss": -0.001783937,
"session_profit_loss": 0.038358299,
"timestamp": 1550475692526,
"type": "settlement"
}
]
}
}Authorizations
Call public/auth with grant_type: coinbase_cdp and a CDP JWT. Send the returned access_token as Authorization: Bearer.
Query Parameters
Instrument name Unique instrument identifier
"BTC-PERPETUAL"
Settlement type
The type of settlement. settlement, delivery or bankruptcy.
settlement, delivery, bankruptcy Number of requested items, default - 20, maximum - 1000
1 <= x <= 1000Continuation token for pagination
"xY7T6cutS3t2B9YtaDkE6TS379oKnkzTvmEDUnEUP2Msa9xKWNNaT"
The latest timestamp to return result from (milliseconds since the UNIX epoch) The timestamp (milliseconds since the Unix epoch)
1536569522277
Was this page helpful?