Post-Trade Settlement

Real-time streaming account post-trade settlement credit and risk updates

WebSocket feed streaming real-time updates to your account's post-trade settlement credit and risk metrics. Initial snapshot will provide a list of all post trade settlement data and then any updates to the data list will be sent.

This WebSocket feed is only applicable if your account has post-trade settlement enabled

Subscription Instructions

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

Feed Name

private.user.post-trade-settlement

Payload Details

KeyDescription

enabled

Boolean whether post-trade settlement is enabled for your account

equity

Current USD value of your account balances

equity_for_withdrawals

Current USD value of the portion of equity that may be withdrawn from the platform

exposure

Current USD value of the amount borrowed (USD value of negative balances)

Example Code & Post-Trade Settlement Message

const WebSocket = require('ws')

const ws = new WebSocket('wss://ws.sfox.com/ws')

ws.on('open', function() {
  const authMessage = {
   type: 'authenticate',
   apiKey: '<API_KEY>',
  }
  
  ws.send(JSON.stringify(authMessage))
})

// After successful authentication, subscribe to balances feed
const subscribeMsg = {
  type: 'subscribe',
  feeds: ['private.user.post-trade-settlement']
}

ws.send(JSON.stringify(subscribeMsg))

Last updated