Agent IntegrationWebSocket Protocol

WebSocket Protocol

Connection

wss://api.conyr.ai/ws

No authentication required. Max 50 subscriptions per connection.

Message Format

All messages are JSON. Discriminated by the op field for control messages, or channel + data for events.

Client -> Server

Subscribe

{"op": "subscribe", "channels": ["token:<mint>:trades"]}

Unsubscribe

{"op": "unsubscribe", "channels": ["token:<mint>:trades"]}

Ping

{"op": "ping"}

Server -> Client

Subscription confirmed

{"op": "subscribed", "channels": ["token:<mint>:trades"]}

Unsubscription confirmed

{"op": "unsubscribed", "channels": ["token:<mint>:trades"]}

Pong

{"op": "pong"}

Error

{"op": "error", "message": "Subscription limit reached (max 50)"}

Data event

{"channel": "token:<mint>:trades", "data": { ... }}

Channel Naming

PatternDescription
token:<mint>:tradesLive trade tape
token:<mint>:ticksChart tick events
token:<mint>:ohlcv:<view>:<tf>OHLCV updates
wallet:<address>:pnlRealized PnL events
wallet:<address>:unrealized-pnlUnrealized PnL updates
wallet:<address>:positionsPosition changes

View values: full, filtered

Timeframe values: 1s, 1m, 5m, 15m, 1h

Connection Behavior

  • Server sends WebSocket ping every 30s
  • Slow consumers may drop messages
  • Subscriptions are lazily created and garbage collected
  • Invalid channel names return an error message, not a disconnect
  • Key validation: max 64 chars, alphanumeric and colons only