Skip to main content
cURL
curl --request GET \
  --url https://test.deribit.com/api/v2/public/get_last_trades_by_currency \
  --header 'Content-Type: application/json' \
  --data '
{
  "jsonrpc": "2.0",
  "id": 9290,
  "method": "public/get_last_trades_by_currency",
  "params": {
    "currency": "BTC",
    "count": 1
  }
}
'
{
  "jsonrpc": "2.0",
  "id": 1469,
  "result": {
    "trades": [
      {
        "trade_seq": 3471,
        "trade_id": "48077291",
        "timestamp": 1590470616101,
        "tick_direction": 2,
        "price": 0.032,
        "mark_price": 0.04070324,
        "iv": 74.74,
        "instrument_name": "BTC-25SEP20-6000-P",
        "index_price": 8899.93,
        "direction": "sell",
        "amount": 0.5
      }
    ],
    "has_more": true
  }
}

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_id
string

The ID of the first trade to be returned. Number for BTC trades, or hyphen name in ex. "ETH-15" # "ETH_USDC-16" Unique (per currency) trade identifier

end_id
string

The ID of the last trade to be returned. Number for BTC trades, or hyphen name in ex. "ETH-15" # "ETH_USDC-16" Unique (per currency) trade identifier

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

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

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