Trades

Real-time tick data feed of any trade executed on sFOX’s supported liquidity venues

Subscription Instructions

Subscription Format
Example

trades.sfox.<basequote>

trades.sfox.btcusd

Payload Details

Key
Description

buyOrderId

Order ID of the buy trade

sellOrderId

Order ID of the sell trade

pair

The currency pair of this trade

price

Price of this trade

quantity

Quantity traded

side

Side taken buy or sell

exchange

Location of the trade

exchange_id

ID of the trade location

timestamp

Time of the trade

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