Canonical: https://nitride.xyz/use-cases/market-making

# Shreds for Solana market makers

How Solana market makers use raw shreds to see fills, cancels and oracle updates before RPC, which plan fits a quoting engine, and a Rust receiver sketch.

Market makers on Solana use shreds to see fills, cancels, oracle updates and large swaps while the leader is still producing the block, before an RPC node reports them. Nitride.xyz sends raw shreds over UDP from Frankfurt: Standard Shreds at $100 or Ultra Low Latency Shreds at $200, each for one destination for 30 days.

## What does a Solana market maker react to?
A market maker on Solana keeps two-sided quotes on on-chain order books, often provides concentrated liquidity in AMM pools on the same pairs, and hedges the inventory it builds up on another venue. The profit is the spread minus adverse selection: the losses from being filled just before the price moves against you. Every quote that rests on old information is a free option handed to whoever trades against it.

Three inputs move a quote. Your own fills change inventory and therefore skew. Other flow on the same market (aggressive orders, cancels, large swaps through a pool on the same pair) tells you where the price is about to go. The reference price, from an oracle or from the venue you hedge on, sets the mid. The hedge venue usually sits off chain, so shreds do not help there. The first two inputs live in Solana transactions, and that is the part of your Solana market making data where the delivery path matters.

## What do shreds show a market maker before the block is confirmed?
A shred is a fragment of the block the current leader is building, sent out over Turbine while the slot is still running. Once your decoder has rebuilt entries from them, you hold the slot's transactions in the order the leader placed them, before any RPC node has finished executing that block. The [pillar on where Solana latency comes from](https://nitride.xyz/learn/solana-latency) walks through each stage a transaction passes on its way to an RPC response.

For a quoting engine, the useful signals are:

- **Your own transactions inside a leader's block.** A new quote or a cancel that appears in shreds has been included by the leader. You can move expected inventory to "seen" without waiting for RPC, and promote it to "settled" once the slot is confirmed.
- **Sweeps and cancels from other participants** on the markets you quote. An order that walks through several price levels is the classic cue to widen or step back.
- **Oracle update transactions.** Venues that mark positions to an oracle reprice when the update executes. Seeing the update instruction early lets you move your own quotes in step.
- **Large swaps through AMM pools** on the same pair, which shift the price the order books will converge to.
- **Slot cadence.** Shreds for a new slot mean a new block is under way. A slot that never produces shreds is a hint that the leader skipped it.

One caveat shapes everything above: shreds carry transactions, not their results. A swap you see may fail when it executes, and the shred tells you the instruction and the accounts, not the new pool balance. You estimate the effect, or simulate it against your own copy of the relevant accounts.

## Ultra or Standard for market making?
It depends on how tight you quote and how often you get picked off.

Ultra Low Latency Shreds costs $200 for one destination for 30 days. It travels directly from our server to yours, with no relay hop, so it reaches you sooner than Standard. If you quote tight on busy pairs and your losses come from flow you could have seen in time, the relay hop is one of the few delays you can still remove by paying for it, and Ultra is the plan to test.

Standard Shreds costs $100 for one destination for 30 days. Its shreds are identical to Ultra's, delivered through our relay. If you quote wider, refresh quotes on a timer, or use shreds mainly to track inventory and run risk checks, Standard gives you identical information for half the price. A sensible path is to start here, build the decoder, and move up only when your own logs show quotes lost to flow that arrived a moment too late.

Where your server sits matters at least as much as the plan. Both plans leave from Frankfurt, and neither plan changes the route from Frankfurt to your machine. Our note on [why delivery starts in Frankfurt](https://nitride.xyz/blog/why-frankfurt) explains the choice of city.

We publish no latency figure, because the gap depends on where your server sits and on the route to it. Measure it on your own server: log the arrival time of each new slot and compare it with the moment your RPC node reports the same slot. Each plan has a free 2-hour trial, once per person. The [side-by-side comparison of Ultra and Standard](https://nitride.xyz/compare/ultra-vs-standard-shreds) covers the delivery paths in more detail.

## A receiver sketch for a quoting engine
This sketch uses the Rust standard library only. The receive loop does three things: it reads the slot (a little-endian u64 at offset 65, 8 bytes), it tells the quoting engine when a new slot appears, and it passes the raw shred to a decoder thread through a bounded channel.

```rust file="src/main.rs"
use std::net::UdpSocket;
use std::sync::mpsc::{sync_channel, TrySendError};
use std::thread;
use std::time::Instant;

fn main() -> std::io::Result<()> {
    let sock = UdpSocket::bind("0.0.0.0:9000")?;
    let (tx, rx) = sync_channel::<(u64, Vec<u8>)>(65_536);

    // Decoder thread: FEC recovery, entry parsing and book updates are your own code.
    thread::spawn(move || {
        for (slot, shred) in rx {
            decode_and_update_book(slot, &shred);
        }
    });

    let mut buf = [0u8; 1228];
    let mut tip: u64 = 0;
    let mut tip_seen_at = Instant::now();
    loop {
        let (n, _) = sock.recv_from(&mut buf)?;
        if n < 83 {
            continue; // shorter than the common header: not a shred
        }
        let slot = u64::from_le_bytes(buf[65..73].try_into().unwrap());
        if slot > tip {
            on_new_slot(slot, tip_seen_at.elapsed().as_micros());
            tip = slot;
            tip_seen_at = Instant::now();
        }
        match tx.try_send((slot, buf[..n].to_vec())) {
            Ok(()) => {}
            Err(TrySendError::Full(_)) => count_queue_drop(slot),
            Err(TrySendError::Disconnected(_)) => break Ok(()),
        }
    }
}

fn on_new_slot(_slot: u64, _since_previous_us: u128) { /* nudge the quoting engine */ }
fn decode_and_update_book(_slot: u64, _shred: &[u8]) { /* your decoder */ }
fn count_queue_drop(_slot: u64) { /* export as a metric */ }
```

The receive thread never blocks on the decoder: `try_send` either queues the shred or counts a drop you can see in your metrics. The time between new slots is a cheap health signal for the quoting engine, since a stall usually means a skipped leader or a receive problem. The decoding step, grouping shreds by FEC set, recovering missing data shreds and parsing entries into transactions, is your own code or an open-source shred decoder. The [Rust receiver walkthrough](https://nitride.xyz/docs/rust) has a complete program that also prints the shred type and index.

## What shreds will not do for a market maker
- **Packets can be lost.** Delivery is raw UDP with no retransmission. A missing data shred can sometimes be rebuilt from coding shreds in the same FEC set. When it cannot, that part of the block never reaches your view. Your book model has to tolerate holes and resync from RPC.
- **You decode.** The stream is raw: nothing is decoded on our side. Budget engineering time for the decoder and CPU cores so decoding never slows the receive thread.
- **Everything is provisional.** Shreds are pre-confirmation data. A leader's block can be dropped by a fork, or the slot skipped, so a fill seen in shreds is a strong hint, not a settled trade. Keep "seen" and "confirmed" inventory apart.
- **One city.** Delivery comes from Frankfurt only. If your hedge venue and your servers live elsewhere, decide which leg the quoting engine sits next to.
- **No numbers from us.** We publish no latency figure, so any comparison has to come from your own logs.

## Where to go next
Other trading workloads use the same stream differently: [arbitrage bots racing price gaps between venues](https://nitride.xyz/use-cases/arbitrage), [liquidation bots watching collateral](https://nitride.xyz/use-cases/liquidation-bots) and [MEV searchers working from public data](https://nitride.xyz/use-cases/mev-searching). If your risk team wants an independent record of your wallets, see [real-time monitoring of wallets and programs](https://nitride.xyz/use-cases/transaction-monitoring). All workloads are listed on the [use cases hub](https://nitride.xyz/use-cases).

To buy, pay in USDC on Solana at [checkout.nitride.xyz](https://checkout.nitride.xyz), then email support@nitride.xyz with your order reference and the public IPv4 address and UDP port of your quoting server. Prices for both plans are on the [pricing page](https://nitride.xyz/pricing).

### Can a market maker run on shreds alone?

No. Shreds give an early, provisional view of transactions without their results. Keep a confirmed source, such as your RPC node or a Geyser stream, as the record for balances and positions.

### Which plan should a market-making desk start with?

Start with Standard if you are still building the decoder or you quote wide. Move to Ultra when your own logs show losses to flow that arrived just too late, since Ultra removes the relay hop.

### Can I try Ultra before quoting on it?

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.

### How do I pay, and does it renew?

You pay in USDC on Solana at checkout.nitride.xyz. Before your 30 days end, we email you a link to pay for the next 30 days. Nothing is charged automatically.
