Canonical: https://nitride.xyz/use-cases/trading-alerts

# Trading alerts built on shreds

Build Solana trading alerts on raw shreds: whale moves, large swaps and pool changes seen while the block is produced, with a confirm step and a watchdog.

Trading alerts built on shreds fire when a decoded transaction matches a rule, such as a whale transfer, a large swap or liquidity pulled from a pool, while the block is still being produced. Each alert reports what was seen, not what settled, so a sound pipeline sends a follow-up once RPC confirms the transaction.

## What alerts do Solana traders build?
An alert is a rule plus a destination. The rule decides which transactions matter, and the destination is a chat channel, a phone, a trading desk screen or another program. Common Solana trading alerts:

- **Whale transfers** of a token you hold, especially into an exchange deposit address.
- **Large swaps** in a pool you trade, in either direction, above a size you set.
- **Liquidity removal** from a pool, the classic early sign of a rug on a new token.
- **New pools** for a token you track, which often move price on the old pool.
- **Wallet activity** of traders you follow, the starting point for [copy trading bots](https://nitride.xyz/use-cases/copy-trading).
- **Mint and authority changes** on a token: new supply, or a freeze authority that was never revoked.

Alerts have two kinds of readers. People read them in Telegram, Discord or a desk tool, and decide. Programs read them and act. The two need different things from the feed, which matters for the plan choice below.

## What can an alert see in shreds that RPC reports later?
The matching layer behind an alert is the same one a monitor uses: decode shreds into transactions, then compare accounts and instructions against rules. The page on [watching wallets and programs in real time](https://nitride.xyz/use-cases/transaction-monitoring) covers that layer in detail. Here, the interesting part is what an alert can say, and when.

From shreds alone, an alert can say: this signature, in this slot, calls this program with these accounts and this instruction data. For a token transfer, the amount is in the instruction. For a swap, the input amount and the minimum output the trader accepted are in the instruction, which already tells you the size and the direction. For a new pool or a liquidity removal, the instruction names the pool and the amounts.

What it cannot say is whether the transaction worked. Shreds carry no result, no logs and no balance changes, and the block they belong to has not been confirmed. A failed swap, a dropped fork and a skipped slot all look the same as success at the moment the alert fires. The [guide to processed, confirmed and finalized](https://nitride.xyz/learn/confirmation-levels) explains the levels, and [where Solana latency comes from](https://nitride.xyz/learn/solana-latency) shows the stages between a shred and a confirmed block.

The practical answer is a two-step alert. Step one goes out from the shred lane, labelled as seen: "Seen in slot N: 40,000 USDC into exchange deposit, not yet confirmed." Step two follows from your RPC node, using `getSignatureStatuses` on the same signature: "Confirmed" or "Did not land." Readers learn quickly to act on step one for speed and trust step two for the record.

## Ultra or Standard for trading alerts?
For alerts that people read, Standard. It costs $100 per destination for 30 days, with shreds passing through our relay on the way to you. The path from your receiver to a person's phone, through a chat service and a notification, takes far longer than one relay hop, and a person then needs time to read and decide. Paying for Ultra does not change what that person can do.

For alerts that programs read, it depends on what the program does next. Ultra Low Latency Shreds costs $200 for one destination for 30 days and goes directly from our server to yours with no relay hop, so it arrives sooner than Standard. If the alert triggers a trade that competes with other bots, such as selling on a liquidity-removal signal, Ultra is worth testing. If it triggers a slower action, such as rebalancing a portfolio, Standard is enough.

One purchase can feed every alert you run. A plan delivers to one destination, and your receiver can serve thousands of rules and readers from that one stream. You buy a second destination only for a second receiving server. The [side-by-side view of Ultra and Standard](https://nitride.xyz/compare/ultra-vs-standard-shreds) has the full comparison. We publish no latency figure: measure the time from shred arrival to alert on your own server.

## An alert receiver with a silence watchdog
An alert service has a failure mode that a trading bot does not: when the feed stops, nobody notices, because no alerts look the same as a quiet market. This asyncio sketch receives on UDP port 9000, reads the slot (a little-endian u64 at offset 65, 8 bytes), hands each shred to your rules, and raises its own alert when packets stop arriving.

```python file="alerts.py"
import asyncio
import struct
import time

QUIET_AFTER = 10.0  # seconds without a packet before the feed itself raises an alert


def on_shred(slot, shred):
    """Your code: decode, run the alert rules, send step-one alerts."""


def send_alert(text):
    """Your code: post to a chat channel, a pager or a queue."""
    print(text, flush=True)


class ShredAlerts(asyncio.DatagramProtocol):
    def __init__(self):
        self.last_packet = time.monotonic()
        self.tip = 0

    def datagram_received(self, data, addr):
        self.last_packet = time.monotonic()
        if len(data) < 83:
            return  # too short for the common header
        (slot,) = struct.unpack_from("<Q", data, 65)
        self.tip = max(self.tip, slot)
        on_shred(slot, data)


async def watchdog(proto):
    silent = False
    while True:
        await asyncio.sleep(1)
        quiet = time.monotonic() - proto.last_packet > QUIET_AFTER
        if quiet and not silent:
            send_alert(f"shred feed silent, last slot {proto.tip}")
        elif silent and not quiet:
            send_alert("shred feed back")
        silent = quiet


async def main():
    loop = asyncio.get_running_loop()
    _, proto = await loop.create_datagram_endpoint(ShredAlerts, local_addr=("0.0.0.0", 9000))
    await watchdog(proto)


asyncio.run(main())
```

The watchdog alerts once when the feed goes quiet and once when it returns, so a long outage does not flood your channel. Keep `on_shred` fast: heavy decoding belongs in another process, fed through a queue, so the event loop keeps reading packets. The decoder itself is your own code or an open-source shred decoder. If the feed goes silent and you need to find out why, start with [the troubleshooting steps](https://nitride.xyz/docs/troubleshooting). For a receiver in Node.js instead of Python, see the [Node.js receiver walkthrough](https://nitride.xyz/docs/typescript).

## What can go wrong with shred-based alerts?
- **False positives.** Shreds are pre-confirmation data. A transaction can fail, and a block can be dropped by a fork or its slot skipped. Label step-one alerts as unconfirmed, every time.
- **Missed alerts.** Raw UDP loses packets without retransmission. If coding shreds cannot rebuild a lost data shred, an alert inside it never fires. For alerts that must never be missed, run the same rules on confirmed data as a backstop.
- **Alert storms.** Volatile markets produce bursts of matching transactions. Group by rule and pool, and limit how often each rule may fire.
- **Decoding is yours.** Nothing is decoded on our side, so the rule engine sits behind your own decoder.
- **Frankfurt origin.** Alerts that people read tolerate a distant server; alerts that bots act on want a server near Frankfurt.

## Where to go next
Alerts sit next to [early detection of new token launches](https://nitride.xyz/use-cases/token-launch-detection) and [copy trading from tracked wallets](https://nitride.xyz/use-cases/copy-trading). For background on what you are decoding, read [what a shred is and why it arrives early](https://nitride.xyz/blog/what-is-a-shred). The [use cases hub](https://nitride.xyz/use-cases) has the full list.

The [pricing page](https://nitride.xyz/pricing) lists both plans.

### Can shred alerts go to Telegram or Discord?

Yes, through your own code. We deliver raw shreds over UDP, and your receiver decodes them, runs the rules and calls the chat service's bot interface.

### Will an alert fire for a transaction that later fails?

It can. Shreds show a transaction before its result exists, so send a follow-up from RPC that says whether it confirmed.

### Do I need one plan per alert subscriber?

No. One destination feeds your receiver, and your service fans alerts out to as many readers as you like. Each extra receiving server is a separate purchase.

### How is delivery activated?

After paying, email support@nitride.xyz with your order reference and destination IPv4 address and UDP port. We send a test packet, you reply with the token it carries, and delivery starts.
