Skip to content

WebSocket reference

The narrative guides live under Real-time. This page is the flat index — every frame, in one place. The authoritative schema for each payload is the AsyncAPI document.

Environment URL
Production wss://api.troncharts.xyz

Channel: /ws/risk. Frames are JSON text in both directions. Market data is not served here; see Market data.

Frame Tier Purpose
Authenticate readonly First message on the socket.
Ping readonly Heartbeat. Server replies Pong.
Alive readonly Legacy heartbeat, no reply.
Resume readonly Replay buffered frames after lastSeq.
Subscribe / Unsubscribe readonly Add or drop topics; Subscribe optionally re-scopes to an owned accountId.
Get-Margin readonly Margin snapshot.
Get-Balance readonly Balance snapshot.
Get-Risk-Update readonly Not implemented: answers Result { ok: false, error: "not_implemented" }. Use Get-Margin and Get-Balance.
Get-Position-Update readonly Position snapshot.
Get-open-orders readonly Working-order snapshot.
Request-Trade-History readonly Not implemented: answers Result { ok: false, error: "not_implemented" }.
Order-Sign-Result liquidation Live accounts only; in development. See Paper-only mode.
Cancel-Order-Intent liquidation Cancel a working order.
Replace-Order-Intent liquidation Re-price or re-size a working order.
Bracket-Insert liquidation Not implemented: answers Result { ok: false, error: "not_implemented" }. Use POST /api/v1/oms/brackets/attach.
Bracket-Modify liquidation Not implemented: answers Result { ok: false, error: "not_implemented" }. Bracket legs are managed over REST.
Bracket-Cancel liquidation Not implemented: answers Result { ok: false, error: "not_implemented" }. Bracket legs are managed over REST.
Position-Close liquidation Live accounts only; in development. On paper it answers Result { ok: false, error: "not_implemented" }: use POST /api/v1/oms/flatten.

The tier column is the minimum; a higher tier always passes. The socket only distinguishes readonly from the rest — every write frame above is open to liquidation and fullTrading alike, and readonly is rejected with Result { ok: false, error: "tier_readonly" }. The REST /api/v1/oms/* surface draws a finer line; see tiers.

Subscribe requires a non-empty topics array. The socket receives no push frames until it subscribes — see topics for the full list and the frames each one unlocks.

Frame Carries
Authenticated Handshake success. Unsequenced.
Result Per-frame outcome, including rejections.
Pong Heartbeat reply. Unsequenced.
Account-State-Update Aggregate account state.
Balance-Update Balance.
Margin-Update Margin.
Funding-Update Funding and fee rows.
Risk-Update Risk metrics.
Blocking-Update Trading blocks on the account.
Position-Update One position changed.
Position-Removed A position closed.
Position-Snapshot Full position set — seeds your view.
Open-Orders-Update Working-order book.
Order-Intent An intent was accepted.
Order-Intent-Update Lifecycle progress, venue ids, fills, terminal state.
Order-Update Order state in the external vocabulary.
Trade-Update A round trip closed.
Fill One execution. Never coalesced.
Trade-History-Result Reserved for Request-Trade-History, which is not implemented: the server does not send it.
Account-Event Account lifecycle event.
Prop-Account-Update Challenge progress and status.
Prop-Account-Status-Changed A prop account changed state.
Companion-Event Derived risk / position note.
IP-Update Session IP changed.
LoggedOff The session ended server-side. Carries reason and a ts.
Resync-Required Drop local state and re-snapshot.

Note LoggedOff has no hyphen on the wire. There is no Bracket-Info push: bracket-leg state arrives on Open-Orders-Update and Order-Intent-Update like any other working order.

Every frame that leaves the outbox carries a monotonic seq; Pong and Authenticated do not. See sequence numbers.

Not a socket, but documented alongside the frames because it answers the same need. See Webhooks for the envelope, headers, retry schedule, signature verification, and the six subscribable event categories.