Last active
April 21, 2025 15:10
-
-
Save Fyzu/01e79a54a17f69e1e1e35c99ef0d165a to your computer and use it in GitHub Desktop.
dxLink Depth Of Market Service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "CHANNEL_REQUEST", | |
"channel": 5, | |
"service": "DOM", | |
"parameters": { | |
"symbol": "AAPL", | |
"sources": ["NTV"] | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "CHANNEL_OPENED", | |
"channel": 5, | |
"service": "DOM", | |
"parameters": { | |
"symbol": "AAPL", | |
"sources": ["NTV"] | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "DOM_SETUP", | |
"channel": 5, | |
"acceptDepthLimit": 100, | |
"acceptAggregationPeriod": 1.0, | |
"acceptDataFormat": "FULL", | |
"acceptIndividualOrders": true, | |
"acceptLevelFields": ["price", "size", "count"], | |
"acceptOrderFields": ["price", "size", "time"], | |
"acceptOrderSizeFilter": 1, | |
"acceptLevelSizeFilter": 1, | |
"acceptLevelCountFilter": 1 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "DOM_CONFIG", | |
"channel": 5, | |
"depthLimit": 5, | |
"aggregationPeriod": 1.0, | |
"dataFormat": "FULL", | |
"individualOrders": true, | |
"levelFields": ["price", "size", "count"], | |
"orderFields": ["price", "size", "time"], | |
"orderSizeFilter": 1, | |
"levelSizeFilter": 1, | |
"levelCountFilter": 1 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "DOM_SNAPSHOT", | |
"channel": 5, | |
"time": 1706025203484, | |
"bids": [{ | |
"price": 136.2, | |
"size": 10, | |
"count": 5, | |
"orders": [{ | |
"price": 136.2, | |
"size": 4, | |
"time": 1706025203484 | |
}] | |
}], | |
"asks": [{ | |
"price": 136.2, | |
"size": 10, | |
"count": 5, | |
"orders": [{ | |
"price": 136.2, | |
"size": 4, | |
"time": 1706025203484 | |
}] | |
}] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const client = new DXLinkWebSocketClient() | |
client.connect('wss://demo.dxfeed.com/dxlink-ws-dom') | |
const dom = new DXLinkDepthOfMarket(client, { | |
symbol: 'AAPL', | |
source: 'NTV' | |
}) | |
dom.configure({ | |
acceptDepthLimit: 10, | |
acceptAggregationPeriod: 2, | |
// TODO | |
}) | |
dom.addSnapshotListener((time, bids, asks) => { | |
// do some work | |
console.log('Market Depth', time, bids, asks) | |
}) | |
const config = dom.getConfig() | |
onClose(() => { | |
dom.close() | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment