This WebSocket channel provides you a updates related to your trading activity. Please see our WebSocket guide for information on Authentication with WebSockets and common messages.
This channel contains sequenced messages, which are messages that contain a sequence
field indicating the order for the message. This is a monotonic sequence number you can use to detect gaps and validate ordering of messages. After you subscribe to this channel, you will get a replay of all sequenced messages from the beginning of the day.
Messages that do not contain a sequence
field are not sequenced and therefore are not replayed.
Subscribe Activity
You send the following message when you want to subscribe to this channel for a particular account.
{
"authorization": "<access-token>",
"payload": {
"type": "subscribe-activity",
"account_id": "<account-id>"
}
}
Field | Type | Required | Description |
---|---|---|---|
authorization | string | Yes | Your access token. |
payload.type | string | Yes | Always subscribe-activity . |
payload.account_id | string | Yes | Account you want to subscribe to. |
Subscribe Activity Ack
You receive this message to indicate success or failure of the subscription request you sent. Note, if your request is malformed or otherwise not parsable, you'll instead get an Error Notice.
{
"timestamp": 1711076847030,
"payload": {
"type": "subscribe-activity-ack",
"account_id": "<account-id>",
"success": true,
"details": "Subscribed successfully"
}
}
Field | Type | Required | Description |
---|---|---|---|
timestamp | number | Yes | Milliseconds since epoch timestamp of when the server sent the message. |
payload.type | string | Yes | Always subscribe-activity-ack . |
payload.account_id | string | Yes | The account you sent in your request echoed back. |
payload.success | boolean | Yes | True if successful, false otherwise. |
payload.details | string | Yes | Additional details. |
Replay Complete
You receive this message after all sequenced messages have been replayed. Sequenced messages are automatically replayed after your subscribe to this channel. This message lets you know that the replay is complete.
{
"timestamp": 1711076847030,
"payload": {
"type": "replay-complete"
}
}
Field | Type | Required | Description |
---|---|---|---|
timestamp | number | Yes | Milliseconds since epoch timestamp of when the server sent the message. |
payload.type | string | Yes | Always replay-complete . |
Order Update
You receive this message anytime an order changes state.
{
"timestamp": 1711076847030,
"sequence": 123,
"payload": {
"type": "order-update",
"data": {...}
}
}
Field | Type | Required | Description |
---|---|---|---|
timestamp | number | Yes | Milliseconds since epoch timestamp of when the server sent the message. |
sequence | number | Yes | Monotonic sequence number. |
payload.type | string | Yes | Always order-update . |
payload.data | object | Yes | Order object in the same shape as the response to Get Order. |
Trade Notice
You receive this message anytime an open order is executed against.
{
"timestamp": 1711076847030,
"sequence": 124,
"payload": {
"type": "trade-notice",
"data": {...}
}
}
Field | Type | Required | Description |
---|---|---|---|
timestamp | number | Yes | Milliseconds since epoch timestamp of when the server sent the message. |
sequence | number | Yes | Monotonic sequence number. |
payload.type | string | Yes | Always trade-notice . |
payload.data | object | Yes | Trade object in the same shape as the response to Get trade. |
Position Update
You receive this message anytime your position in a symbol changes.
{
"timestamp": 1711076847030,
"sequence": 124,
"payload": {
"type": "position-update",
"data": {...}
}
}
Field | Type | Required | Description |
---|---|---|---|
timestamp | number | Yes | Milliseconds since epoch timestamp of when the server sent the message. |
sequence | number | Yes | Monotonic sequence number. |
payload.type | string | Yes | Always position-update . |
payload.data | object | Yes | Position object in the same shape as the response to Get position |
Buying Power
You receive this message when your buying power changes, if applicable.
{
"timestamp": 1711076847030,
"sequence": 124,
"payload": {
"type": "buying-power-update",
"data": {...}
}
}
Field | Type | Required | Description |
---|---|---|---|
timestamp | number | Yes | Milliseconds since epoch timestamp of when the server sent the message. |
sequence | number | Yes | Monotonic sequence number. |
payload.type | string | Yes | Always buying-power-update . |
payload.data | object | Yes | Buying power update details. |
Locate Inventory
You receive this message when your locate inventory changes, if applicable.
{
"timestamp": 1711076847030,
"sequence": 124,
"payload": {
"type": "locate-inventory-update",
"data": {...}
}
}
Field | Type | Required | Description |
---|---|---|---|
timestamp | number | Yes | Milliseconds since epoch timestamp of when the server sent the message. |
sequence | number | Yes | Monotonic sequence number. |
payload.type | string | Yes | Always locate-inventory-update . |
payload.data | object | Yes | Locate inventory update details. |