Trades

Real-time streaming tick data of publicly executed trades

Real-time tick data feed of all trades executed on SFOX’s supported liquidity sources

Subscription Instructions

Authentication required. Please refer to the WebSocket Authentication page here for more details.

Subscription FormatExample

trades.sfox.<basequote>

trades.sfox.btcusd

Payload Details

KeyDescription

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('message', function(data) {
    console.log(data);
});

ws.on('open', function() {
  const subscribeMsg = {
    type: 'subscribe',
    feeds: ['trades.sfox.btcusd']
  }
  ws.send(JSON.stringify(subscribeMsg));
});

Last updated