Skip to main content
cURL
curl --request GET \
  --url https://test.deribit.com/api/v2/private/get_user_trades_by_currency_and_time \
  --header 'Content-Type: application/json' \
  --data '
{
  "jsonrpc": "2.0",
  "id": 9292,
  "method": "private/get_user_trades_by_currency_and_time",
  "params": {
    "currency": "BTC",
    "start_timestamp": 1590480630731,
    "end_timestamp": 1510480630731,
    "count": 2
  }
}
'
{
  "jsonrpc": "2.0",
  "id": 9292,
  "result": {
    "trades": [
      {
        "underlying_price": 8994.95,
        "trade_seq": 1,
        "trade_id": "48078936",
        "timestamp": 1590480620145,
        "tick_direction": 1,
        "state": "filled",
        "reduce_only": false,
        "price": 0.028,
        "post_only": false,
        "order_type": "limit",
        "order_id": "4008699030",
        "matching_id": null,
        "mark_price": 0.03135383,
        "liquidity": "M",
        "iv": 38.51,
        "instrument_name": "BTC-27MAY20-8750-C",
        "index_price": 8993.47,
        "fee_currency": "BTC",
        "fee": 0.0004,
        "direction": "sell",
        "amount": 1
      },
      {
        "trade_seq": 299513,
        "trade_id": "47958936",
        "timestamp": 1589923311862,
        "tick_direction": 2,
        "state": "filled",
        "reduce_only": false,
        "price": 9681.5,
        "post_only": false,
        "order_type": "limit",
        "order_id": "3993343822",
        "matching_id": null,
        "mark_price": 9684,
        "liquidity": "M",
        "instrument_name": "BTC-26JUN20",
        "index_price": 9679.48,
        "fee_currency": "BTC",
        "fee": -2.1e-7,
        "direction": "buy",
        "amount": 10
      }
    ],
    "has_more": false
  }
}

Query Parameters

currency
enum<string>
required

The currency symbol Currency, i.e "BTC", "ETH", "USDC"

Available options:
BTC,
ETH,
USDC,
USDT,
EURR
kind
enum<string>

Instrument kind, "combo" for any combo or "any" for all. If not provided instruments of all kinds are considered Instrument kind: "future", "option", "spot", "future_combo", "option_combo", "combo" for any combo or "any" for all

Available options:
future,
option,
spot,
future_combo,
option_combo,
combo,
any
start_timestamp
integer
required

The earliest timestamp to return result from (milliseconds since the UNIX epoch). When param is provided trades are returned from the earliest The timestamp (milliseconds since the Unix epoch)

Example:

1536569522277

end_timestamp
integer
required

The most recent timestamp to return result from (milliseconds since the UNIX epoch). Only one of params: start_timestamp, end_timestamp is truly required The timestamp (milliseconds since the Unix epoch)

Example:

1536569522277

count
integer

Number of requested items, default - 10, maximum - 1000

Required range: 1 <= x <= 1000
sorting
enum<string>

Direction of results sorting (default value means no sorting, results will be returned in order in which they left the database)

Available options:
asc,
desc,
default
historical
boolean

Determines whether historical trade and order records should be retrieved.

  • false (default): Returns recent records: orders for 30 min, trades for 24h.
  • true: Fetches historical records, available after a short delay due to indexing. Recent data is not included.

📖 Related Article: Accessing historical trades and orders using API

Response

200 - application/json

Success response

jsonrpc
enum<string>
required

The JSON-RPC version (2.0)

Available options:
2.0
result
object
required
id
integer

The id that was sent in the request