sFOX API
Sign InOpen Account
sFOX API
sFOX API
  • Introduction
    • Welcome
    • Getting Started
    • Systems & Operations
    • Rate Limits
  • REST API
    • REST Endpoints
    • Authentication
    • Rate Limits
    • Account Management
      • Get All Balances
      • Get All Currencies
      • Get All Currency Pairs
      • Get All Transactions
      • Get Fees
    • Orders
      • Order Types
      • Create Order
      • Cancel Order
      • Cancel Multiple Orders
      • Cancel All Orders
      • Amend Order
      • Get Single Order
      • Get All Open Orders
      • Get All Done Orders
      • Get All Trades
    • Request for Quote (RFQ)
    • Post-Trade Settlement (PTS)
      • Get Account Risk Metrics
      • Get All Positions
      • Get All Funding Transactions
      • Get All Funding Rates
      • Get All Risk Modes
      • Create Transfer
    • Shorting
      • Get Account Risk Metrics
      • Get All Positions
    • Transfers
      • Get All Deposit Addresses
      • Get Single Deposit Address
      • Create Deposit Address
      • Deposit From Bank Account
      • Withdraw From Account
      • Get Single Withdrawal Fee
      • Create Transfer
    • Custody (sFOX SAFE)
      • Get Whitelisted Addresses
      • Add Whitelisted Address
      • Delete Whitelisted Address
      • Get Approval Rules
      • Create Approval Rule
      • Edit Approval Rule
      • Get Approval Requests
      • Respond to Approval Request
    • Staking
      • Get Staking Currencies
      • Get All Staking Transactions
      • Create Stake
      • Cancel Stake
      • Unstake
    • Market Data
      • Get Candlesticks
      • Get Volume Analytics
      • Get Order Estimate
      • Get Order Book
    • Reporting
      • Get Orders Report
      • Get Monthly Summary
      • Get Portfolio Valuation
      • Get All Transactions
  • WebSocket API
    • Introduction
    • Connecting
    • Rate Limits
    • Authentication
    • Subscribing & Unsubscribing
    • Message Format
    • Market Data
      • Order Book
      • Trades
      • Ticker
    • Orders & Account Data
      • Orders
      • Trades
      • Balances
      • Post-Trade Settlement
  • FIX API
    • FIX Order Entry
    • FIX Market Data
    • QuickFIX Guide
  • Errors
    • Error Codes
Powered by GitBook
On this page
  1. WebSocket API

Message Format

WebSocket API message format

Messages received from the WebSocket API will be JSON objects with the following similar format:

Property
Type
Description

sequence

int

The sequence number that the message was sent in

recipient

string

The corresponding WebSocket feed that the message was sent to

timestamp

int

The UNIX timestamp (in nanoseconds)

payload

JSON

The payload parameter will be a JSON string that contains then data

Please note that the sequence number sent by the WebSocket is not guaranteed to be in ascending order. If you detect any gaps or incorrect ordering you should reconnect.

Example Message

{
  "sequence": 10,
  "recipient": "private.user.balances",
  "timestamp": 1649899310281716289,
  "payload": [{
    "currency": "aave",
    "balance": "0.17572419",
    "available": "0.17572419",
    "held": "0",
    "wallet_display_id": "5a3f1b1c-719d-11e9-b0be-0ea0e44d1000"
  }, {
    "currency": "ada",
    "balance": "42.32365721",
    "available": "42.32365721",
    "held": "0",
    "wallet_display_id": "5a3f1b1c-719d-11e9-b0be-0ea0e44d1000"
  }, {
    "currency": "atom",
    "balance": "0.40485184",
    "available": "0.40485184",
    "held": "0",
    "wallet_display_id": "5a3f1b1c-719d-11e9-b0be-0ea0e44d1000"
  }, {
    "currency": "avax",
    "balance": "0",
    "available": "0",
    "held": "0",
    "wallet_display_id": "5a3f1b1c-719d-11e9-b0be-0ea0e44d1000"
  }]
}
PreviousSubscribing & UnsubscribingNextMarket Data

Last updated 7 months ago