Skip to main content

Position updates

Live snapshots of a customer's open positions. Requires authentication.

Subscribe​

{"op": "subscribe", "args": ["positions:c1d2e3f4-a5b6-7890-cdef-123456789abc"]}

Topic format: positions:{customer_code}, e.g. positions:c1d2e3f4-a5b6-7890-cdef-123456789abc.

Snapshot Message​

The server refreshes the customer's open positions every ~5 seconds while the subscription is active and pushes the full list. The data matches the REST GET /customers/{code}/positions endpoint, so clients can replace their polling loop with this channel and keep the same parser.

{
"channel": "positions",
"type": "snapshot",
"customer_code": "c1d2e3f4-a5b6-7890-cdef-123456789abc",
"positions": [
{
"code": "b1c2d3e4-f5a6-7890-bcde-f12345678901",
"symbol": "BTCUSDC_PERP",
"side": "long",
"amount": "0.000594",
"entry_price": "84114.83",
"mark_price": "83588.71",
"unrealised_pnl": "-0.3125152800",
"created": "2025-06-15T07:30:00Z",
"updated": "2025-06-15T07:30:00Z"
}
],
"timestamp": "2025-06-15T07:30:00.123Z"
}
FieldDescription
customer_codeCustomer identifier
positionsAll currently open positions for the customer (empty array when there are none)
positions[].codePosition identifier. Derived from the instrument, so it is stable while the position is open, and a position closed and later reopened on the same instrument reappears under the same code
positions[].symbolInstrument symbol
positions[].sidelong or short
positions[].amountPosition size in contracts
positions[].entry_priceAverage entry price
positions[].mark_priceCurrent mark price
positions[].unrealised_pnlUnrealised profit/loss in settlement currency
positions[].createdPosition opened timestamp
positions[].updatedLast update timestamp
timestampVenue as-of time of the account state; identical to the timestamp of the margin update from the same poll

Notes:

  • Snapshots are pushed at ~5 second intervals while the subscription is active.
  • Each snapshot is a full replacement — a position that was in the previous snapshot and is missing from the current one has been closed. Because code is per instrument, a code that disappears and comes back is a close followed by a new position, not one that was open the whole time.
  • Items match the REST Position schema field-for-field.
  • If the venue keeps rejecting the lookup for a customer (for example an unknown customer code), the server backs off to roughly one attempt every 30 seconds for that customer until a poll succeeds. The subscription stays active; no message is pushed in the meantime.