Skip to main content
The /chat namespace is the per-user real-time channel. On connect it auto-joins you to every group you belong to plus a private user:{userId} room, so you receive messages and notifications without subscribing per group.

Server → client events

proposal_updated.metadata is where trade economics live (e.g. initialPrice on create, exitPnlUsd / exitPnlPct on close, didWin / result on resolve). These money fields follow the API’s decimal-string contract.

Client → server events

You can drive chat over the socket, though for bots the REST chat endpoints are often simpler. Available messages: send_message, share_asset, add_reaction, remove_reaction, delete_message, pin_message, unpin_message, get_pinned_messages, join_group, leave_group, focus_chat, blur_chat.

Sending: socket vs REST

Over the socket

socket.emit("send_message", { groupId, type: "TEXT", content: "gm" }) — lowest latency if you’re already connected.

Over REST

POST /api/v1/chat/{groupId}/messages with { "type": "TEXT", "content": "gm" } — stateless, same persistence and broadcast. Good for fire-and-forget bots.
Both run the identical send path (permission check, moderation, persistence, broadcast), so a message sent via REST still arrives as a new_message to everyone on the socket. Membership is enforced — you can only read and post in groups you belong to.

REST chat endpoints

If your bot prefers plain HTTP over the socket, the full chat surface is four endpoints, all members-only:
A common bot pattern: connect to /chat to receive new_message and proposal_updated, and use the REST endpoints to send and to page history (GET /api/v1/chat/{groupId}/messages).