Order Book

Real-time streaming order book data

Real-time order books for a specified currency pair.

Subscription Instructions

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

Subscription FormatExample

orderbook.<order_book_type>.<basequote>

orderbook.net.ethbtc

Order Book Types

sFOX provides the following order book variations

Order BookDescriptionExample

net

Fee-adjusted order book prioritizing the best net prices

orderbook.net.ethbtc

sfox

Unadjusted order book prioritizing the best raw prices

orderbook.sfox.btcusd

Payload Details

KeyDescription

bids

An array of the bids available in this order book. Each bid is a price, quantity, and liquidity source

asks

An array of the asks available in this order book. Each ask is a price, quantity, and liquidity source

market making

The best bids and offers of the available destinations for maker orders placed on this pair

pair

The currency pair of this order book

lastupdated

The UNIX timestamp this order book was last updated

lastpublished

The UNIX timestamp this order book was last published

Subscriptions to the order book will receive full order book snapshots for the pair. sFOX does not support sending changes at this time.

Example Code & Order Book 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: ['orderbook.sfox.ethbtc']
  }
  ws.send(JSON.stringify(subscribeMsg));
});

Last updated