Messages
{
"type": "join",
"room": "transfer:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v:GachaNgyXTU3zFogQ8Z5jR2BLXs8215X2AtEH18VxJq3"
}{
"type": "leave",
"room": "transfer:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v:GachaNgyXTU3zFogQ8Z5jR2BLXs8215X2AtEH18VxJq3"
}{
"type": "message",
"room": "transfer:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v:GachaNgyXTU3zFogQ8Z5jR2BLXs8215X2AtEH18VxJq3",
"data": {
"signature": "2VxcHt8HKSt2T2EuUZLyWPsEKz4H4BPreWV28aZDEzoaHG4Fsu232oKKeQqpVqsSYaf3vv8KN7UoZ4MPJA8vw9EF",
"slot": 459159504,
"timestamp": 1792483949,
"commitment": "processed",
"swapTx": false,
"transfers": [
{
"id": "2VxcHt8HKSt2T2EuUZLyWPsEKz4H4BPreWV28aZDEzoaHG4Fsu232oKKeQqpVqsSYaf3vv8KN7UoZ4MPJA8vw9EF:2:-1",
"signature": "2VxcHt8HKSt2T2EuUZLyWPsEKz4H4BPreWV28aZDEzoaHG4Fsu232oKKeQqpVqsSYaf3vv8KN7UoZ4MPJA8vw9EF",
"slot": 459159504,
"timestamp": 1792483949,
"commitment": "processed",
"instruction": 2,
"inner": -1,
"type": "spl",
"program": "spl-token",
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"decimals": 6,
"amount": "25000000",
"uiAmount": "25",
"from": {
"address": "C2RjaMN2NeYAErS6KiBjPQhHCt95J8mCmmLiQqZXPisR",
"owner": "BfG7WYmravgBhNdWpGoiFmF8L1duw2vdqdDHiZid2hoJ",
"postBalance": "71035743"
},
"to": {
"address": "D9CEogjHA6CpS12F8St9zpSco7pQKJB5uR1RqDsuzQZk",
"owner": "GachaNgyXTU3zFogQ8Z5jR2BLXs8215X2AtEH18VxJq3",
"postBalance": "656987841913"
},
"swapTx": false,
"direction": "in"
}
],
"balances": [
{
"owner": "GachaNgyXTU3zFogQ8Z5jR2BLXs8215X2AtEH18VxJq3",
"account": "D9CEogjHA6CpS12F8St9zpSco7pQKJB5uR1RqDsuzQZk",
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"program": "spl-token",
"decimals": 6,
"pre": "656962841913",
"post": "656987841913",
"change": "25000000",
"cause": "transfer"
}
]
}
}Transfers
Stream a Wallet's Transfers of One Token
Stream transfers of one token to or from one Solana wallet over Datastream WebSocket. Subscribe by mint and wallet. Works for SOL via the wrapped mint.
WSS
/
Transfers of one token to or from one wallet. Room:
One message is sent per transaction. Amounts are raw integer strings with an exact
transfer:{mint}:{wallet}. Each transfer has direction relative to the wallet, and balances lists the wallet’s balance changes of that token. Works for SOL with the wrapped SOL mint. Append :enriched for token metadata, USD values and wallet identities. Events are provisional at processed commitment.
WebSocket example
const mint = "So11111111111111111111111111111111111111112"; // SOL works here
const wallet = "GachaNgyXTU3zFogQ8Z5jR2BLXs8215X2AtEH18VxJq3";
const room = `transfer:${mint}:${wallet}`; // or `${...}:enriched` for token metadata, USD values and wallet identities
const ws = new WebSocket("wss://datastream.solanatracker.io/YOUR_API_KEY");
ws.addEventListener("open", () => {
ws.send(JSON.stringify({ type: "join", room }));
});
ws.addEventListener("message", (event) => {
const msg = JSON.parse(event.data);
if (msg.type === "ping") return ws.send(JSON.stringify({ type: "pong" }));
if (msg.type !== "message") return;
const { signature, transfers, balances } = msg.data;
for (const t of transfers) {
console.log(signature, t.direction ?? "", t.uiAmount, t.mint, t.from.owner, "->", t.to.owner);
}
});
uiAmount. A transfer that is a leg of a swap already streamed in the trade rooms is not sent again; what remains of a swap (platform fees, tips, payouts) arrives with swapTx: true. See the transfers guide for history plus live updates.
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.transfers.tokenWallet('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', 'FbMxP3GVq8TQ36nbYgx4NP9iygMpwAwFWJwW81ioCiSF', { enriched: true }).on((data) => {
console.log(data);
});
// sub.unsubscribe();
Messages
{
"type": "join",
"room": "transfer:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v:GachaNgyXTU3zFogQ8Z5jR2BLXs8215X2AtEH18VxJq3"
}{
"type": "leave",
"room": "transfer:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v:GachaNgyXTU3zFogQ8Z5jR2BLXs8215X2AtEH18VxJq3"
}{
"type": "message",
"room": "transfer:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v:GachaNgyXTU3zFogQ8Z5jR2BLXs8215X2AtEH18VxJq3",
"data": {
"signature": "2VxcHt8HKSt2T2EuUZLyWPsEKz4H4BPreWV28aZDEzoaHG4Fsu232oKKeQqpVqsSYaf3vv8KN7UoZ4MPJA8vw9EF",
"slot": 459159504,
"timestamp": 1792483949,
"commitment": "processed",
"swapTx": false,
"transfers": [
{
"id": "2VxcHt8HKSt2T2EuUZLyWPsEKz4H4BPreWV28aZDEzoaHG4Fsu232oKKeQqpVqsSYaf3vv8KN7UoZ4MPJA8vw9EF:2:-1",
"signature": "2VxcHt8HKSt2T2EuUZLyWPsEKz4H4BPreWV28aZDEzoaHG4Fsu232oKKeQqpVqsSYaf3vv8KN7UoZ4MPJA8vw9EF",
"slot": 459159504,
"timestamp": 1792483949,
"commitment": "processed",
"instruction": 2,
"inner": -1,
"type": "spl",
"program": "spl-token",
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"decimals": 6,
"amount": "25000000",
"uiAmount": "25",
"from": {
"address": "C2RjaMN2NeYAErS6KiBjPQhHCt95J8mCmmLiQqZXPisR",
"owner": "BfG7WYmravgBhNdWpGoiFmF8L1duw2vdqdDHiZid2hoJ",
"postBalance": "71035743"
},
"to": {
"address": "D9CEogjHA6CpS12F8St9zpSco7pQKJB5uR1RqDsuzQZk",
"owner": "GachaNgyXTU3zFogQ8Z5jR2BLXs8215X2AtEH18VxJq3",
"postBalance": "656987841913"
},
"swapTx": false,
"direction": "in"
}
],
"balances": [
{
"owner": "GachaNgyXTU3zFogQ8Z5jR2BLXs8215X2AtEH18VxJq3",
"account": "D9CEogjHA6CpS12F8St9zpSco7pQKJB5uR1RqDsuzQZk",
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"program": "spl-token",
"decimals": 6,
"pre": "656962841913",
"post": "656987841913",
"change": "25000000",
"cause": "transfer"
}
]
}
}apiKey
type:httpApiKey
API key for authentication. Include your Datastream key in the connection URL: wss://datastream.solanatracker.io/{DATASTREAM_KEY}
Subscribe to token transfers for a wallet
type:object
Unsubscribe from token transfers for a wallet
type:object
Token transfers for a wallet notification
type:object
Was this page helpful?