Subscribes/Unsubscribes to market options Liquidations data.
Once you're connected to this subscription: wss://ws.amberdata.com/options, your subscription message must include either a pair
/instrument
or an exchange
field. At least one must be specified — both cannot be empty.
Note:
- Instrument-level wildcards (e.g.,
"instrument": "ALL"
) are no longer supported.- Exchange-level wildcard subscriptions are only supported for Spot markets.
- For Futures and Options, you must subscribe using explicit instrument-level subscriptions. See here for more details.
Request
{
"jsonrpc" : "2.0",
"id" : 1,
"method" : "subscribe",
"params" : [ "market:options:liquidations", { "instrument": "ETH-30SEP22-9000-P", "exchange": "deribit" } ]
}
Param | Type | Description |
---|---|---|
instrument |
| The asset instrument. |
exchange |
| The exchange for which to retrieve asset instruments. |
period |
| 'minutely' |
Response
"result": {
"exchange": "deribit",
"instrument": "ETH-30SEP22-9000-P",
"timestamp": 1637916913907,
"originalQuantity": 2.0,
"price": 0.001,
"side": "BUY",
"status": null,
"type": null,
"timeInForce": null,
"action": null,
"orderId": "ETH-104154743"
}
Field | Type | Description |
---|---|---|
exchange |
| The exchange. |
timestamp |
| The time at which the liquidation took place. |
originalQuantity |
| The original quantity before the liquidation occurred. |
price |
| The price of the instrument at the time of the liquidation. |
side |
| The direction of the trade. |
status |
| The status of the liquidation. |
type |
| The type of liquidation. |
timeInForce |
| How long the order is to remain active before it is executed or expires, for example:
|
action |
| The type of action taken during the liquidation process (for example: delete, insert, update, etc). |
orderId |
| The order identifier. |
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:liquidations', {'instrument': 'ETH-30SEP22-9000-P', 'exchange': 'deribit'}],
id: 1,
}));
});
ws.on('message', data => {
console.log(JSON.stringify(JSON.parse(data), null, 2));
});