Messages
{
"type": "join",
"room": "pm:all"
}{
"type": "leave",
"room": "pm:all"
}{
"type": "message",
"room": "pm:all",
"data": {
"type": "trade",
"channel": "trades",
"exchange": "polymarket",
"marketId": "1234567890",
"timestamp": 1785347120123
}
}Prediction Markets — Trades
预测市场全部事件 WebSocket 流
通过 Datastream WebSocket 接收 Kalshi 和 Polymarket 除市场状态外的所有事件:交易、加密货币价格、生命周期和结算更新。
WSS
/
所有非市场状态的实时事件(交易、
crypto_price、生命周期和结算)。不包含高频的价格、报价、订单簿和成交量更新。
SDK Example
import { Datastream } from '@solana-tracker/data-api';
const dataStream = new Datastream({
wsUrl: 'wss://datastream.solanatracker.io/YOUR_API_KEY',
});
dataStream.on('error', console.error);
await dataStream.connect();
const sub = dataStream.subscribe.pm.all().on((data) => {
console.log(data);
});
// sub.unsubscribe();
Messages
{
"type": "join",
"room": "pm:all"
}{
"type": "leave",
"room": "pm:all"
}{
"type": "message",
"room": "pm:all",
"data": {
"type": "trade",
"channel": "trades",
"exchange": "polymarket",
"marketId": "1234567890",
"timestamp": 1785347120123
}
}apiKey
type:httpApiKey
API key for authentication. Include your Datastream key in the connection URL: wss://datastream.solanatracker.io/{DATASTREAM_KEY}
joinAllEvents
type:object
Subscribe to all prediction-market events
leaveAllEvents
type:object
Unsubscribe from All Events
allEventsMessage
type:object
All Events update
此页面对您有帮助吗?