Skip to main content

Private Data

All private data updates are realtime. Multiple topics and multiple accounts can be subscribed to within a single connection.

A default subscribed trading account can be pre-specified by using this endpoint.

/trading-api/v1/private-data?tradingAccountId={id}

Otherwise controlled by parameters in the subscription message listed below

/trading-api/v1/private-data

Please note that authentication is mandatory

Operations

SEND/trading-api/v1/private-data

Subscribe

Multiple subscriptions could be opened within the same websocket.

The topics & accounts to be subscribed are controlled by the parameters in the subscription message listed below.

After subscribing, the server sends :

  • an acknowledgement
  • then an initial snapshot
  • followed by incremental updates.
Operation IDsubscribe

Accepts the following message:

Subscription

Let you subscribe to a given topic

  • application/json
Message IDsubscribe
object

Examples

RECEIVE/trading-api/v1/private-data

In case of invalid subscription message, an error rejection would be sent.

This also includes trading account access rejections

Operation IDsubscribe-nack

Sends the following message:

Rejection

Explain why the topic could not be subscribed

  • application/json
Message IDsubscribe-nack
object

Examples

SEND/trading-api/v1/private-data

Keepalive

In case nothing is subscribed to, keep the websocket connection alive.

Operation IDkeepalive-ping

Accepts the following message:

Keepalive Ping
  • application/json
Message IDkeepalive-ping
object

Examples

RECEIVE/trading-api/v1/private-data

Acknowledgement returned by the server in response to a keepalive-ping.

Operation IDkeepalive-pong

Sends the following message:

Keepalive Pong
  • application/json
Message IDkeepalive-pong
object

Examples

SEND/trading-api/v1/private-data

Unsubscribe

Let you unsubscribe a specific topic while keeping your websocket opened.

Operation IDunsubscribe

Accepts the following message:

Unsubscription

Let you unsubscribe from an opened subscription

  • application/json
Message IDunsubscribe
object

Examples

RECEIVE/trading-api/v1/private-data

After unsubscribing, the server sends an acknowledgement.

Operation IDunsubscribe-ack

Sends the following message:

Acknowledgment

Confirm the subscription was closed

  • application/json
Message IDunsubscribe-ack
object

Examples

RECEIVE/trading-api/v1/private-data

In case of invalid unsubscription message, an error rejection would be sent.

Operation IDunsubscribe-nack

Sends the following message:

Rejection

Explain why the topic could not be unsubscribed

  • application/json
Message IDunsubscribe-nack
object

Examples

RECEIVE/trading-api/v1/private-data

Receive Orders

Operation IDreceive-orders

Sends one of the following messages:

  • #1Acknowledgment

    Confirm the subscription was opened

    • application/json
    Message IDsubscribe-ack
    object

    Examples

  • #2Snapshot

    Initial full state of the subscribed order data

    • application/json
    Message IDsubscribe-msg-0-orders
    object

    Examples

  • #3Update

    Incremental update to the subscribed order data

    • application/json
    Message IDsubscribe-msg-1-orders
    object

    Examples

RECEIVE/trading-api/v1/private-data

Receive Trades

Operation IDreceive-trades

Sends one of the following messages:

  • #1Acknowledgment

    Confirm the subscription was opened

    • application/json
    Message IDsubscribe-ack
    object

    Examples

  • #2Snapshot

    Initial full state of the subscribed trade data

    • application/json
    Message IDsubscribe-msg-0-trades
    object

    Examples

  • #3Update

    Incremental update to the subscribed trade data

    • application/json
    Message IDsubscribe-msg-1-trades
    object

    Examples

RECEIVE/trading-api/v1/private-dataDeprecated

Receive Spot Accounts

Operation IDreceive-spotAccounts

Sends one of the following messages:

  • #1Acknowledgment

    Confirm the subscription was opened

    • application/json
    Message IDsubscribe-ack
    object

    Examples

  • #2Snapshot

    Initial full state of the subscribed spot accounts data

    • application/json
    Message IDsubscribe-msg-0-spotAccounts
    object

    Examples

  • #3Update

    Incremental update to the subscribed spot accounts data

    • application/json
    Message IDsubscribe-msg-1-spotAccounts
    object

    Examples

RECEIVE/trading-api/v1/private-data

Receive Asset Accounts

V1TAAssetAccount provides a more granular view of the assets in your trading account compared to V1TASpotAccount.

Operation IDreceive-assetAccounts

Sends one of the following messages:

  • #1Acknowledgment

    Confirm the subscription was opened

    • application/json
    Message IDsubscribe-ack
    object

    Examples

  • #2Snapshot

    Initial full state of the subscribed asset accounts data

    • application/json
    Message IDsubscribe-msg-0-assetAccounts
    object

    Examples

  • #3Update

    Incremental update to the subscribed asset accounts data

    • application/json
    Message IDsubscribe-msg-1-assetAccounts
    object

    Examples

RECEIVE/trading-api/v1/private-data

Receive Trading Accounts

  • Provides a summary of the total borrowed and total collateral values on the specific trading account id. totalBorrowedQuantity and totalCollateralQuantity do not represent the absolute quantity of the borrowed assets and are notional values represented in the reference asset.
  • Snapshot contains a list with a single entry corresponding to the trading account id specified in the tradingAccountId query parameter when opening the WebSocket connection.
Operation IDreceive-tradingAccounts

Sends one of the following messages:

  • #1Acknowledgment

    Confirm the subscription was opened

    • application/json
    Message IDsubscribe-ack
    object

    Examples

  • #2Snapshot

    Initial full state of the subscribed trading accounts data

    • application/json
    Message IDsubscribe-msg-0-tradingAccounts
    object

    Examples

  • #3Update

    Incremental update to the subscribed trading accounts data

    • application/json
    Message IDsubscribe-msg-1-tradingAccounts
    object

    Examples

RECEIVE/trading-api/v1/private-dataDeprecated

Receive Derivatives Positions

Topic derivativesPosition is being replaced by derivativesPositionV2.

  • Provide a detail view of the derivative position of each market.
Operation IDreceive-derivativesPositions

Sends one of the following messages:

  • #1Acknowledgment

    Confirm the subscription was opened

    • application/json
    Message IDsubscribe-ack
    object

    Examples

  • #2Snapshot

    Initial full state of the subscribed derivatives positions data

    • application/json
    Message IDsubscribe-msg-0-derivativesPositions
    object

    Examples

  • #3Update

    Incremental update to the subscribed derivatives positions data

    • application/json
    Message IDsubscribe-msg-1-derivativesPositions
    object

    Examples

RECEIVE/trading-api/v1/private-data

Receive Derivatives Positions (V2)

Provide a detail view of the derivative position of each market.

Operation IDreceive-derivativesPositionsV2

Sends one of the following messages:

  • #1Acknowledgment

    Confirm the subscription was opened

    • application/json
    Message IDsubscribe-ack
    object

    Examples

  • #2Snapshot

    Initial full state of the subscribed derivatives positions (V2) data

    • application/json
    Message IDsubscribe-msg-0-derivativesPositionsV2
    object

    Examples

  • #3Update

    Incremental update to the subscribed derivatives positions (V2) data

    • application/json
    Message IDsubscribe-msg-1-derivativesPositionsV2
    object

    Examples

RECEIVE/trading-api/v1/private-data

Receive AMM Instructions

  • Provides updates of the active AMM instructions on the specific trading account id.
  • This topic does not provide snapshot
Operation IDreceive-ammInstructions

Sends one of the following messages:

  • #1Acknowledgment

    Confirm the subscription was opened

    • application/json
    Message IDsubscribe-ack
    object

    Examples

  • #2Update

    Incremental update to the subscribed AMM instructions data

    • application/json
    Message IDsubscribe-msg-1-ammInstructions
    object

    Examples

RECEIVE/trading-api/v1/private-data

Receive MMP Triggers

Operation IDreceive-mmpTrigger

Sends one of the following messages:

  • #1Acknowledgment

    Confirm the subscription was opened

    • application/json
    Message IDsubscribe-ack
    object

    Examples

  • #2Snapshot

    Initial full state of the subscribed MMP trigger data

    • application/json
    Message IDsubscribe-msg-0-mmpTrigger
    object

    Examples

  • #3Update

    Incremental update to the subscribed MMP trigger data

    • application/json
    Message IDsubscribe-msg-1-mmpTrigger
    object

    Examples

RECEIVE/trading-api/v1/private-data

Receive MMP Requests

Operation IDreceive-mmpRequest

Sends one of the following messages:

  • #1Acknowledgment

    Confirm the subscription was opened

    • application/json
    Message IDsubscribe-ack
    object

    Examples

  • #2Snapshot

    Initial full state of the subscribed trade data

    • application/json
    Message IDsubscribe-msg-0-mmpRequest
    object

    Examples

  • #3Update

    Incremental update to the subscribed order data

    • application/json
    Message IDsubscribe-msg-1-mmpRequest
    object

    Examples