Subscribes/Unsubscribes to options open interest data for CME.
Make sure you're connected to this subscription: wss://ws.web3api.io/cme. You must specify the instrument symbol.
CME Authorization
You must have a valid license directly with CME to consume CME data via Amberdata's Websockets. Please connect with your Amberdata Account Executive if you have any questions.
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "subscribe",
"params": [
"market:options:open_interest:cme",
{
"symbol": "WMM3 C100000"
}
]
}
Param | Type | Description |
---|---|---|
symbol | string | The asset instrument. |
Response
{
"jsonrpc": "2.0",
"method": "subscription",
"params": {
"subscription": "bx30tx7s1o6wmykuae7kn3gn09b8jjysioy41l5302fp7fwfejwlh2r8fn90ctaq",
"result": {
"exchange": "CME",
"symbol": "WMM3 C100000",
"exchangeTimestamp": "1683077261645",
"exchangeTimestampNanoseconds": "489651",
"receivedTimestamp": "1683077263610",
"receivedTimestampNanoseconds": "844",
"sentTime": "null",
"tradeStatistics": {
"settlementPrice": "null",
"settlementPriceDate": "null",
"settlementPriceTimestamp": "null",
"settlementFinal": "null",
"settlementActual": "null",
"settlementRounded": "null",
"openInterest": "100",
"openInterestDate": "2023-05-02",
"openInterestTimestamp": "2023-05-03T01:27:41.645489651Z",
"clearedVolume": "null",
"clearedVolumeDate": "null",
"clearedVolumeTimestamp": "null"
},
"instrument": {
"definitionSource": "E",
"exchangeMic": "XCME",
"id": "235130",
"marketSegmentId": "74",
"periodCode": "202306",
"productCode": "WM",
"productGroup": "B1",
"productType": "OOF",
"symbol": "WMM3 C100000",
"putOrCall": "Call",
"strikePrice": "100000000000000",
"underlyingSymbol": "MBTM3"
}
}
}
}
Example
const WebSocket = require('ws');
const ws = new WebSocket('wss://ws.web3api.io/cme', {headers: {x-api-key:'<api_key>'}});
ws.on('open', () => {
ws.send(JSON.stringify({
jsonrpc: '2.0',
method: 'subscribe',
params : [ "market:options:open_interest:cme", { "symbol": "WMM3 C100000" } ],
id: 1,
}));
});
ws.on('message', data => {
console.log(JSON.stringify(JSON.parse(data), null, 2));
});