The Datastream WebSocket lets you subscribe to live holder data for any token. Two rooms cover the key signals: total holder count changes and top-10 wallet concentration shifts. These signals help you spot risky holder patterns early.
URL: wss://datastream.solanatracker.io/{apiKey}
Available on Premium, Business, and Enterprise plans.
Live Holder Count
Subscribe to holders:{tokenAddress} to receive a message every time the total number of unique holders changes.
Use cases: track holder momentum, alert when holders drop sharply, and display a live holder count badge.
const token = "6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN";
const ws = new WebSocket("wss://datastream.solanatracker.io/YOUR_API_KEY");
ws.onopen = () => {
ws.send(JSON.stringify({ type: "join", room: `holders:${token}` }));
};
ws.onmessage = (event) => {
const msg = JSON.parse(event.data);
if (msg.type !== "message") return;
console.log(`Holders: ${msg.data.total}`);
};
Payload:
{
"type": "message",
"room": "holders:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN",
"data": {
"total": 14823
}
}
Top 10 Holder Concentration
Subscribe to top10:{tokenAddress} to receive updates when any of the top 10 wallets changes their position. This can warn you about whale exits or creator-wallet sell-offs.
Use cases: alert when top-10 concentration spikes above a threshold, track individual whale wallet movements, and monitor creator-wallet sell-offs in real time.
const token = "6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN";
const ws = new WebSocket("wss://datastream.solanatracker.io/YOUR_API_KEY");
ws.onopen = () => {
ws.send(JSON.stringify({ type: "join", room: `top10:${token}` }));
};
ws.onmessage = (event) => {
const msg = JSON.parse(event.data);
if (msg.type !== "message") return;
const { holders } = msg.data;
const totalConcentration = holders.reduce((sum, h) => sum + h.percentage, 0);
console.log(`Top 10 hold ${totalConcentration.toFixed(1)}% of supply`);
holders.forEach((h, i) => {
console.log(` #${i + 1} ${h.address}: ${h.percentage.toFixed(2)}%`);
});
// Risk warning: top 10 suddenly hold a much larger share
if (totalConcentration > 50) {
console.log("🚨 Top 10 concentration above 50% — high risk");
}
};
Payload:
{
"type": "message",
"room": "top10:6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN",
"data": {
"holders": [
{ "address": "4Rz5xqikxtZ2s7wE9uQ6n2oLXQi6K65XGoYpKxf24Hqo", "percentage": 12.5 },
{ "address": "FV1r15rbNKkJanXLheoJA7fXEq6NDuMJ3bukXuhJWyV1", "percentage": 8.3 }
]
}
}
Watch Both Signals Together
Subscribe to both rooms in a single connection to get the full picture — holder count momentum plus concentration risk:
const token = "6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN";
const ws = new WebSocket("wss://datastream.solanatracker.io/YOUR_API_KEY");
let holderCount = 0;
let top10Pct = 0;
ws.onopen = () => {
ws.send(JSON.stringify({ type: "join", room: `holders:${token}` }));
ws.send(JSON.stringify({ type: "join", room: `top10:${token}` }));
};
ws.onmessage = (event) => {
const msg = JSON.parse(event.data);
if (msg.type !== "message") return;
const room = msg.room ?? "";
if (room.startsWith("holders:")) {
holderCount = msg.data.total;
console.log(`[HOLDERS] Total: ${holderCount}`);
}
if (room.startsWith("top10:")) {
top10Pct = msg.data.holders.reduce((sum, h) => sum + h.percentage, 0);
console.log(`[TOP10] Concentration: ${top10Pct.toFixed(1)}%`);
}
};
Auto-Reconnect Pattern
WebSocket connections drop. Always implement reconnect logic for production use:
function connectHolderStream(token, onHolderUpdate, onTop10Update) {
let ws;
let reconnectTimeout;
function connect() {
ws = new WebSocket("wss://datastream.solanatracker.io/YOUR_API_KEY");
ws.onopen = () => {
console.log("Connected — subscribing to holder streams");
ws.send(JSON.stringify({ type: "join", room: `holders:${token}` }));
ws.send(JSON.stringify({ type: "join", room: `top10:${token}` }));
};
ws.onmessage = (event) => {
const msg = JSON.parse(event.data);
if (msg.type !== "message") return;
if (msg.room?.startsWith("holders:")) onHolderUpdate(msg.data);
if (msg.room?.startsWith("top10:")) onTop10Update(msg.data);
};
ws.onclose = () => {
console.log("Disconnected — reconnecting in 3s");
reconnectTimeout = setTimeout(connect, 3000);
};
ws.onerror = (err) => {
console.error("WebSocket error:", err);
ws.close();
};
}
connect();
return () => {
clearTimeout(reconnectTimeout);
ws?.close();
};
}
// Usage
const stopWatching = connectHolderStream(
"6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN",
(data) => console.log("Holders:", data.total),
(data) => {
const pct = data.holders.reduce((s, h) => s + h.percentage, 0);
if (pct > 50) console.log("🚨 Risk warning: top 10 hold", pct.toFixed(1) + "%");
}
);
Room Reference
| Room | Updates when |
|---|
holders:{token} | Total holder count changes |
top10:{token} | Any top 10 wallet buys, sells, or exits |