market:options:order:snapshots

Subscribes/Unsubscribes to market options Order Book Snapshots data.

Make sure you're connected to this subscription: wss://ws.web3api.io.

Request

{
  "jsonrpc" : "2.0",
  "id"      : 1,
  "method"  : "subscribe",
  "params"  : [ "market:options:order:snapshots", { "instrument": "BTC-24JUN22-15000-P", "exchange": "deribit" } ]
}
ParamTypeDescription
instrumentstringThe asset instrument. (REQUIRED)
exchangestringThe exchange for which to retrieve asset instruments. (OPTIONAL)

Response

"result": {
  "exchange": "deribit",
  "instrument": "BTC-24JUN22-15000-P",
  "timestamp": 1638355080000,
  "exchangeTimestamp": 1638355095066,
  "exchangeTimestampNanoseconds": 0,
  "underlyingPrice": 60041.9,
  "underlyingIndex": "BTC-24JUN22",
  "stats": {
    "volume": 1.1,
    "price_change": -27.2727,
    "low": 0.004,
    "high": 0.0055
  },
  "state": "open",
  "openInterest": 430.5,
  "minPrice": 0.0001,
  "maxPrice": 0.021,
  "markPrice": 0.0050063,
  "markIv": 102.15,
  "lastPrice": 0.004,
  "interestRate": 0.0,
  "indexPrice": 56942.12,
  "greeks": {
    "vega": 16.13665,
    "theta": -4.02251,
    "rho": -6.43421,
    "gamma": 0.0,
    "delta": -0.01408
  },
  "estimatedDeliveryPrice": 56942.12,
  "bids": [
    [0.0045, 34.5],
    [0.004, 15.0],
    [0.002, 10.0],
    [0.0005, 0.2]
  ],
  "bidIv": 100.21,
  "bestBidPrice": 0.0045,
  "bestBidAmount": 34.5,
  "bestAskPrice": 0.0055,
  "bestAskAmount": 3.2,
  "asks": [
    [0.0055, 3.2],
    [0.006, 1.0],
    [0.0065, 30.6],
    [0.007, 17.0],
    [0.0085, 10.0],
    [0.022, 0.1],
    [0.03, 0.1],
    [0.032, 0.5],
    [0.036, 0.1],
    [0.0405, 0.1],
    [0.041, 0.1],
    [0.05, 0.1],
    [0.06, 0.1],
    [0.075, 0.1],
    [0.085, 0.1],
    [0.1, 0.1],
    [0.125, 0.1],
    [0.15, 0.1],
    [0.175, 0.1],
    [0.2, 0.1],
    [0.225, 0.1],
    [0.25, 0.1],
    [0.5, 90.0]
  ],
  "askIv": 103.94,
  "sequence": 37544581750,
  "metadata": null
}
FieldTypeDescription
exchangestringThe exchange.
instrumentstringThe instrument.
timestampnumberThe time at which the order book snapshot took place.
exchangeTimestampnumber | nullTimestamp that the exchange returned.
exchangeTimestampNanosecondsnumber | nullNanoseconds part of exchangeTimestamp.
underlyingPricenumber | nullUnderlying price for implied volatility calculations.
underlyingIndexstring | nullName of the underlying future, or indexPrice.
statsobject | null
stats.highnumber | nullHighest price during 24h.
stats.lownumber | nullLowest price during 24h.
stats.price_changenumber | null24-hour price change expressed as a percentage, null if there weren't any trades.
stats.volumenumber | nullVolume during last 24h in base currency.
statestring | nullThe state of the order book. Possible values are open and closed.
openInterestnumber | nullThe amount of corresponding cryptocurrency contracts, e.g., BTC or ETH.
minPricenumber | nullThe minimum price for the future. Any sell orders you submit lower than this price will be clamped to this minimum.
maxPricenumber | nullThe maximum price for the future. Any buy orders you submit higher than this price, will be clamped to this maximum.
markPricenumber | nullThe mark price for the instrument.
markIvnumber | nullImplied volatility for mark price.
lastPricenumber | nullThe price for the last trade.
interestRatenumber | nullInterest rate used in implied volatility calculations.
indexPricenumber | nullCurrent index price
greeksobject | null
greeks.deltanumber | nullThe delta value for the option.
greeks.gammanumber | nullThe gamma value for the option.
greeks.rhonumber | nullThe rho value for the option.
greeks.thetanumber | nullThe theta value for the option.
greeks.veganumber | nullThe vega value for the option.
estimatedDeliveryPricenumber | nullThe settlement price for the instrument. Only when state = open.
bidsarray of [price, amount]List of bids.
bidIvnumber | nullImplied volatility for best bid.
bestBidPricenumber | nullThe current best bid price, null if there aren't any bids.
bestBidAmountnumber | nullIt represents the requested order size of all best bids.
bestAskPricenumber | nullThe current best ask price, null if there aren't any asks.
bestAskAmountnumber | nullIt represents the requested order size of all best asks.
asksarray of [price, amount]List of asks.
askIvnumber | nullImplied volatility for best ask.
sequencenumber | null
metadataobject | null

Example

const WebSocket = require('ws');
const ws = new WebSocket('wss://ws.web3api.io/', {headers: {x-api-key:'<api_key>'}});

ws.on('open', () => {
  ws.send(JSON.stringify({
      jsonrpc: '2.0',
      method: 'subscribe',
      params: ['market:options:order:snapshots'],
      id: 1,
    }));
});

ws.on('message', data => {
  console.log(JSON.stringify(JSON.parse(data), null, 2));
});