EXAMPLE 11 OF 16 · Intermediate
Filter large Pump trades before sending an alert
Combine a mint filter, trade side, quote-asset threshold, and an excluded wallet before notifying Telegram.
Before you begin#
- Choose Solana mainnet and a working RPC route in runtime settings. These examples read live data; illustrative results below will differ.
- Create and select your bot using Telegram setup, then set chatId in Globals. Keep bot tokens in the connection.
- Set mintAddress, quoteMint, minimumQuoteAmount, and watchedSide. excludedWallet can be your public wallet address, or * to exclude none.
Walk through the workflow#
- Watch trades listens for the selected mint’s bonding-curve trades.
- Code converts the displayed quote quantity to a number for the threshold comparison. It also checks the quote mint, trade side, and excluded wallet.
- If forwards only matching trades. Telegram reports the observed trade, including its signature; this graph places no order.
- Try a threshold above and below an observed amount to understand why a trade passes or fails.
Check the rule with sample values#
For a threshold of 10 quote tokens, a matching buy of 12 passes. A buy of 8, a sell of 12, a trade in another quote asset, or a trade by excludedWallet fails. These numbers explain the condition; choose your own threshold.
Why the quote mint matters#
An amount of 10 in one asset is not comparable to 10 in another. The filter checks identity before sending the result. Raw on-chain quantities stay strings; Number is used only for the display-amount threshold.
Extend the workflow#
The reviewed trade example shows how to use an observed mint and signature in a separate one-run order. A PumpSwap pool needs its own watcher after graduation; this listener covers the bonding curve.
If it does not match#
Inspect Code’s matches value and the original event. Set Timeout to 0 only after your filter works. Notifications can be repeated if a source redelivers an event; this example does not claim exactly-once delivery.