Enter Dispatch: a game-changer for monitoring on-chain activity without any coding. Dispatch seamlessly connects with Discord, allowing you to get automated, real-time on-chain activity updates directly in your server or DMs. Whether you're interested in tracking token movements, keeping an eye on liquidity changes, or want to create a self-updating channel with the latest updates on your project's activity, Dispatch makes it easy.
In this guide, we'll walk you through setting up DeFi alerts in your Discord channel using Dispatch. We'll be using Velodrome Finance's Router smart contract on the Optimism network. By the end of this guide, you'll have created a real-time data feed for this DeFi protocol—a skill you can apply to any blockchain project you're interested in. It's like having a personal Web3 assistant delivering on-chain updates directly to your Discord, keeping you informed about critical activities as they happen.
Before we get started, make sure you have the following:
In this guide, we'll walk you through these steps:
By the end of this guide, you'll have created a Discord bot that provides real-time updates on key activities in Velodrome Finance's ecosystem. For this demo, we’ll be setting up a data stream for one of Velodrome’s smart contracts on the Optimism network, but as mentioned previously, you can use Dispatch to create data streams for any smart contract on a variety of EVM networks, including Arbitrum, Base, Ethereum, and Polygon.
Watch our step-by-step video guide below to get started, or continue reading for detailed instructions:
If you already have a channel where you'd like to receive DeFi alerts, you can skip ahead to the next section. If not, here's how to create a new channel:
1. Open your Discord server
2. In the left sidebar, locate the "+" icon next to "TEXT CHANNELS"
3. Click the "+" icon to create a new channel
4. Name your channel something descriptive like "defi-alerts" or "velodrome-tracking"
5. Click "Create Channel" to finish
Creating a Discord channel
Note: If you encounter any issues with channel creation or permissions, check out Discord troubleshooting guide for detailed help.
Now that you have a dedicated channel for your DeFi alerts, let's create a data stream (Patch) in Dispatch to monitor Velodrome Finance and send alerts to your Discord server. Before we begin, make sure you’re logged into your Dispatch account.
Like other DEXs, Velodrome uses many smart contracts to handle different pieces of logic and data. For this example, we’ll be setting up a data stream for the Router smart contract so that we can get insights into swaps and liquidity changes.
Let’s tell Dispatch which contract to monitor on the Optimism network:
Contract nicknames are useful when you’re creating data streams for multiple contracts from the same project, and if you’ll be using that contract for other data streams later. You can change the contract’s nickname after you create the Patch, so don’t worry about it too much.
Choose the specific events or functions you want to track. For Velodrome Finance, consider monitoring functions such as:
On the Action details step:
Finalize your Patch setup:
What if your Discord test fails?
If you get an error when testing whether Dispatch can send to your Discord destination, make sure you have the correct permissions in the server, and that the channel you’ve selected allows bots to post. Get more troubleshooting help here.
Now that your Patch is active, you'll start receiving real-time alerts in your Discord channel whenever specific events occur on the Velodrome Finance Router contract. Anytime liquidity is added or removed, or when swaps are executed, you'll see a new message in your designated Discord channel with the details you've selected.
Here's an example of what your alerts might look like:
Example Dispatch alerts in Discord
This setup is just the beginning of what you can do with Dispatch. Beyond monitoring DeFi activity, you can use Dispatch to track a wide range of on-chain events across various protocols and chains. Whether you're interested in monitoring governance proposals, transfers, or specific user interactions, Dispatch can help you stay informed in real-time.
If you liked this tutorial and want to try other automations, sign up for a free Dispatch account.