Skip to content

Comments Channel

This WebSocket connection pushes new comments in real time as participants discuss Openfish events and markets. Unlike the CLOB-hosted channels, the comments endpoint runs on the gamma server. No authentication is needed to connect.

wss://gamma.openfish.fun/ws/comments

Once connected, send a JSON message indicating which entity you want to follow:

{
"channel": "comments",
"entity_type": "market",
"entity_id": "abc123"
}
FieldTypeDescription
channelstringMust be "comments"
entity_typestringEntity type to subscribe to ("market" or "event")
entity_idstringThe ID of the market or event

The server confirms with:

{
"type": "subscribed",
"entityType": "market",
"entityId": "abc123"
}

To switch to a different entity, send another subscription message. The server replaces your current subscription rather than adding to it:

{
"channel": "comments",
"entity_type": "event",
"entity_id": "125819"
}

Each time someone posts a comment on the entity you are following, the server delivers the full comment payload:

{
"type": "comment",
"body": "I think YES is underpriced here.",
"author": "0xce533188d53a16ed580fd5121dedf166d3482677",
"entity_type": "market",
"entity_id": "abc123",
"parent_comment_id": null,
"timestamp": 1700000000
}
FieldTypeDescription
typestringAlways "comment" for new comment events
bodystringThe text content of the comment
authorstringWallet address of the comment author
entity_typestringEntity the comment belongs to ("market" or "event")
entity_idstringID of the entity
parent_comment_idstring/nullID of the parent comment for replies, null for top-level
timestampnumberUnix timestamp in seconds

Replies are linked to their parents through the parent_comment_id field:

  • Top-level comments have parent_comment_id set to null.
  • Reply comments reference the parent via parent_comment_id.

All comments within a subscription belong to the same entity_type and entity_id.

The server sends WebSocket PING frames every 10 seconds. Respond with PONG to keep the connection alive.

use openfish_client_sdk::ws::CommentSocket;
use futures_util::StreamExt;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let mut ws = CommentSocket::connect("wss://gamma.openfish.fun/ws/comments").await?;
// Subscribe to comments on a specific market
ws.subscribe("market", "abc123").await?;
while let Some(comment) = ws.next().await {
if let Some(parent_id) = &comment.parent_comment_id {
println!(" Reply to {}: {}", parent_id, comment.body);
} else {
println!("New comment by {}: {}", comment.author, comment.body);
}
}
Ok(())
}

You can bootstrap a complete comment view by loading historical data through REST, then switching over to the WebSocket for anything posted after that point:

use openfish_client_sdk::{GammaClient, ws::CommentSocket};
use futures_util::StreamExt;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let gamma = GammaClient::new("https://gamma.openfish.fun");
let market_id = "abc123";
// Load existing comments via REST
let existing = gamma.comments(market_id).await?;
for c in &existing {
println!("[history] {}: {}", c.author, c.body);
}
// Stream new comments via WebSocket
let mut ws = CommentSocket::connect("wss://gamma.openfish.fun/ws/comments").await?;
ws.subscribe("market", market_id).await?;
while let Some(comment) = ws.next().await {
println!("[live] {}: {}", comment.author, comment.body);
}
Ok(())
}
AspectCLOB Channels (market, user, rtds, sports)Comments Channel
ServerCLOB server (port 3002)Gamma server
Base URLwss://api.openfish.fun/ws/...wss://gamma.openfish.fun/ws/comments
Auth requiredVaries (user channel requires it)No
Data typeTrading and price dataUser-generated comments