High level description of the alerting engine

Alerts within the Aleno Sentry API are crucial for keeping users promptly informed about critical developments in their DeFi assets. This page outlines how alerts are computed and managed within the system.

Alert Computation

Alerts are tracked per user, with each user having a set of subscriptions corresponding to specific metrics. The computation of alerts involves the following steps:

  1. Data Collection: For each metric, the system tracks all data points within a rolling 7-day window. Whenever a new data point is recorded for a metric, the system proceeds to the next step.

  2. Subscription Check: The system checks if there are any active subscriptions for the metric associated with the newly recorded data point.

  3. Variation Calculation: For each active subscription, the system finds the point with maximum absolute variation over the last 24 hours compared to the newly recorded data point.

  4. Threshold Check: If the calculated variation exceeds the user's specified threshold for the subscription, an alert is generated for that user and metric combination.

Alert Management

To prevent notification spamming and double alerting, the system employs the following approach:

  • Time Window Adjustment: Whenever an alert is sent to a user, the time window for subsequent alerts is adjusted. Initially, the system checks for variations within the last 24 hours or from the point where the user has subscribed to the metric. However, once an alert is sent, the time window is reduced from the last sent timestamp until the current time. This ensures that users are not inundated with repeated alerts for the same metric within a short period.

  • 24-Hour Threshold Reset: If the last sent timestamp is older than 24 hours, the system reverts to using the last 24 hours as the time window for threshold calculation.


Here's a detailed example demonstrating how alerts are generated for a user subscribed to the WETH/USDC exchange rate with a threshold of 5%.

Scenario: Assume the following sequence of data points for the WETH/USDC exchange rate:


  1. Data Recording: Each new data point is added to the system, updating the ongoing dataset within the sliding 24-hour window.

  1. Alert Computation:

  • Subscription Verification: The system confirms that there is an active subscription for the WETH/USDC rate.

  • Variation Calculation: For the newly recorded data point, the system calculates the maximum absolute variation from the highest or lowest point within the 24-hour window.

  • Threshold Evaluation: The variation is compared against the 5% threshold.

  • Alert Generation: A variation exceeding 5% has been detected. Consequently, an alert was issued at 19:53 on April 13th due to a data point exhibiting a variation greater than 5% compared to the maximum value recorded in the last 24 hours.

  1. Post-Alert Adjustment:

  • Window Adjustment: Following the alert at 19:53, the time window for subsequent alerts starts at this timestamp.

  • Further Alert Consideration: Continuous monitoring of new data points may trigger additional alerts. For example, a subsequent drop in the rate of 5% at 20:08 results in another alert.

Last updated