Canonical: https://nitride.xyz/use-cases/transaction-monitoring

# Real-time transaction monitoring on Solana

Watch wallets, programs and token accounts on Solana from raw shreds: what a monitor can match before RPC, what shreds leave out, and a Python watchlist sketch.

Real-time transaction monitoring on Solana means matching each new transaction against a watchlist of wallets, programs and token accounts. Shreds carry those transactions while the leader is still building the block, so a monitor fed from raw shreds can flag a match before RPC subscriptions report it, then record the confirmed outcome later.

## What does a Solana transaction monitor watch?
A monitor is a matching engine with a memory. It holds a list of things you care about and records every transaction that touches them. Typical watchlists:

- **Treasury and hot wallets** of a protocol, fund or exchange, so an unexpected outflow is caught while it is still small.
- **Program upgrade authorities.** An upgrade instruction against a program you have funds in deserves attention even when it is legitimate.
- **Token accounts and mints**, for large transfers, mints and burns of a token you issue or hold.
- **Counterparties** for compliance screening: addresses your business has to know about when they appear.
- **Protocol vaults** during an incident, when a security team wants to see the next drain attempt rather than the last one.

RPC is the usual starting point: `logsSubscribe`, `accountSubscribe`, polling `getSignaturesForAddress`, or a Geyser plugin on their own node. All of those work. All of them report after a node has executed the block, which is fine for a ledger of what happened and slow for a response to what is happening. The post on [how shreds, Geyser and RPC differ in timing](https://nitride.xyz/blog/shreds-geyser-rpc) shows where each one sits.

Monitoring is the matching and the record. Delivering the result to a person or a bot is a separate job, covered in [alerts built on top of a shred stream](https://nitride.xyz/use-cases/trading-alerts).

## What can a monitor match from shreds before RPC reports it?
Once your decoder has turned shreds into entries and entries into transactions, each transaction gives the monitor:

- **The signatures**, which you keep as the key that joins the early sighting to the confirmed record later.
- **The static account keys**: signer, writable and read-only accounts named in the message. Most watchlist matches happen here.
- **The instructions**, with program ids and raw instruction data. For well-known programs, such as the SPL Token program, you can parse the amount of a transfer directly.
- **The position in the block**, since the leader's order is preserved in the entries.

Two things need more work. Version 0 transactions can load extra accounts from address lookup tables, and those addresses are not written in the message itself: the message holds the table address and indexes. To match them you keep your own copy of the lookup tables you care about and resolve the indexes yourself.

What shreds never contain is the outcome. There is no success or failure flag, no program logs, no balance changes and no inner instructions. A program that moves tokens through a cross-program invocation shows only the outer instruction. For those you wait for the confirmed transaction from `getTransaction` or a Geyser stream. [Where Solana latency comes from](https://nitride.xyz/learn/solana-latency) walks through the stages between a shred and a confirmed transaction. The [guide to processed, confirmed and finalized](https://nitride.xyz/learn/confirmation-levels) explains which commitment level to treat as final, and the [page on entries](https://nitride.xyz/learn/entries) covers the layer between shreds and transactions.

So a sound design has two lanes. The shred lane writes a "seen" event with the signature, the slot and the matched keys. The confirmed lane later writes "succeeded" or "failed" against the same signature. A seen event with no confirmed partner after a while is itself worth a look: a dropped fork, a skipped slot, or a gap in your own reception.

## Ultra or Standard for transaction monitoring?
Standard fits most monitoring. At $100 per destination for 30 days, it reaches your monitor through our relay. When a match ends up in a ticket, a chat message or a compliance log, the relay hop is small next to the time a person takes to read it. You get the same transactions as on Ultra.

Ultra Low Latency Shreds costs $200 for one destination for 30 days and goes directly from our server to yours, with no relay hop. It earns its price when a match triggers an automated action that competes with someone else: a guardian bot that sends a pause transaction when it sees a drain pattern, or a treasury bot that moves funds out of an account under attack. There, the sooner your decoder sees the attacker's transaction, the more slots your response has.

If you are unsure, start on Standard. The contents are identical, so moving to Ultra later changes only the delivery path, never your code. The [comparison of the two delivery paths](https://nitride.xyz/compare/ultra-vs-standard-shreds) lays out the difference. We publish no latency figure; measure the gap between your shred lane and your confirmed lane on your own server.

## A Python watchlist sketch
Python is a good language for a first monitor, as long as the receive loop stays small. This sketch reads the slot (a little-endian u64 at offset 65, 8 bytes) and the FEC set index (a u32 at offset 79, 4 bytes), feeds each shred to a decoder you supply, and checks every finished transaction against the watchlist.

```python file="monitor.py"
import socket
import struct
import time

WATCH = {"<treasury address>", "<program id>", "<upgrade authority>"}


class Decoder:
    """Your code: group shreds by (slot, FEC set), recover, parse entries.
    Return the transactions this shred completed, as dicts with
    "signature" and "keys" (static keys plus resolved lookup-table keys)."""

    def add(self, slot, fec_set, shred):
        return []


sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 32 * 1024 * 1024)
sock.bind(("0.0.0.0", 9000))
decoder = Decoder()

while True:
    data, _ = sock.recvfrom(1228)
    if len(data) < 83:
        continue  # too short for the common header
    (slot,) = struct.unpack_from("<Q", data, 65)
    (fec_set,) = struct.unpack_from("<I", data, 79)
    for tx in decoder.add(slot, fec_set, data):
        hits = WATCH.intersection(tx["keys"])
        if hits:
            # "seen" record; the confirmed lane updates it by signature later
            print(time.time(), slot, tx["signature"], sorted(hits), flush=True)
```

The `Decoder` class is a placeholder for your own decoding code or a wrapper around an open-source shred decoder. Ask the kernel for a large receive buffer, as the sketch does, and raise `net.core.rmem_max` to match. A single Python process can fall behind the stream at busy times: when it does, keep Python for matching and move receiving and decoding to a compiled process, starting from the [Rust receiver](https://nitride.xyz/docs/rust). The [Python receiver](https://nitride.xyz/docs/receiver/python) is the place to start the matcher itself.

## What are the limits of monitoring from shreds?
- **A lost shred can hide a match.** Raw UDP has no retransmission. When coding shreds cannot rebuild a missing data shred, the transactions in it never reach your matcher. For monitoring, completeness matters more than speed, so the confirmed lane stays the system of record. [Detecting gaps and duplicates](https://nitride.xyz/docs/receiver/gap-detection) covers how to notice the holes.
- **No outcomes.** Shreds say a transaction was placed in a block, not that it succeeded.
- **Pre-confirmation data.** A block seen in shreds can be dropped by a fork, or its slot skipped. Never report "funds moved" from the shred lane alone.
- **Decoding is yours.** Nothing is decoded on our side, and you also need lookup-table resolution for version 0 transactions.
- **One sending city.** Delivery leaves from Frankfurt. A monitor elsewhere still works, it sees each block later by an amount that depends on the route.

## Where to go next
Related workloads: [operators watching their own validator and RPC nodes](https://nitride.xyz/use-cases/validator-infrastructure), [indexers that build tables from shreds](https://nitride.xyz/use-cases/real-time-indexing) and [detecting new token launches](https://nitride.xyz/use-cases/token-launch-detection). Every workload is on the [use cases hub](https://nitride.xyz/use-cases).

To start, pay in USDC on Solana at [checkout.nitride.xyz](https://checkout.nitride.xyz) and email support@nitride.xyz with the order reference and the IPv4 address and UDP port of your monitor. Both plans are on the [pricing page](https://nitride.xyz/pricing).

### Do shreds show whether a transaction succeeded?

No. Shreds contain the transaction as the leader placed it, without its result, logs or balance changes. Read the outcome from your RPC node or a Geyser stream once the slot is confirmed.

### Can I receive only the transactions for my watchlist?

No. Each plan delivers the full raw stream to your destination, and your own code decides what to keep after decoding. Filter by program id early to keep the matcher light.

### Is Standard enough for compliance monitoring?

Usually, yes. Compliance and treasury monitoring end in a human review or a log entry, where the relay hop on Standard makes little practical difference, and the contents match Ultra.

### What happens when my 30 days end?

Delivery stops unless you pay again. Before your 30 days end, we email you a link to pay for the next 30 days. Nothing is charged automatically.
