market:options:order:snapshots

Subscribes/Unsubscribes to market options Order Book Snapshots data.


🆕

Important Update: WebSocket Endpoint Migration

We are excited to announce an upgrade to our WebSocket service! To ensure that our users enjoy enhanced reliability and performance, we have migrated our WebSocket endpoint. Please update your applications to connect to the new endpoint as described here:

  • Old Endpoint: wss://ws.web3api.io/
  • New Endpoint: wss://ws.amberdata.com/options

Action Required

Users are required to update the endpoint URL in their applications. The good news is that the response JSON schemas remain unchanged, so you can expect a seamless transition with minimal adjustments needed on your end.

Support

We understand that changes like these can raise questions. Our support team is here to assist with any issues or concerns you may have during this migration process. Please don’t hesitate to contact us for support at: [email protected].

We appreciate your prompt action to migrate to the new WebSocket endpoint.

Once you're connected to this subscription: wss://ws.amberdata.com/options, you must provide either the instrument or exchange - one needs to be specified, both cannot be empty.

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

{
    "jsonrpc": "2.0",
    "method": "subscription",
    "params": {
        "subscription": "cd09d018-fa34-408d-aef7-8a5ef2c641b3",
        "result": {
            "exchange": "deribit",
            "instrument": "BTC-12APR24-71000-C",
            "timestamp": 1711571460000,
            "exchangeTimestamp": 1711571461951,
            "exchangeTimestampNanoseconds": 0,
            "underlyingPrice": 69599.7133,
            "underlyingIndex": "SYN.BTC-12APR24",
            "stats": {
                "volume_usd": 376871.48,
                "volume": 88.7,
                "price_change": -16.9492,
                "low": 0.049,
                "high": 0.0669
            },
            "state": "open",
            "openInterest": 293.2,
            "minPrice": 0.017,
            "maxPrice": 0.1,
            "markPrice": 0.0477,
            "markIv": 69.04,
            "lastPrice": 0.049,
            "interestRate": 0,
            "indexPrice": 68922.78,
            "greeks": {
                "rho": 12.53638,
                "theta": -127.22042,
                "vega": 57.04281,
                "gamma": 0.00004,
                "delta": 0.47249
            },
            "estimatedDeliveryPrice": 68922.78,
            "bids": [
                [
                    0.0475,
                    4.7
                ],
                [
                    0.047,
                    53.7
                ],
                [
                    0.0465,
                    13.4
                ]
            ],
            "bidIv": 68.75,
            "bestBidPrice": 0.0475,
            "bestBidAmount": 4.7,
            "bestAskPrice": 0.0485,
            "bestAskAmount": 26.4,
            "asks": [
                [
                    0.0485,
                    26.4
                ],
                [
                    0.049,
                    38.8
                ],
                [
                    0.0495,
                    8
                ]
            ],
            "askIv": 69.97,
            "sequence": 68116518368,
            "metadata": {
                "settlementPrice": 0.05367167
            }
        }
    }
}
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.
stats.volume_usdnumber | null
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.amberdata.com/options', {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));
});