On-chain monitoring in real-time seems simple until you face WebSocket disconnections, log duplication, and notification spam. Many developers spend hours debugging pipelines, and a critical event can be missed due to improper reconnection handling. We build alert systems that solve these problems at the architecture level: queues with Redis Streams, deduplication by (txHash, logIndex), delivery mechanisms with SLA guarantee of 99.9%. With over 5 years in Web3, 100+ custom alert implementations for DeFi protocols, NFT marketplaces, and analytics platforms, we are ready to evaluate your project and offer an optimal configuration that saves you time and resources. Our crypto alert system is trusted by over 100 clients. Clients save an average of $50,000 per year by avoiding missed liquidations.
Types of Tracked Events
- Contract events (logs) — the most common: Transfer, Swap, Deposit, Liquidation, Mint. Decoded via ABI from raw topics + data.
- Large transactions — transfers above a threshold in USD. Requires conversion via price feed (Chainlink, CoinGecko API) at the time of the event.
- Address activity — any transaction to/from a tracked address (whale watching, portfolio tracking).
- MEV events — sandwich attacks, arbitrage, flash loans. Detected via pattern analysis within a single block.
- Protocol health — health factor on Aave/Compound below threshold, utilization rate above 90%, TVL drop greater than X%.
- NFT events — mint, sale, transfer of specific collections.
System Architecture
Ingestion Layer
Two options for fetching events:
- WebSocket subscriptions — minimal latency (< 1 sec from block). Issue: on reconnection, blocks can be missed. We use a catch-up mechanism: on startup, process missed blocks, then subscribe to new ones via
watchBlockNumber. - Polling — every N seconds call
eth_getLogsfor recent blocks. Less efficient but more reliable. For SLA-bound systems, we use a combination: WebSocket for speed, polling as fallback.
Event Processing Pipeline
[WS / Polling] → [Raw Event Queue] → [Decoder] → [Enricher] → [Rule Engine] → [Alert Queue] → [Delivery] - Decoder — ABI-decoding raw logs. For unknown contracts, attempts to find ABI via Etherscan API or 4byte.directory.
- Enricher — data enrichment: USD value via price feed, labels (exchange? whale? known protocol?), entity resolution (multiple addresses of the same entity).
- Rule Engine — checks alert conditions against the enriched event.
Rule Engine
A flexible, code-free rule configuration system is a key component:
Example configuration for a Whale Alert rule
{ "name": "Large ETH Transfer", "chains": ["ethereum"], "event_signatures": ["0xddf252ad..."], "conditions": [ { "field": "value_usd", "operator": "gt", "value": 1000000 }, { "field": "token_symbol", "operator": "eq", "value": "ETH" } ], "condition_logic": "AND", "channels": ["telegram_main", "webhook_trading_desk"], "cooldown_seconds": 60 } How the On-Chain Alert System Works
- Ingestion: events are fetched via WebSocket or polling.
- Decoding: raw logs are transformed into understandable structures.
- Enrichment: price, labels, and entities are added.
- Rule evaluation: each event is matched against configured conditions.
- Deduplication: duplicates are excluded (by txHash + logIndex).
- Delivery: notification is sent to the designated channels.
Why Deduplication is Critical
With multiple nodes or during catch-up, a single event may arrive multiple times. Deduplication by (transaction_hash, log_index) in Redis:
async function processEvent(event: DecodedEvent): Promise<boolean> { const key = `processed:${event.txHash}:${event.logIndex}`; const isNew = await redis.set(key, '1', 'EX', 86400, 'NX'); return isNew !== null; } According to Redis documentation, the SET command with the NX option guarantees atomic check. This prevents reprocessing even with parallel workers.
How to Ensure Reliable Delivery?
- Telegram bot alerts are delivered via Bot API with MarkdownV2 formatting and rate limit management (30 messages/sec per bot, 1 message/sec per chat). High-frequency events require batching or aggregation.
- Webhook notifications — HTTP POST to a custom endpoint with retry and exponential backoff.
- Email — for low-frequency important events via SendGrid/AWS SES.
- Discord — via webhook or Bot API.
- PagerDuty — for critical events requiring immediate response.
Anti-Spam and Aggregation
Issue: during a flash crash or major event, hundreds of alerts can be generated per minute. Solutions:
- Cooldown per rule — do not send a repeat alert for the same rule for N seconds.
- Digest mode — aggregate events over 5–60 minutes and send a summary.
- Threshold batching — "47 liquidations on Aave in the last 10 minutes, total $2.3M".
| Channel | Latency | Reliability | Rate Limit | Best For |
|---|---|---|---|---|
| Telegram | < 1 s | Medium | 30/s per bot, 1/s per chat | Mass alerts |
| Webhook | < 100 ms | High (retry) | Depends on endpoint | Bot integration |
| 1-5 min | High | SMTP limits | Low frequency | |
| Discord | < 1 s | Medium | 5/s per webhook | Team chats |
| PagerDuty | < 30 s | Very high | Paid subscription | Critical incidents |
Deliverables
- Architectural documentation and pipeline diagram.
- Source code with comments, deployment configs.
- Rule Engine with a set of preset rules tailored to your use case.
- Access to Telegram bot, webhook endpoints.
- System monitoring (Prometheus + Grafana), dashboards.
- Team training, documentation on adding rules.
- One month warranty support after delivery.
System Monitoring
An alert system must monitor itself:
- Block lag — distance from the chain head. Alert if > 10 blocks.
- Processing queue depth — queue growth indicates a bottleneck.
- Delivery failures — failed send attempts per channel.
- Rule match rate — anomalous growth may mean a rule is too broad.
# Prometheus metrics alert_system_block_lag_gauge alert_system_queue_depth_gauge alert_system_delivery_total{channel, status} alert_system_rule_matches_total{rule_id} Stack and Estimated Timelines
| Component | Technology |
|---|---|
| Ingestion | TypeScript + viem / ethers.js |
| Queue | Redis Streams / BullMQ |
| Enrichment | Chainlink price feeds, Etherscan Labels API |
| Rule Engine | JSON-configurable, stored in PostgreSQL |
| Delivery | Telegram Bot, webhooks, Discord |
| Monitoring | Prometheus + Grafana |
- Basic system (5–10 event types, Telegram + webhook, single network): 2–3 weeks.
- Multi-chain, complex composite rules, custom UI for alert management: 4–6 weeks.
A missed event can cost thousands of dollars if it's a position liquidation or a fraudulent transaction. Investing in a quality alert system (starting from $5,000 for a basic setup) can prevent losses of over $100,000 in severe cases. Our WebSocket + caching based system processes events 10 times faster than polling-only solutions with the same reliability. Throughput up to 10,000 events per second, latency under 500 ms, deduplication reduces alerts by 30-50%. With over 5 years of experience and 100+ delivered projects, our clients achieve a 90% reduction in missed critical events.
Contact us to get a project evaluation and commercial proposal. Request a consultation on on-chain monitoring architecture—we'll help you choose the optimal solution and discuss implementation details.







