curl --request GET \
--url https://test.deribit.com/api/v2/private/get_transaction_log \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 4,
"method": "private/get_transaction_log",
"params": {
"currency": "BTC",
"start_timestamp": "1613657734000",
"end_timestamp": "1613660407000",
"count": 5
}
}
'import requests
url = "https://test.deribit.com/api/v2/private/get_transaction_log"
payload = {
"jsonrpc": "2.0",
"id": 4,
"method": "private/get_transaction_log",
"params": {
"currency": "BTC",
"start_timestamp": "1613657734000",
"end_timestamp": "1613660407000",
"count": 5
}
}
headers = {"Content-Type": "application/json"}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
id: 4,
method: 'private/get_transaction_log',
params: {
currency: 'BTC',
start_timestamp: '1613657734000',
end_timestamp: '1613660407000',
count: 5
}
})
};
fetch('https://test.deribit.com/api/v2/private/get_transaction_log', 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://test.deribit.com/api/v2/private/get_transaction_log",
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([
'jsonrpc' => '2.0',
'id' => 4,
'method' => 'private/get_transaction_log',
'params' => [
'currency' => 'BTC',
'start_timestamp' => '1613657734000',
'end_timestamp' => '1613660407000',
'count' => 5
]
]),
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://test.deribit.com/api/v2/private/get_transaction_log"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": 4,\n \"method\": \"private/get_transaction_log\",\n \"params\": {\n \"currency\": \"BTC\",\n \"start_timestamp\": \"1613657734000\",\n \"end_timestamp\": \"1613660407000\",\n \"count\": 5\n }\n}")
req, _ := http.NewRequest("GET", 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.get("https://test.deribit.com/api/v2/private/get_transaction_log")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": 4,\n \"method\": \"private/get_transaction_log\",\n \"params\": {\n \"currency\": \"BTC\",\n \"start_timestamp\": \"1613657734000\",\n \"end_timestamp\": \"1613660407000\",\n \"count\": 5\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://test.deribit.com/api/v2/private/get_transaction_log")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"id\": 4,\n \"method\": \"private/get_transaction_log\",\n \"params\": {\n \"currency\": \"BTC\",\n \"start_timestamp\": \"1613657734000\",\n \"end_timestamp\": \"1613660407000\",\n \"count\": 5\n }\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": 4,
"result": {
"logs": [
{
"username": "TestUser",
"user_seq": 6010,
"user_id": 7,
"type": "LSP transfer",
"role": "source",
"side": "sell",
"trade_id": null,
"timestamp": 1613659900000,
"price_currency": "USD",
"price": 63481.75,
"position": 0,
"order_id": null,
"session_rpl": -12.4,
"total_interest_pl": 0.00000512,
"interest_pl": 0.00000512,
"instrument_name": "BTC-PERPETUAL",
"id": 61313,
"equity": 2998.5275869,
"currency": "BTC",
"commission": 0,
"change": -2.4,
"cashflow": -2.4,
"balance": 2998.82270418,
"amount": 5000
},
{
"username": "TestUser",
"user_seq": 6009,
"user_id": 7,
"type": "transfer",
"trade_id": null,
"timestamp": 1613659830333,
"side": "-",
"price": null,
"position": null,
"order_id": null,
"interest_pl": null,
"instrument_name": null,
"info": {
"transfer_type": "subaccount",
"other_user_id": 27,
"other_user": "Subaccount"
},
"id": 61312,
"equity": 3000.9275869,
"currency": "BTC",
"commission": 0,
"change": -2.5,
"cashflow": -2.5,
"balance": 3001.22270418
},
{
"username": "TestUser",
"user_seq": 6008,
"user_id": 7,
"type": "settlement",
"trade_id": null,
"total_interest_pl": 0.00001243,
"timestamp": 1613659544153,
"side": "long",
"session_upl": 0.00220172,
"session_rpl": -0.00004467,
"price_currency": "USD",
"price": 51807.07,
"position": 1520,
"order_id": null,
"interest_pl": 0.00000993,
"instrument_name": "BTC-PERPETUAL",
"info": {
"settlement_price": 51807,
"floating_pl": 0.00220172
},
"id": 61311,
"equity": 3003.42821428,
"currency": "BTC",
"commission": null,
"change": 0.00215706,
"cashflow": 0.00215706,
"balance": 3003.72270418,
"amount": 1520
},
{
"username": "TestUser",
"user_seq": 6007,
"user_id": 7,
"type": "deposit",
"trade_id": null,
"timestamp": 1613657828414,
"side": "-",
"price": null,
"position": null,
"order_id": null,
"interest_pl": null,
"instrument_name": null,
"info": {
"transaction": "de6eba075855f32c9510f338d3ca0900376cedcb9f7b142caccfbdc292d3237e",
"deposit_type": "wallet",
"addr": "2N8prMvpZHr8aYqodX3S4yhz5wMxjY8La3p"
},
"id": 61291,
"equity": 3003.4876111,
"currency": "BTC",
"commission": 0,
"change": 0.65,
"cashflow": 0.65,
"balance": 3003.72054712
},
{
"username": "TestUser",
"user_seq": 6006,
"user_role": "maker",
"user_id": 7,
"type": "trade",
"ip": "11.222.33.44",
"trade_id": "28349",
"timestamp": 1613657734620,
"side": "open buy",
"profit_as_cashflow": false,
"price_currency": "BTC",
"price": 0.1537,
"position": 0.7,
"order_id": "67546",
"mark_price": 0.04884653215049635,
"interest_pl": 0,
"instrument_name": "BTC-19FEB21-49200-C",
"info": "Source: api",
"id": 61289,
"equity": 3002.83270455,
"currency": "BTC",
"commission": 0,
"change": -0.10759,
"cashflow": -0.10759,
"balance": 3003.07054712,
"amount": 0.7
},
{
"username": "TestUser",
"user_seq": 6005,
"user_role": "maker",
"user_id": 7,
"type": "trade",
"trade_id": "28349",
"timestamp": 1613657734620,
"side": "close buy",
"profit_as_cashflow": false,
"price_currency": "BTC",
"price": 0.1537,
"position": 0,
"order_id": "67546",
"mark_price": 0.04884653215049635,
"interest_pl": 0,
"instrument_name": "BTC-19FEB21-49200-C",
"info": "Source: api",
"id": 61288,
"equity": 3002.83270455,
"currency": "BTC",
"commission": 0,
"change": -0.04611,
"cashflow": -0.04611,
"balance": 3003.17813712,
"amount": 0.3
},
{
"username": "TestUser",
"user_seq": 6004,
"user_id": 7,
"type": "expiry",
"trade_id": null,
"timestamp": 1613657734620,
"side": "close buy",
"price_currency": "BTC",
"price": 0,
"position": 0,
"order_id": null,
"interest_pl": null,
"instrument_name": "BTC-19FEB21-52000-C",
"info": null,
"id": 61287,
"equity": 3002.83270455,
"currency": "BTC",
"commission": 0,
"change": 0,
"cashflow": 0,
"balance": 3003.17813712,
"amount": 0.3
}
],
"continuation": 61282
}
}private/get_transaction_log
Retrieves a detailed transaction log for the authenticated account. The log includes all account activities such as trades, deposits, withdrawals, transfers, fees, and other balance-affecting operations.
Results can be filtered by currency, time range, and transaction type. Use the continuation parameter for pagination when retrieving large transaction histories. To retrieve transactions for a specific subaccount, use the subaccount_id parameter.
Trade entries executed in Starbase include starbase_match_id, starbase_order_id, and starbase_timestamp.
When an option expires out of the money, the transaction log type is expiry. As there is nothing to settle into futures in this case, this remains the only entry in the transaction log for that expiration.
LSP and ADL position moves are logged as type LSP transfer / ADL transfer. Both the liquidated/deleveraged account and the receiving account get that same type. A separate optional role field (source or destination) is present on those transfer entries โ and also on liquidation transfer and position move โ and is omitted on all other types, including LSP commission / ADL commission and ordinary trades. Do not confuse role with user_role (maker / taker) on trades.
History Limit: This API method has no time limit - users can query transaction history back to account creation. Note that the CSV export feature available on the website is year-limited to 2023.
Note - This method has distinct API rate limiting requirements: Sustained rate: 1 request/second. For more information, see Rate Limits.
๐ Related Support Article: Transaction log
๐ Related Article: Liquidity Support Program (LSP) API Guide
Scope: account:read
curl --request GET \
--url https://test.deribit.com/api/v2/private/get_transaction_log \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 4,
"method": "private/get_transaction_log",
"params": {
"currency": "BTC",
"start_timestamp": "1613657734000",
"end_timestamp": "1613660407000",
"count": 5
}
}
'import requests
url = "https://test.deribit.com/api/v2/private/get_transaction_log"
payload = {
"jsonrpc": "2.0",
"id": 4,
"method": "private/get_transaction_log",
"params": {
"currency": "BTC",
"start_timestamp": "1613657734000",
"end_timestamp": "1613660407000",
"count": 5
}
}
headers = {"Content-Type": "application/json"}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
id: 4,
method: 'private/get_transaction_log',
params: {
currency: 'BTC',
start_timestamp: '1613657734000',
end_timestamp: '1613660407000',
count: 5
}
})
};
fetch('https://test.deribit.com/api/v2/private/get_transaction_log', 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://test.deribit.com/api/v2/private/get_transaction_log",
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([
'jsonrpc' => '2.0',
'id' => 4,
'method' => 'private/get_transaction_log',
'params' => [
'currency' => 'BTC',
'start_timestamp' => '1613657734000',
'end_timestamp' => '1613660407000',
'count' => 5
]
]),
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://test.deribit.com/api/v2/private/get_transaction_log"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": 4,\n \"method\": \"private/get_transaction_log\",\n \"params\": {\n \"currency\": \"BTC\",\n \"start_timestamp\": \"1613657734000\",\n \"end_timestamp\": \"1613660407000\",\n \"count\": 5\n }\n}")
req, _ := http.NewRequest("GET", 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.get("https://test.deribit.com/api/v2/private/get_transaction_log")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": 4,\n \"method\": \"private/get_transaction_log\",\n \"params\": {\n \"currency\": \"BTC\",\n \"start_timestamp\": \"1613657734000\",\n \"end_timestamp\": \"1613660407000\",\n \"count\": 5\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://test.deribit.com/api/v2/private/get_transaction_log")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"id\": 4,\n \"method\": \"private/get_transaction_log\",\n \"params\": {\n \"currency\": \"BTC\",\n \"start_timestamp\": \"1613657734000\",\n \"end_timestamp\": \"1613660407000\",\n \"count\": 5\n }\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": 4,
"result": {
"logs": [
{
"username": "TestUser",
"user_seq": 6010,
"user_id": 7,
"type": "LSP transfer",
"role": "source",
"side": "sell",
"trade_id": null,
"timestamp": 1613659900000,
"price_currency": "USD",
"price": 63481.75,
"position": 0,
"order_id": null,
"session_rpl": -12.4,
"total_interest_pl": 0.00000512,
"interest_pl": 0.00000512,
"instrument_name": "BTC-PERPETUAL",
"id": 61313,
"equity": 2998.5275869,
"currency": "BTC",
"commission": 0,
"change": -2.4,
"cashflow": -2.4,
"balance": 2998.82270418,
"amount": 5000
},
{
"username": "TestUser",
"user_seq": 6009,
"user_id": 7,
"type": "transfer",
"trade_id": null,
"timestamp": 1613659830333,
"side": "-",
"price": null,
"position": null,
"order_id": null,
"interest_pl": null,
"instrument_name": null,
"info": {
"transfer_type": "subaccount",
"other_user_id": 27,
"other_user": "Subaccount"
},
"id": 61312,
"equity": 3000.9275869,
"currency": "BTC",
"commission": 0,
"change": -2.5,
"cashflow": -2.5,
"balance": 3001.22270418
},
{
"username": "TestUser",
"user_seq": 6008,
"user_id": 7,
"type": "settlement",
"trade_id": null,
"total_interest_pl": 0.00001243,
"timestamp": 1613659544153,
"side": "long",
"session_upl": 0.00220172,
"session_rpl": -0.00004467,
"price_currency": "USD",
"price": 51807.07,
"position": 1520,
"order_id": null,
"interest_pl": 0.00000993,
"instrument_name": "BTC-PERPETUAL",
"info": {
"settlement_price": 51807,
"floating_pl": 0.00220172
},
"id": 61311,
"equity": 3003.42821428,
"currency": "BTC",
"commission": null,
"change": 0.00215706,
"cashflow": 0.00215706,
"balance": 3003.72270418,
"amount": 1520
},
{
"username": "TestUser",
"user_seq": 6007,
"user_id": 7,
"type": "deposit",
"trade_id": null,
"timestamp": 1613657828414,
"side": "-",
"price": null,
"position": null,
"order_id": null,
"interest_pl": null,
"instrument_name": null,
"info": {
"transaction": "de6eba075855f32c9510f338d3ca0900376cedcb9f7b142caccfbdc292d3237e",
"deposit_type": "wallet",
"addr": "2N8prMvpZHr8aYqodX3S4yhz5wMxjY8La3p"
},
"id": 61291,
"equity": 3003.4876111,
"currency": "BTC",
"commission": 0,
"change": 0.65,
"cashflow": 0.65,
"balance": 3003.72054712
},
{
"username": "TestUser",
"user_seq": 6006,
"user_role": "maker",
"user_id": 7,
"type": "trade",
"ip": "11.222.33.44",
"trade_id": "28349",
"timestamp": 1613657734620,
"side": "open buy",
"profit_as_cashflow": false,
"price_currency": "BTC",
"price": 0.1537,
"position": 0.7,
"order_id": "67546",
"mark_price": 0.04884653215049635,
"interest_pl": 0,
"instrument_name": "BTC-19FEB21-49200-C",
"info": "Source: api",
"id": 61289,
"equity": 3002.83270455,
"currency": "BTC",
"commission": 0,
"change": -0.10759,
"cashflow": -0.10759,
"balance": 3003.07054712,
"amount": 0.7
},
{
"username": "TestUser",
"user_seq": 6005,
"user_role": "maker",
"user_id": 7,
"type": "trade",
"trade_id": "28349",
"timestamp": 1613657734620,
"side": "close buy",
"profit_as_cashflow": false,
"price_currency": "BTC",
"price": 0.1537,
"position": 0,
"order_id": "67546",
"mark_price": 0.04884653215049635,
"interest_pl": 0,
"instrument_name": "BTC-19FEB21-49200-C",
"info": "Source: api",
"id": 61288,
"equity": 3002.83270455,
"currency": "BTC",
"commission": 0,
"change": -0.04611,
"cashflow": -0.04611,
"balance": 3003.17813712,
"amount": 0.3
},
{
"username": "TestUser",
"user_seq": 6004,
"user_id": 7,
"type": "expiry",
"trade_id": null,
"timestamp": 1613657734620,
"side": "close buy",
"price_currency": "BTC",
"price": 0,
"position": 0,
"order_id": null,
"interest_pl": null,
"instrument_name": "BTC-19FEB21-52000-C",
"info": null,
"id": 61287,
"equity": 3002.83270455,
"currency": "BTC",
"commission": 0,
"change": 0,
"cashflow": 0,
"balance": 3003.17813712,
"amount": 0.3
}
],
"continuation": 61282
}
}Query Parameters
The currency symbol.
๐ Related Article: Using the currency Parameter
Currency, i.e "BTC", "ETH", "USDC"
BTC, ETH, STETH, ETHW, USDC, USDT, EURR, SOL, XRP, USYC, PAXG, BNB, USDE The earliest timestamp to return result from (milliseconds since the UNIX epoch) The timestamp (milliseconds since the Unix epoch)
1536569522277
The most recent timestamp to return result from (milliseconds since the UNIX epoch) The timestamp (milliseconds since the Unix epoch)
1536569522277
The following keywords can be used to filter the results: trade, maker, taker, open, close, liquidation, buy, sell, withdrawal, delivery, settlement, deposit, transfer, option, future, correction, block_trade, swap, expiry. Plus withdrawal or transfer addresses
"settlement"
Count of transaction log entries returned, default - 100, maximum - 250
1 <= x <= 250Id of a subaccount
9
Continuation token for pagination
429946
Response
Success response
The JSON-RPC version (2.0)
2.0 Hide child attributes
Hide child attributes
Continuation token for pagination. NULL when no continuation.
429946
Hide child attributes
Hide child attributes
Unique identifier
5967413
Currency, i.e "BTC", "ETH", "USDC"
BTC, ETH, USDC, USDT, EURR The timestamp (milliseconds since the Unix epoch)
1536569522277
Unique user identifier
57874
Commission paid so far (in base currency)
For futures and perpetual contracts: Realized session PNL (since last settlement). For options: the amount paid or received for the options traded.
Cash balance after the transaction
Change in cash balance. For trades: fees and options premium paid/received. For settlement: Futures session PNL and perpetual session funding.
Sequential identifier of user transaction
Transaction category. The most common values are: trade, deposit, withdrawal, settlement, delivery, transfer, swap, correction, expiry, LSP transfer, LSP commission, ADL transfer, ADL commission. New types can be added at any time.
type is present on every log entry. It is not a substitute for role: both sides of an LSP or ADL position move use the same type (LSP transfer or ADL transfer). Which side this entry is on is role, when that field is present.
System name or user defined subaccount alias
"MrTrader"
Which side of a position move this log entry represents: source (the account the position is taken from) or destination (the account receiving the position).
Present only on LSP transfer, ADL transfer, liquidation transfer, and position move entries. Omitted on every other type, including LSP commission, ADL commission, trade, settlement, and transfer. Not the same as user_role (maker / taker) on trade entries.
Websocket liquidation notifications do not use this field; they distinguish sides with state (lsp_transfer / adl_transfer vs adl_transfer_received).
source, destination Additional information regarding transaction. Strongly dependent on the log entry type
Updated equity value after the transaction
Market price during the trade
The settlement price for the instrument during the delivery
The index price for the instrument during the delivery
Unique instrument identifier
"BTC-PERPETUAL"
Updated position size after the transaction
One of: short or long in case of settlements, close sell or close buy in case of deliveries, open sell, open buy, close sell, close buy in case of trades
It represents the requested order size. For perpetual and inverse futures the amount is in USD units. For options and linear futures it is the underlying base currency coin.
Settlement/delivery price or the price level of the traded contracts
Currency symbol associated with the price field value
Unique (per currency) trade identifier
Unique order identifier
"ETH-100234"
Trade role of the user: maker or taker
maker, taker Fee role of the user: maker or taker. Can be different from trade role of the user when iceberg order was involved in matching.
maker, taker Indicator informing whether the cashflow is waiting for settlement or not
Funding PnL amount for the interval between this log entry and the previous trade or position change on perpetual instruments
ID of the Block RFQ - when trade was part of the Block RFQ
The IP address from which the trade was initiated
Starbase match id for trade entries executed in Starbase
Raw Starbase order id for trade entries associated with orders placed in Starbase
103148386170
Starbase causal timestamp for trade entries executed in Starbase
1536569522277000000
Realized profit and loss accrued in the current trading session (since the last daily settlement). Resets at each daily settlement.
0.1
Unrealized profit and loss on open positions in the current trading session (since the last daily settlement).
0.846863
Total funding PnL accrued in the current trading session since the last daily settlement at 08:00 UTC, in the settlement currency. Resets at each daily settlement.
It represents the order size in contract units. (Optional, may be absent in historical data).
The id that was sent in the request
Was this page helpful?