Nitride.xyz
Use case · Updated November 17, 2026

Real-time indexing from shreds

Nitride.xyz team

A real-time indexer built on shreds decodes Solana's raw block fragments while the leader is still broadcasting them, so rows for a slot exist before an RPC node can serve that block. Shreds carry transactions but no execution results, so the indexer stores them as provisional and settles each slot against a confirmed block later.

What does a real-time indexer on Solana do?#

An indexer turns chain activity into rows you can query: transfers by account, swaps by pool, calls by program and instruction. The usual pipeline waits for a finished block, either by polling getBlock on an RPC node or through a Geyser plugin on a node you run. Both are sound, and both start work only once the block exists in full.

Indexing from shreds moves the ingest point earlier. You receive the pieces of each block as the leader sends them and rebuild the block yourself. You gain time and lose execution metadata, so a common design has two tiers: a provisional tier fed by shreds, and a settled tier fed by confirmed blocks. Rows move from the first to the second, or get deleted.

Who wants that? Wallets and explorers that show activity as "seen" before it is final, analytics teams that care about the order of transactions inside a slot, and trading desks that keep their own pool or order tables instead of trusting a third party's. Operators who already run nodes will find the infrastructure side on the validator and RPC operators page, and alerting on specific accounts is covered in real-time transaction monitoring.

What do shreds give an indexer before RPC does?#

Once your decoder rebuilds the entries of a slot, you hold:

  • Every transaction the leader included, in execution order. Entries come in sequence, and transactions inside an entry keep their position. That is the same order getBlock returns, only sooner.
  • Signatures, static account keys and the data of each top-level instruction. That is enough to index "who called which program with which arguments".
  • Slot completion signals. The data shred header has a flag on the last data shred of a slot, so you can tell a complete block from one with gaps.
  • Coding shreds, which let your decoder rebuild a limited number of lost data shreds in the same FEC set.

What shreds do not hold matters as much for an index schema:

  • No success or failure status, no logs, no fee or balance changes. Those live in the transaction metadata a node produces after execution.
  • No inner instructions. Calls a program makes to another program (CPI) are only visible in that metadata, so a token transfer made inside a swap does not appear as its own instruction.
  • Unresolved lookup tables. Versioned (v0) messages may point at accounts as positions inside an on-chain table. To name those accounts, your indexer keeps its own copy of the tables it meets.

A workable schema carries a status column: seen from shreds, then confirmed after reconciliation, or dropped when the slot was skipped or lost a fork.

Ultra or Standard for an indexer?#

For most indexers, Standard is the right buy. People and applications query an index on their own clock, and what they notice is a missing row or a wrong status, not the cost of one relay hop. Standard Shreds costs $100 for one destination for 30 days, delivered through our relay.

Ultra Low Latency Shreds costs $200 for one destination for 30 days. It is sent directly from our server to yours with no relay hop, so it arrives sooner than Standard. The shreds are identical; only the delivery path differs. Pick Ultra when your index sits inside an automated trading path, for example a pool-state table that a bot reads before it sends orders. In that case the index is part of the race and the hop counts.

We publish no latency figure, because the gap depends on where your server sits and the route to it. Measure on your own server. The trade-off is laid out in Ultra Low Latency vs Standard Shreds. Each extra destination, such as a staging indexer next to production, is a separate purchase.

A receiver sketch: group shreds by slot#

This Rust sketch uses only the standard library. The receive loop does as little as possible: it reads the slot of each shred (a little-endian u64 at offset 65, 8 bytes), keeps shreds in per-slot buckets, and hands a bucket to a decoder thread once the slot falls a few slots behind the newest one seen.

indexer_ingest.rs
1use std::collections::BTreeMap;
2use std::net::UdpSocket;
3use std::sync::mpsc;
4use std::thread;
5
6const MAX_DATAGRAM: usize = 1228;
7const COMMON_HEADER: usize = 83;
8const SETTLE_SLOTS: u64 = 4; // wait this far behind the newest slot for late shreds
9
10fn main() -> std::io::Result<()> {
11 let socket = UdpSocket::bind("0.0.0.0:9000")?;
12 let (to_decoder, from_ingest) = mpsc::sync_channel::<(u64, Vec<Vec<u8>>)>(64);
13
14 thread::spawn(move || {
15 for (slot, shreds) in from_ingest {
16 // Your decoder or an open-source shred decoder goes here:
17 // group by FEC set, recover, deserialise entries, write rows with status "seen".
18 println!("slot {slot}: {} shreds ready to decode", shreds.len());
19 }
20 });
21
22 let mut open: BTreeMap<u64, Vec<Vec<u8>>> = BTreeMap::new();
23 let mut newest = 0u64;
24 let mut buf = [0u8; MAX_DATAGRAM];
25 loop {
26 let (len, _peer) = socket.recv_from(&mut buf)?;
27 if len < COMMON_HEADER { continue; }
28 let slot = u64::from_le_bytes(buf[65..73].try_into().unwrap());
29 if slot + SETTLE_SLOTS <= newest { continue; } // slot already handed on
30 newest = newest.max(slot);
31 open.entry(slot).or_default().push(buf[..len].to_vec());
32 while let Some((&oldest, _)) = open.first_key_value() {
33 if oldest + SETTLE_SLOTS > newest { break; }
34 let shreds = open.remove(&oldest).unwrap();
35 if to_decoder.try_send((oldest, shreds)).is_err() {
36 eprintln!("decoder behind: slot {oldest} not indexed, fetch it from RPC later");
37 }
38 }
39 }
40}

Three choices in it are deliberate. The settle window exists because UDP can reorder packets, so a slot's last shreds may arrive after the next slot has begun. The try_send drops a whole slot when the decoder falls behind instead of blocking: a blocked receive loop lets the kernel buffer fill, and then you lose packets with no record of which ones. A dropped slot is logged, and your reconciler can fetch it from RPC. Finally, the decoder is your code or an open-source shred decoder. It groups shreds by FEC set index (bytes 79 to 82), recovers what it can from coding shreds, joins data payloads in index order and deserialises entries, then transactions.

The full header table and a source-address check are on the Rust receiver page. The decoding steps are covered in recovering and decoding entries.

What are the limits of indexing from shreds?#

  • Loss is permanent on our side. Raw UDP has no retransmission. A lost data shred comes back only if enough coding shreds from its FEC set arrived. Otherwise the slot has a gap, and your reconciler fills it from a confirmed block.
  • You decode everything. Nothing arrives parsed. Version upgrades on the network can change shred formats, so your decoder needs maintenance.
  • Provisional means provisional. Shreds are pre-confirmation data. A leader's block can be skipped or end up on a losing fork, and its rows must be deletable. Never let a consumer treat seen as final.
  • No history. Delivery starts when your destination is activated. There is no replay or backfill, so history comes from an archive RPC node.
  • One origin. Delivery comes from Frankfurt only. If your indexer runs on another continent, measure what that route costs before you rely on it.

Next steps#

Read Solana shreds, explained and entries, the layer between shreds and transactions for how shreds become transactions, and shreds, Geyser and RPC compared for how the three data sources differ. If launches are what you index, the token launch detection page covers the matching logic. The rest of the workloads sit on the use cases hub.

Each plan has a free 2-hour trial, once per person. Email support@nitride.xyz with the IPv4 address and UDP port you want to test. We verify you receive on that address, then your 2 hours start. Keep that port reachable during the check. Once delivery is active, support can give you the address we send from.

Can I build a full Solana indexer from shreds alone?#

No. Shreds give you included transactions in order, but no status, logs, inner instructions or balance changes. Pair them with confirmed blocks from RPC or a Geyser plugin for results and for history.

How does an indexer know a slot is complete?#

The last data shred of a slot carries a flag in its header. When you hold every data shred up to that index, or can recover the missing ones from coding shreds in the same FEC set, the block is whole.

What happens to provisional rows when a slot is skipped?#

They must go. Mark them dropped or delete them when the slot fails to confirm, and keep only rows that match a confirmed block.

Does Nitride.xyz provide historical shreds to backfill an index?#

No. Delivery starts at activation and there is no replay or backfill. Backfill from an archive RPC node and use shreds for the live edge.

Sources#