How to Build a Whale Alerts System with Sub-Second Latency
A $50 million transaction went through the network — the user learned about it 40 minutes later, after the market had already reacted. Such a delay renders the tracker useless. We solve this problem: we build notification architecture with sub-second latency so that the user receives the signal before competitors. The issue is compounded by the uneven arrival of blockchain data: during periods of high activity (e.g., major Bitcoin movements), channel load increases. Without delivery optimization, notifications may be lost or delayed. Our approach relies on direct connections to WebSocket streams from leading exchanges and blockchain explorers, bypassing intermediary servers.
Handling Large Transactions in a Mobile Whale Alerts App
Get the same solution for your project. Contact us for an estimate. The architecture consists of three components: a server worker, a delivery channel, and client logic. The worker subscribes to data streams; upon detecting a transaction above a threshold (e.g., >500 BTC or >$1M), it sends a payload via FCM (Android) and APNs (iOS). The client receives the notification in the background and displays it.
Data Sources and Challenges
Most teams start with the public Whale Alert API (api.whale-alert.io) or alternatives like Glassnode, Nansen, CryptoQuant. The problem isn't getting the data — it's delivering it to the device before the competition does.
The classic scheme: mobile client polling every 30 seconds. This drains the battery, overloads the server, and still incurs 15–30 seconds of latency. On Android, it also conflicts with Doze Mode — WorkManager defers tasks when the screen is off.
| Approach |
Average Latency |
Battery Load |
Background Reliability |
| Polling (30s) |
15–30s |
High |
Low (Doze) |
| WebSocket + push |
< 1s |
Low |
High (time-sensitive) |
A working scheme looks different:
- A server worker subscribes to a WebSocket stream (
wss://stream.binance.com, wss://ws.blockchain.info/inv) or polls every 5–10 seconds.
- Upon detecting a transaction above a threshold (e.g., >500 BTC or >$1M), the worker forms a payload and sends it via FCM (Android) and APNs (iOS) simultaneously.
- The client receives the notification in the background and displays it via
UNUserNotificationCenter (iOS) or NotificationCompat.Builder (Android).
On iOS, it's important to set apns-priority: 10 for urgent notifications — otherwise APNs may buffer delivery until the next device wake-up. This requires the entitlement com.apple.developer.usernotifications.time-sensitive. This flag guarantees immediate delivery. Statistics show that 95% of such notifications are delivered in under one second, with server-side uptime reaching 99.9%.
Ensuring Real-Time Notification Delivery
The key element is a direct channel without proxies. For iOS, we use APNs directly over HTTP/2 (library node-apn or @parse/node-apn) — this is faster than going through the FCM proxy. The latency difference is small, but under high load (>10K devices), direct APNs is more stable.
Server stack: Node.js worker + Redis Pub/Sub for distributing tasks across multiple instances + Firebase Admin SDK for sending.
The notification payload contains minimal data — only what's needed for display and deep linking:
{
"title": "🐋 BTC: 1,200 BTC → Binance",
"body": "$72.4M · 2 minutes ago",
"data": {
"tx_hash": "a1b2c3...",
"chain": "bitcoin",
"amount_usd": 72400000
}
}
The deep link opens the transaction detail screen via Universal Links (iOS) or App Links (Android).
Client-Side Filtering Is Critical
Users don't want notifications about every $500K transaction — they set thresholds. Typical filter set:
| Filter Type |
Description |
Example |
| Amount threshold |
Minimum amount in USD or native coin |
>$1M |
| Direction |
Incoming/outgoing/peer-to-peer |
Only incoming to Binance |
| Network |
Select blockchain |
BTC, ETH, SOL |
| Watchlist |
Monitor specific addresses |
Addresses of major holders |
These settings are stored on the server and tied to an FCM topic or individual token. The first option is simpler for broadcasting, the second is more flexible for personalization. In practice, we use a hybrid scheme: topics for general threshold events (whale_btc_1m) and individual tokens for watchlist addresses.
On the app side, filters are implemented via UNNotificationServiceExtension (iOS) — the extension intercepts the notification before display and can reject or modify it based on local settings. On Android, similarly via FirebaseMessagingService.onMessageReceived() with manual call or skip of NotificationManager.
Delivery Monitoring
Firebase Console only shows basic statistics. For production, it's important to track:
-
Delivery rate — percentage of successfully delivered notifications (FCM Analytics)
-
Time-to-deliver — time from event detection to device receipt
-
Open rate — how many users tapped
For time-to-deliver, we use our own metric: the server writes a send timestamp in the payload, the client logs the receive timestamp and sends the delta to analytics (Mixpanel or custom ClickHouse).
What's Included
When ordering, you get:
- Architectural documentation (interaction diagram, stack selection)
- Integration with data sources (API coordination)
- Push notification setup (FCM + APNs)
- Client side (iOS/Android) with filtering and deep linking
- Monitoring and alerting
- Access to source code and repository
- Deployment and maintenance instructions
With over 5 years of experience in blockchain mobile development and 30+ successful projects, we guarantee robust architecture. Our clients save up to $10,000 per month in server costs by switching from polling to WebSocket-based push. Implementation starts from $5,000 for a basic integration.
Work Stages
- Audit of data sources — API selection, latency and stream reliability assessment
- Server worker architecture — polling/WebSocket, deduplication, rate limiting
- FCM + APNs setup, obtaining certificates/keys
- Client side implementation — permission requests, token handling, deep linking
- User filter system — settings UI, server synchronization
- Testing on real devices (Doze Mode, Background App Refresh)
- Monitoring and alerting
Our team of 10+ engineers specializes in real-time notification systems. Timeline: from 2 weeks for basic integration (ready backend + one data stream) to 5–6 weeks for a ground-up build with custom filters and 5+ blockchain support. Schedule a consultation — we'll assess your project and propose the optimal solution.
Source: Binance WebSocket documentation
Push Notifications in Mobile App: APNs, FCM, Segmentation, Rich Push
We have implemented push notifications in mobile apps for 50+ projects — from startups to enterprise with audiences of 10M+ users. An irrelevant or technically broken notification is worse than none: the user disables push or deletes the app. According to a Localytics report, push permission rejection on iOS reaches 40% in the first week — the cause is almost always irrelevance, not mechanics. Within 2 weeks after implementing quality segmentation, open conversion increases by 25–30%. Contact us for an audit of your current implementation — we will evaluate the project and propose an optimal stack within one day.
How the Infrastructure Works: APNs and FCM
APNs is the only delivery channel on iOS. Everything else (OneSignal, Braze, Airship) is a wrapper on top of it. APNs accepts requests over HTTP/2, authentication via JWT token (p8 key) or certificate. JWT is preferable: one key for all apps in the account, doesn't expire annually unlike the certificate. For more details, see the official documentation.
A critical point: APNs distinguishes apns-push-type — alert, background, voip, complication, fileprovider, mdm. An incorrect type on iOS 13+ causes background notifications not to wake the app. We've seen projects where content-available: 1 was sent without apns-push-type: background — the app didn't receive silent push on some devices, and the team spent a month looking for an 'app bug'.
FCM on Android works through Google Play Services. For devices without GMS (Huawei, part of the Chinese market), Huawei Push Kit or a direct WebSocket is needed — a separate task. FCM supports data messages (handled in onMessageReceived) and notification messages (the system displays automatically if the app is in the background). Mixing them requires caution: if the notification block has a click_action but the deep link is not registered in the app, tapping the notification simply opens the main screen without navigation.
| Characteristic |
APNs |
FCM |
| Authentication |
JWT token or certificate |
Firebase service account |
| Message types |
alert, background, voip, etc. |
notification, data |
| Silent push |
content-available + apns-push-type: background |
data message with priority high |
| Payload limits |
4 KB |
4 KB (upper), up to 2 KB for notification |
| Works without Google Play |
N/A (iOS only) |
No, requires alternative provider |
Why Segmentation Is the Foundation of Effective Push Notifications?
Sending to everyone indiscriminately quickly exhausts user loyalty. Personalized messages are clicked 3 times more often than bulk ones, and proper segmentation reduces churn by 25% (on one project it brought significant additional revenue per quarter). The cost of setting up segmentation in OneSignal or a custom backend depends on the complexity of filters.
Proper segmentation is built on several levels.
| Segmentation Type |
Tool |
Example |
| By topics |
FCM topics / APNs push-to-topic |
Order status notifications |
| By attributes |
OneSignal, Braze |
last_active < 7_days + plan = premium |
| Personalized |
Custom backend |
By device_token linked to profile |
Topics are for broad categories: 'new promotions', 'order status updates'. User subscribes via FirebaseMessaging.getInstance().subscribeToTopic("orders"). Simple, but no flexible filtering.
Attribute-based segments — via OneSignal, Braze, or custom backend. We store in the user profile: language, device type, last activity, LTV segment. Notification goes only to those with last_active < 7_days and plan = premium. OneSignal allows building such filters in the interface without code.
Personalized — by specific device_token. It's important to store tokens correctly: the token updates on app reinstall, restoration from backup on a new phone, or resetting settings. On iOS, use UNUserNotificationCenter + didRegisterForRemoteNotificationsWithDeviceToken, save to backend on every launch, not just the first. Otherwise, after 3 months 30% of tokens in the database are outdated.
What Is Rich Push and How Does It Boost Conversion?
A standard notification with title and text is clicked less often than a rich push with image and action buttons — by 3 times. But implementing rich push is a separate task on each platform.
On iOS, rich content requires UNNotificationServiceExtension (to modify payload) and UNNotificationContentExtension (custom UI). The extension runs in a separate process with limited time and memory. If the extension crashes or exceeds the timeout, the system shows the original payload without media. A typical mistake is trying to load an image over HTTP (not HTTPS): ATS blocks the request, the extension silently fails, and the user sees a notification without an image.
On Android with API 26+, notifications are tied to NotificationChannel. If the channel is created with IMPORTANCE_LOW, sound and vibration are unavailable. Different notification types (transactional, marketing) should be in different channels so the user can disable marketing without losing order notifications. BigPictureStyle, MessagingStyle, InboxStyle are templates for expanded notifications. MessagingStyle with Person and avatars is the best choice for chats.
| Platform |
Component |
Details |
| iOS |
UNNotificationServiceExtension |
Runtime ~30 s, memory ~50 MB, HTTPS required |
| iOS |
UNNotificationContentExtension |
Custom UI, action buttons |
| Android |
NotificationChannel |
Importance level, sound, vibration — user-configurable |
| Android |
BigPictureStyle / MessagingStyle |
Expanded content, message grouping |
How to Track Delivery and Conversion of Push Notifications?
Sending a notification is half the work. It's important to know: was it delivered, opened, and did it lead to a target action.
FCM returns a MessageId on send, but does not guarantee a delivery callback — by design. For open tracking, custom logic is needed: on notification tap in onMessageReceived or via getInitialNotification() / onNotificationOpenedApp (OneSignal SDK), send an event to analytics with notification_id.
OneSignal provides built-in delivery and CTR analytics. For more detailed analysis — integrate with Amplitude or Mixpanel via webhook on open events. The budget for such a dashboard varies depending on event volume.
How We Implement Push Notifications: Typical Process
-
Audit current implementation — check token storage, update handling, notification types.
-
Design architecture — choose transport (FCM + APNs), segmentation layer (OneSignal/Braze/custom), personalization method.
-
Implementation — write registration code, inbound handling, rich push, deep linking.
-
Testing — send test campaigns, verify delivery on different devices, simulators, regions.
-
Monitoring and analytics — set up dashboard, open and conversion events.
-
Documentation and training — hand over operational materials to the team.
Typical stack: FCM + APNs at transport level, OneSignal or Firebase Notifications Composer for segmentation, custom backend for personalized event-based notifications. For large apps with >1M users, OneSignal has pricing limits — then we use Braze or a custom implementation on AWS SNS.
Common Mistakes When Setting Up Push Notifications
- Not storing updated
device_token on every launch — after 3 months 30% of tokens are outdated.
- Confusing
apns-push-type — background notifications don't wake the app.
- Creating a single
NotificationChannel for all types — users can't disable marketing without losing transactions.
- Loading media in rich push over HTTP — ATS blocks the request on iOS.
- Not testing deep link targeting — taps go to the main screen.
Timelines depend on complexity: basic FCM+APNs integration with transactional notifications — 1–2 weeks. A full system with segmentation, rich push, analytics, and A/B testing — 4–8 weeks. Order an audit of your current push infrastructure or get a consultation on implementing push notifications in your mobile app — we will contact you within a day and provide an accurate estimate.