Skip to main content
cURL
curl --request GET \
  --url https://test.deribit.com/api/v2/private/get_user_trades_by_instrument \
  --header 'Content-Type: application/json' \
  --data '
{
  "jsonrpc": "2.0",
  "id": 5728,
  "method": "private/get_user_trades_by_instrument",
  "params": {
    "instrument_name": "ETH-PERPETUAL",
    "start_seq": 1966042,
    "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

instrument_name
string
required

Instrument name Unique instrument identifier

Example:

"BTC-PERPETUAL"

start_seq
integer

The sequence number of the first trade to be returned

end_seq
integer

The sequence number of the last trade to be returned

count
integer

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

Required range: 1 <= x <= 1000
start_timestamp
integer

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

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

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

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

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