Trades
Real-time tick data feed of any trade executed on sFOX’s supported liquidity venues
Subscription Instructions
Subscription Format
Example
Payload Details
Key
Description
Example Code & Trades Message
const WebSocket = require('ws')
const ws = new WebSocket('wss://ws.sfox.com/ws')
ws.on('open', function() {
const authMessage = {
type: 'authenticate',
apiKey: '<ENTERPRISE_API_KEY>',
enterprise: 'true'
}
ws.send(JSON.stringify(authMessage))
})
// After successful authentication, subscribe to trades feed
const subscribeMsg = {
type: 'subscribe',
feeds: ['trades.sfox.btcusd', 'trades.sfox.ethusd']
}
ws.send(JSON.stringify(subscribeMsg))Last updated