Sub topic 11
Building Threshold-Based Whale Alerts
Assume you understand wallet addresses, transactions, exchange labels, and basic Python. This chapter focuses on turning labeled blockchain data into alerts. It does not prove that an address belongs to a person or that a transfer predicts a price move.
What a whale alert measures
A whale alert is a rule that reports an unusually large transfer or balance change. A threshold is the boundary that triggers the rule. For example:
- Alert when a wallet sends at least 1,000 ETH.
- Alert when an exchange receives at least $5 million in one day.
- Alert when a labeled holder's balance changes by more than 2% in 24 hours.
The threshold can use token units, fiat value, or a percentage. Each choice has weaknesses. A fixed token threshold becomes less meaningful when the asset price changes. A fiat threshold requires a reliable price at the transfer time. A percentage threshold can overemphasize small wallets.
A useful alert record includes the event time, asset, amount, sender, recipient, labels, transaction ID, and rule that fired.
A basic threshold rule
Start with normalized transfer records. Normalization means putting data from different sources into one consistent shape.
def whale_alerts(transfers, amount_threshold, watched_labels):
"""Return transfers that cross a threshold involving watched entities."""
alerts = []
for transfer in transfers:
amount = transfer["amount"]
sender = transfer.get("from_label")
recipient = transfer.get("to_label")
if amount < amount_threshold:
continue
if sender in watched_labels or recipient in watched_labels:
direction = "outflow" if sender in watched_labels else "inflow"
alerts.append({
"txid": transfer["txid"],
"asset": transfer["asset"],
"amount": amount,
"direction": direction,
"entity": sender if direction == "outflow" else recipient,
})
return alerts
transfers = [
{
"txid": "0xabc",
"asset": "ETH",
"amount": 1500,
"from_label": "LargeHolder-1",
"to_label": "ExchangeA",
},
{
"txid": "0xdef",
"asset": "ETH",
"amount": 20,
"from_label": "Wallet-2",
"to_label": "ExchangeA",
},
]
print(whale_alerts(transfers, 1000, {"LargeHolder-1", "ExchangeA"}))This rule treats a large transfer involving a watched label as noteworthy. It does not count transfers between two addresses controlled by the same entity as meaningful external movement. That requires entity-level grouping before alerting.
Preventing noisy alerts
A single transaction can create duplicate notifications. For example, a token transfer may appear in both a node feed and an analytics API. Deduplicate by transaction ID, log index, and chain. A transaction ID alone may be insufficient when one transaction contains several token transfers.
Use a cooldown when repeated events are expected. A cooldown suppresses alerts for the same entity and rule for a short period. Another option is aggregation: combine transfers from one entity during a five-minute or one-hour window, then compare the total with the threshold.
Choose thresholds from historical data rather than guessing. Review how many alerts the rule would have produced in normal and volatile periods. A rule that fires hundreds of times per hour is a feed, not an alert.
Alert pipeline
Reviewing an alert
Check the transaction in an explorer or node before interpreting it. Confirm the asset, amount, block time, and recipient. Compare the address labels from more than one source when possible. Look for related transactions that show whether the movement was split, reversed, or part of a larger wallet reorganization.
A useful alert message states the rule and uncertainty: “ExchangeA received 1,500 ETH from LargeHolder-1; label confidence medium; internal-transfer check passed.” This wording separates measured facts from interpretation.
Exercise
An exchange receives ten transfers of 200 ETH from the same labeled holder within ten minutes. Should a 1,000 ETH single-transfer rule alert?
Show answer
Not necessarily. The individual transfers do not cross the rule. Add a time-window aggregation rule if the combined 2,000 ETH movement matters.