For AI agents: the documentation index is at /llms.txt, and this page is available as Markdown at /api/websocket/market-data/subscribe.md.
Subscribe
Send
Server
Message sent to server indicating which topics the client wants to subscribe to or unsubscribe from.
const payload = { "type": "subscribe", "topics": [ "all" ]};const socket = new WebSocket("wss://api.truemarkets.co/v1/defi/market");socket.addEventListener("open", () => { socket.send(JSON.stringify(payload));});- payload
type*stringAction the request is intending to take.
Value in
"subscribe""unsubscribe"topics*array<>Topics to subscribe to or unsubscribe from, e.g. ["price_candles"], ["price_candles","surging_assets"], or ["all"].
Example
{ "type": "subscribe", "topics": [ "all" ]}