ALERT function spotlight

This document explains the syntax and various usage patterns of Vektor's powerful ALERT function. For a shorter summary with examples you could read our launch announcement here.

🧠
If you haven’t used VXL before, try our Quick Start Guide! You may also find it useful to first learn about VXL basics and Common Syntax Patterns, or book a call using the CALL function in the app to learn more.

Summary

Vektor's ALERT function allows you to create an alert based on any arbitrary conditional statement that you write using VXL. It's a powerful way of setting up alert notifications with unlimited flexibility, since any conditional statement you can articulate using VXL can become the trigger for your alert. Vektor continuously evalutes the trigger condition, and sends you an email notification when that trigger becomes true.

⚠️
Note: Vektor currently supports email Alerts, but we plan to add new communication channels in future (e.g. Telegram, SMS). Let us know if you have a request for an unsupported communication channel.

Function Specification

You can use ALERT (without subfunctions) or ALERT.NEW to set up a new conditional alert. Other subfunctions are used to manage the alerts you create.

Function Description
ALERT(...) Create a new alert
ALERT.LIST(...) Get a list of alerts
ALERT.GET(...) Get an alert by its id
ALERT.CANCEL(...) Cancel one or more alerts

ALERT(...) Syntax and Examples

Use ALERT to set up a new alert that will notify you when a condition is met. The only required parameter is a conditional expression; this is something that must evaluate to either TRUE or FALSE. You can optionally also provide a NAME for your alert using the NAME="text" option.

⚠️
Note: The Function Helper box pictured above should be useful in helping guide you through the syntax of Vektor functions. It appears automatically when you open the parentheses of a function.

Once created, Vektor will continue to evaluate the condition and, if and when it moves from FALSE to TRUE, will send an email notification like the below to the email associated with your user account.

An example Vektor email alert

ALERT(...) Examples

Alert me when the price of ETH falls below $1000:

You can use logical functions like AND(...) & OR(...) to make more complicated conditions:

Alert me when the price of ETH exits the range $1200-$1400:

Use the NAME option to give your alert a name. This will appear in the ALERT.LIST table and in emails.

Alert me when staked ETH (stETH) resumes a close peg with ETH, and call it "STETH RE-PEGGED":

Alert me when Tether's (USDT) price diverges from USDC:

Alert me when Ethereum's block number reaches 15 million:

Alert me when Vektor adds a new Venue or Blockchain:

Alert me when the best supply APY for ETH on any chain is higher than 5%:

Alert me when I can borrow USDT or USDC for less than 2% (but not on Fantom):

Alert me when Aave v2 is no longer the best place to supply USDC on Ethereum:

Alert me when Arbitrum is no longer the best chain to earn yield on my WBTC:

Alert me when my total sum of balances is more than $100,000:

Alert me when the USDT I bridged from Optimism to Arbitrum arrives safely:

Alert me when all my Vektor alerts have triggered!

ALERT.LIST(...) Syntax and Examples

You can use ALERT.LIST to see a list of all the alerts you created.

By default the list shows only RUNNING alerts. When the alerts are triggered, the notification will be delivered and the alert will disappear from the list. You can override this behaviour and set  INCLUDE_TRIGGERED=TRUE to include triggered/delivered alerts.

ALERT.LIST(...) Examples

Show me a list of my running alerts (with sample output).

Show me a list of my alerts, including running and delivered (with sample output).

ALERT.GET(...) Syntax and Examples

When you create an alert, it is assigned a unique 4-character alphanumeric id (e.g. 9BA5 or 7078). You can use this id to refer to the alert itself, in order to access other functionality. One example is the ALERT.GET function that can be used to extract specific information about the alert.

To see a list of alerts and their id's, you can use the ALERT.LIST function covered in the previous section.

⚠️
Note: you need to provide the id to the ALERT.GET function in quotation marks e.g. ALERT.GET("AB12")

ALERT.GET(...) Examples

Get information about a running alert (with sample output).

Get information about two different alerts at once (with sample output).

Extract the current STATE from an alert.

⚠️
Note: In the above you could alternatively use the dot accessor notation ALERT.GET("B0DC").STATE to do the same thing.

Use the state of an existing alert in a new alert!

ALERT.CANCEL(...) Syntax and Examples

To cancel an alert and remove it from the list, use the ALERT.CANCEL function.

You can cancel an individual alert by providing it's id, or you can also cancel a batch of alerts by providing a list of alert ids or a list of alert objects.

⚠️
Note: you can only cancel alerts that are in the RUNNING state. Any alerts that have been DELIVERED are already considered cancelled.

ALERT.CANCEL(...) Examples

Cancel a specific alert (with sample output)

Cancel a list of alerts, specified by a list of ids (using square brackets).

Cancel all existing alerts, by passing a list of alert objects.


Questions?

Email: [email protected]
Zoom: Use CALL function in Vektor