5 min read
As a developer building on the blockchain, you'll often find yourself needing to track certain activities, such as when a certain address transfers funds or when an NFT gets sold on a marketplace. Until now, there hasn't been a streamlined and simple way to do this. QuickNode's new QuickAlerts tool enables developers to do this in the most simple, straightforward way.
In this guide, we'll dive into how to get started with QuickAlerts and how they work.
QuickAlerts is available to all customers as of Feb 7, 2023. If you have any feedback regarding QuickAlerts, we'd love to hear from you. Kindly fill out this form with your comments.
What is QuickAlerts?
QuickAlerts is a new developer experience that allows you to create custom expressions and receive real-time notifications for a variety of activities. These can include:
- Monitoring wallets, contracts, NFTs, tokens, transactions, blocks, validators, and more.
- When a specific wallet sends and/or receives a transaction
- When a specific wallet sends/receives a transaction to/from another specific wallet
- When a new NFT is minted
- When a specific NFT is transferred
- When a specific event happens on a specific smart contract
- When a specific event happens on any smart contract
- When a block contains more/less than X # of transactions
- Any transactions that fail
- Complex examples like: Whenever the fees burned in a block are > .2 ETH AND there is at least one Uniswap transaction within the block
When a QuickAlert is triggered, a user can receive notification payloads delivered to one or more destinations in real-time. During beta, only Webhook notifications are supported. However, QuickAlerts will eventually support notifications on Slack, Telegram, Discord, SMS, email, and more.
Next, let's cover how QuickAlerts work.
How Do QuickAlerts Work?
QuickAlerts are built off of Expressions which can be simple or complex logic. Expressions can target blockchain fields relating to block, transactions, and logs or a combination of fields such as (block_gasUsed > 1294498 && tx_value >= 1000). It is also possible to detect activities that do not generate logs. To do this, a user would inspect the input data on a transaction (learn more in this guide). Furthermore, users can test their expressions on a specific block or backtest on a historical set of blocks.
Next, let's demonstrate how to set up an alert using QuickAlerts.
How to Set up QuickAlerts
To interact with QuickAlerts, you'll need a QuickNode account. If you don't have one yet, you can create one for free at this link.
Once signed in, navigate to the QuickAlerts page and click the Create Alert button.
On the Select Template tab, name your alert and select the chain and network you want the alert for. At this time, QuickAlerts supports the following chains:
- Avalanche C-Chain (Mainnet)
- BNB Smart Chain (Mainnet)
- Celo (Mainnet)
- Ethereum (Mainnet)
- Ethereum (Goerli)
- Ethereum (Sepolia)
- Optimism (Mainnet)
- Arbitrum (Mainnet)
- Arbitrum Nova (Mainnet)
- Fantom (Mainnet)
- Polygon (Mainnet)
- Gnosis (Mainnet)
- Scroll (Mainnet)
- Scroll (Testnet)
- zkSync Era (Mainnet)
- zkSync Era (Testnet)
(Solana, along with additional networks, are planned!)
Then, choose a template. QuickAlerts have a set of hand-crafted templates for a variety of use cases such as Any NFT is Minted, Monitor Smart Contract Events, Failed Transactions and more. You can also create a blank template and create your own expression from scratch.
On the Create Expression tab, you can use the Legend to see which blockchain fields you want to create expressions for. In the screenshot above, we're looking for transactions within a block that have a To recipient value of 0xE592427A0AEce92De3Edee1F18E0157C05861564:
You can click the Test Expression button to verify if your expression is syntactically correct. Additionally, you can target data within a specific block using the Block Expression tab or backtest your expression against historical data using the Test Expressions tab. Once your expression is verified, you can click Next to choose a destination.
Then, on the Create Destination tab, you can choose your destination. If you are using a WebHook, select a name, input the URL and request type (i.e., GET, POST). Lastly, you'd click Create Webhook.
How to Manage QuickAlerts
Once you have some QuickAlerts expressions created, you can easily view and manage alerts on the QuickAlerts dashboard. The dashboard displays a list of your alerts, including each alert's name, the network the alert is for, its destination, active status and last delivery. To edit an alert, click the arrow next to the specific alert.
When you click on a specific alert, you'll be able to manage the alert, see the expression being evaluated, the destinations, and see how many times the alert has been triggered.
Next, let's cover some example use cases for QuickAlerts.
Additional Expression Examples
Now that you're familiar with QuickAlerts, you're ready to create alerts for on-chain data at ease. You can use your imagination to create a wide variety of programable alerts. Here are some additional expression examples you can use QuickAlerts for:
Alert for all transfer activity on an address
(tx_from == '0x0..myAddress' || tx_to == '0x0..myAddress')
Send an Alert for activity happening between addresses
(tx_from == '0x0..walletA' && tx_to == '0x0..walletB')
Send an Alert When Any New NFT is Minted
//Topic haes we are targeting:
(tx_from == '0xead5d1ec4f7a647de61a7a0225eec7387a25be01' && tx_logs_topic0 == '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef') && (tx_logs_topic1 == '0x0000000000000000000000000000000000000000000000000000000000000000') && (tx_logs_topic3_int > 0 )
This alert specifically targets the Transfer event coming from a null address on an ERC-721 address with a token ID greater than zero.
- Q: Which chains are supported?
- A: Ethereum mainnet, Polygon mainnet, BNB Smart Chain, Avalanche C-Chain, and Fantom (expect this list to grow)
- Q: What notification types are supported?
- A: Webhooks (expect this list to grow)
- Q: Can you use QuickAlerts for Chainlink?
- A: Yes! QuickAlerts can target certain Chainlink data feeds. Check out this guide to learn more.
- Q: How can I learn more?
- A: Check out our technical guide on QuickAlerts Expressions
Nice work! You should now have a better understanding of QuickAlerts and how to use them. We'd love to see what you're creating! Share your ideas with us on Discord or Twitter. If you have any feedback or questions on this guide, we'd love to hear from you!
To learn more, check out some of our other QuickNode tools here, and if you've had fun with QuickAlerts, consider subscribing to our newsletter. To learn more about QuickAlerts, check out this guide on QuickAlerts Expressions.