If you're active in DeFi, you know the struggle of keeping up with cross-chain activity. Jumping between different block explorers, constantly refreshing dashboards, and trying to track swaps across multiple chains — it's a lot to handle. And if you're running a project or managing a treasury, missing an important transaction, contract event, or admin change can be a real headache.
That's why we're excited to show you how to level up your cross-chain monitoring game using Dispatch. If you're already hanging out in Discord, you've probably seen various bots tracking on-chain events. But when it comes to monitoring complex cross-chain activities like swaps, liquidity changes, and contract events, most solutions either cost a fortune or require you to write code.
In this guide, we'll show you how to set up a complete monitoring system for XY Finance, one of the most popular cross-chain aggregators. Whether you want to track swaps as they happen, visualize activity patterns, or get notified about important protocol changes, you can do it all without writing a single query.
In this guide, we'll walk you through these steps:
By the end of this guide, you'll have set up a reliable monitoring system for XY Finance's cross-chain activities. While we're using XY Finance’s yBridge contract as an example, you can apply these same steps to monitor any smart contract on Ethereum, Base, Polygon, or Optimism.
While Dispatch can send real-time Discord or Telegram alerts, emails, and data via webhook, it can also be used to keep historical logs, and visualize trend data over time.
TLDR: If you are more interested in keeping logs and visualizing the data rather than real-time alerts, choose Dispatch Monitor as the Action, or output channel.
Dispatch Monitor is ideal when you want to track patterns and trends over time without getting alerts — activity such as swaps and transfers, which can happen frequently. If you’re tracking cross-chain swaps, you probably don’t need an alert for every single one. Instead, you’ll want to get a sense of overall trends: daily/weekly volumes and top interacting addresses. Choosing Dispatch Monitor means you can see a log of all activity from the contracts and wallets you’re tracking, and — all in Dispatch.
On the flip side, Discord alerts are more ideal for things that might need immediate attention, like unexpected fee changes or contract ownership changes. These real-time alerts help you jump in quickly when something needs action, whether it’s a sudden issue or an admin change. Discord alerts might also work well for a channel created solely to be an activity feed for your community.
Before we get started, make sure you have the following:
While Dispatch can send alerts to your DMs, we recommend setting up dedicated channels in your server, especially if you’re watching lots of different activities in a super active contract. This keeps things organized, ensures easy access for your team or community, and makes tracking different contract activity effortless.
Watch our step-by-step video guide below to get started, or continue reading for detailed instructions:
Before going any further, it’s worth spending a little time thinking through what activity will be most useful to track, and how you want to organize different data streams. For a DeFi aggregator like XY Finance, we know that we want to track
We’ll be using Dispatch to create data streams that post in Discord any time those events are emitted or functions are called. For a super active contract, that might mean a steady flow of all kinds of activity, which can quickly get overwhelming. To make it easier for us to zero in on certain types of activity, we’re going to create a few different channels to keep the data organized.
Here's how to set up your Discord channels:
For this guide, we suggest creating these channels:
Consider adding clear Discord channel topic descriptions to help your team understand what each channel captures. This will ensure everyone knows what type of activity each channel is monitoring and help keep your Discord organized.
Sample Discord server setup: Create different channels for different types of activity
This channel structure helps keep your alerts organized and makes it easier to track specific activities. Don't worry though, you can always modify this setup later based on what works best for you.
Once you have your topic-focused Discord channels set up, you’ll be setting up a Patch to send data to each channel. Think of it as a 1:1 relationship between your Patches and Discord channels: one Patch to send data to each channel.
Now that we have our Discord channels ready, let's create our first data stream (what we call a Patch) in Dispatch to monitor XY Finance and send alerts to your Discord server. We’re going to create one data stream (Patch) for each type of activity, to match the three Discord channels we planned above. Our first Patch will send swap activity to the #xy-swaps channel.
First, make sure you're logged into your Dispatch account.
Don't have an account yet? Sign up for free.
Dispatch dashboard: Select Trigger and Action
This takes us to the Patch Builder, where we’ll tell Dispatch what activity we want sent to Discord.
Like many DeFi protocols, XY Finance uses multiple smart contracts to handle different operations. For this example, we're using their main contract that handles cross-chain swaps and important protocol events.
Let's tell Dispatch which contract to monitor:
Add a smart contract in Dispatch’s Patch Builder
Next, let's choose which events and functions to track. Let's break down some key activities you might want to keep an eye on. Since we want to keep our Discord channels organized, we’ve organized the key events into different data streams, one for each Discord channel:
Patch | Events | Functions | Discord Channel |
---|---|---|---|
Swaps |
|
|
#xy-swaps |
Fees |
|
|
#xy-fees |
Admin |
|
|
#xy-admin |
List of selected smart contract events and function
We recommend starting with the core swap events and gradually adding more based on what's most important for your monitoring needs.
Once you've selected the events and functions you want streamed to Discord, click "Continue" to set up your Discord notifications.
Now that we've selected our events and functions, let's choose the Discord server and channel we want those activities streamed to.
Since we selected “Discord” initially from the Dashboard, we can skip Step 3 (Action type) and move on to Step 4, “Action details”.
You'll need to authorize Dispatch to send messages to your server; in the Destination dropdown, select the “Click here to add a Discord server” option and follow the prompts.
If you encounter any issues during the connection process, check out our troubleshooting guide for help.
Configuring action details in Dispatch Patch Builder
Before we turn the Patch on, let's make sure Dispatch can send messages to the channel we’ve selected; that way we can figure out if there are any permissions issues we need to fix
Congrats! You’ve created a Patch that streams XY Finance swap data to your dedicated server channel. Now you can repeat the same steps to set up your other data streams to send data to other channels.
Once you’ve turned your Patch on, you'll start receiving real-time alerts in your Discord channels whenever your selected smart contract events are emitted or functions are called.
Here's an example of what you might see:
Example of real-time smart contract alerts in Discord
Though Discord alerts happen in real-time, you can mute notifications for non-urgent activity and review the channel periodically to see what happened.
In addition to getting real-time alerts in Discord, you can visit Dispatch to see a historical log of all your Patches. If you’re monitoring wallets and contracts for balance-related activity in addition to smart contract functions & events, you can see the log of all monitored activity in Patches History.
To get to the Contract Details page for any of the smart contracts you’re monitoring, navigate to the Contracts Overview page and click on the contract.
If you’re interested in visualizing contract activity over time, choose “Dispatch Monitor” as your Action when setting up Patches. This logs on-chain activity to Dispatch rather than sending real-time alerts.
Once Patches are running, you can log into Dispatch for a historical log of all the contract activity you’re monitoring, and see visualizations that can help provide trend insights. There are several places to view historical data and contract activity charts:
Visualization of XY Finance contract and address activity over time
What you’ll see on the Contract Details page
With Patches created for Discord, you can now get both real-time alerts, and insights from trends in activity over time.
Here are some examples:
Active addresses that triggered events and function calls
Let's review some helpful tips to get the most out of your monitoring setup:
In addition to smart contract monitoring, you can also easily track balance changes of any token in wallets and smart contracts with Dispatch. Get alerted if the balance of your rewards or governance token falls below a certain threshold, monitor balance fluctuations of specific tokens across supported chains, and stay updated on any wallet's token movements.
You've now set up a complete monitoring and visualization system for XY Finance using Dispatch! You can track cross-chain swaps, visualize usage patterns, monitor fee structure changes, and keep an eye on important protocol events — all without writing a single line of code.
Remember, the setup we've walked through today is just the start. You can follow these steps to monitor any smart contract activity you're interested in, whether it's other DeFi protocols, lending marketplaces, NFT mints, or your own smart contracts.
Ready to get started with your own monitoring setup? Sign up for free.