Real-Time Streams
Subscribe to live data feeds from Slipstream. Available on QUIC, gRPC, and WebSocket protocols. Streams can be enabled at config time or subscribed to after connecting.
Stream Types
| Stream | Config Flag | Description |
|---|---|---|
| Leader Hints | leader_hints (default: true) | Upcoming leader schedule with proximity scores and per-region RTT |
| Tip Instructions | stream_tip_instructions | Recommended tip amounts per sender with confidence scores |
| Priority Fees | stream_priority_fees | Current priority fee percentiles with landing probability |
| Latest Blockhash | stream_latest_blockhash | Blockhash updates with last valid block height |
| Latest Slot | stream_latest_slot | Slot progression notifications |
Enable at Config Time
let config = Config::builder()
.api_key("sk_live_...")
.leader_hints(true)
.stream_tip_instructions(true)
.stream_priority_fees(true)
.stream_latest_blockhash(true)
.stream_latest_slot(true)
.build()?;Leader Hints
Real-time leader proximity data with per-region RTT to optimize transaction timing.
Leader Hints — Rust
let mut rx = client.subscribe_leader_hints().await?;
while let Some(hint) = rx.recv().await {
println!("Slot {}: leader={}", hint.slot, hint.leader_pubkey);
println!(" Preferred region: {}", hint.preferred_region);
println!(" Backup regions: {:?}", hint.backup_regions);
println!(" Confidence: {}%", hint.confidence);
println!(" TPU RTT: {}ms", hint.metadata.tpu_rtt_ms);
println!(" Region score: {:.2}", hint.metadata.region_score);
if let Some(rtt_map) = &hint.metadata.region_rtt_ms {
for (region, rtt) in rtt_map {
println!(" {}: {}ms", region, rtt);
}
}
}Leader Hints — TypeScript
await client.subscribeLeaderHints();
client.on("leaderHint", (hint) => {
console.log(`Slot ${hint.slot}: leader=${hint.leaderPubkey}`);
console.log(` Preferred region: ${hint.preferredRegion}`);
console.log(` Backup regions: ${hint.backupRegions}`);
console.log(` Confidence: ${hint.confidence}%`);
console.log(` TPU RTT: ${hint.metadata.tpuRttMs}ms`);
if (hint.metadata.regionRttMs) {
for (const [region, rtt] of Object.entries(hint.metadata.regionRttMs)) {
console.log(` ${region}: ${rtt}ms`);
}
}
});Leader Hints — Python
await client.subscribe_leader_hints()
@client.on("leader_hint")
async def on_leader_hint(hint):
print(f"Slot {hint.slot}: leader={hint.leader_pubkey}")
print(f" Preferred region: {hint.preferred_region}")
print(f" Confidence: {hint.confidence}%")
print(f" TPU RTT: {hint.metadata.tpu_rtt_ms}ms")Tip Instructions
Get recommended tip amounts per sender based on current network conditions.
Tip Instructions — Rust
let mut rx = client.subscribe_tip_instructions().await?;
while let Some(tip) = rx.recv().await {
println!("Sender: {} ({})", tip.sender_name, tip.sender);
println!(" Tip wallet: {}", tip.tip_wallet_address);
println!(" Tip amount: {} SOL ({})", tip.tip_amount_sol, tip.tip_tier);
println!(" Expected latency: {}ms", tip.expected_latency_ms);
println!(" Confidence: {}%", tip.confidence);
println!(" Valid until slot: {}", tip.valid_until_slot);
for alt in &tip.alternative_senders {
println!(" Alt: {} — {} SOL, confidence {}%",
alt.sender, alt.tip_amount_sol, alt.confidence);
}
}Tip Instructions — TypeScript
await client.subscribeTipInstructions();
client.on("tipInstruction", (tip) => {
console.log(`Sender: ${tip.senderName} (${tip.sender})`);
console.log(` Tip: ${tip.tipAmountSol} SOL (${tip.tipTier})`);
console.log(` Latency: ${tip.expectedLatencyMs}ms, confidence: ${tip.confidence}%`);
for (const alt of tip.alternativeSenders) {
console.log(` Alt: ${alt.sender} — ${alt.tipAmountSol} SOL`);
}
});Tip Instructions — Python
await client.subscribe_tip_instructions()
@client.on("tip_instruction")
async def on_tip(tip):
print(f"Sender: {tip.sender_name} — {tip.tip_amount_sol} SOL ({tip.tip_tier})")
print(f" Latency: {tip.expected_latency_ms}ms, confidence: {tip.confidence}%")Cached Tips
The SDK caches the latest tip instruction. Access it without subscribing:
if let Some(tip) = client.get_latest_tip() {
println!("Latest tip: {} SOL via {}", tip.tip_amount_sol, tip.sender_name);
}const tip = client.getLatestTip();
if (tip) console.log(`Latest tip: ${tip.tipAmountSol} SOL via ${tip.senderName}`);tip = client.get_latest_tip()
if tip:
print(f"Latest tip: {tip.tip_amount_sol} SOL via {tip.sender_name}")Priority Fees
Current priority fee percentiles with landing probability estimates.
Priority Fees — Rust
let mut rx = client.subscribe_priority_fees().await?;
while let Some(fee) = rx.recv().await {
println!("{} — {} micro-lamports/CU (limit: {})",
fee.speed, fee.compute_unit_price, fee.compute_unit_limit);
println!(" Est. cost: {} SOL", fee.estimated_cost_sol);
println!(" Landing probability: {}%", fee.landing_probability);
println!(" Congestion: {}", fee.network_congestion);
println!(" Success rate: {:.1}%", fee.recent_success_rate * 100.0);
}Priority Fees — TypeScript
await client.subscribePriorityFees();
client.on("priorityFee", (fee) => {
console.log(`${fee.speed} — ${fee.computeUnitPrice} micro-lamports/CU`);
console.log(` Est. cost: ${fee.estimatedCostSol} SOL`);
console.log(` Landing probability: ${fee.landingProbability}%`);
});Blockhash & Slot
Blockhash — Rust
let mut rx = client.subscribe_latest_blockhash().await?;
while let Some(bh) = rx.recv().await {
println!("Blockhash: {} (valid until height {})",
bh.blockhash, bh.last_valid_block_height);
}Slot — Rust
let mut rx = client.subscribe_latest_slot().await?;
while let Some(slot) = rx.recv().await {
println!("Slot: {}", slot.slot);
}Next Steps
- Transactions — Use stream data to optimize submissions
- Bundles — Time bundles with tip instructions
- Multi-Region — Streams across regions
