Want to monitor an Ethereum address and receive notifications for on-chain activity? With Moralisโ Web3 Streams API, you can create this sort of crypto wallet tracking dapp in minutes. You can either set this up via Moralisโ admin UI or create a simple JavaScript script. If choosing the latter, the following lines of code are the key to the crypto wallet tracking functionality:
const newStream = await Moralis.Stream.add(options) const {id}=newStream.toJSON(); const address=โwallet_address_you_want_to_trackโ await Moralis.Streams.addAddress({address,id})
To make the above snippet of code work, you also need to import and initialize Moralis. You must also define the options for your Web3 stream. If you want to learn how to properly implement the above lines of code and create a production-ready crypto wallet tracking dapp, dive into the โMonitor Ethereum Addressโ section below and follow our lead. But first, create your free Moralis account!

Overview
In todayโs article, weโll show you how to utilize Moralisโ Streams API to build crypto wallet tracking dapps (decentralized applications) with minimum effort. We will dive right into our tutorial and first demonstrate how to monitor an Ethereum address using Moralisโ admin UI. However, when working on production-ready dapps, youโll most likely prefer to set up Web3 streams within your scripts. Thus, weโll show you how to do that as well. This is where youโll learn how to correctly implement the above-presented lines of code.
For those who prefer additional context, weโll also answer what crypto wallet tracking is and provide the theory behind todayโs tutorial. Weโll also do a quick overview of Moralis and its products so you can use them to level up your dapp development. Finally, weโll outline the core benefits of the Web3 Streams API. After all, todayโs tutorial reflects only a small portion of what this powerful tool is capable of.

Monitor Ethereum Address โ How to Monitor a Wallet Address on Ethereum
Letโs first show you how you can set up a Web3 wallet tracker using Moralisโ admin UI. Since you need an active Moralis account to access the admin area, make sure to create your free Moralis account now in case you havenโt done so yet. You can use the link in the intro or hit the โStart for Freeโ button in the top-right corner of Moralisโ homepage:
If you want to test your progress as you proceed with todayโs tutorial, youโll also need your MetaMask and some โtestโ MATIC. In case you need help adding the Polygon Mumbai testnet to your MetaMask and some guidance on obtaining โtestโ MATIC, we explain all of that in our article exploring a Polygon Mumbai faucet.
Crypto Wallet Tracking with Moralis Admin UI
Once inside your Moralis admin area, select the โStreamsโ option from the side menu, followed by a click on the โCreate a new streamโ button:
Next, select the โCreate it from Adminโ option:

To monitor an Ethereum address, you need to provide an address. For testing purposes, the simplest way is typically to open your MetaMask and copy your address from there:
Then, paste it into the โAdd Address to Streamโ entry field:
By entering a wallet address that you want to listen to, the UI will automatically present you with stream configuration options. To use your streams for production purposes, you need to provide a webhook URL and switch from โDemoโ to โProdโ:

We do not need to provide a webhook URL. For the description and tag fields, we can use the default options. As such, we can proceed to network selection. Since Moralis is fully cross-chain interoperable, you can target all leading EVM-compatible blockchain networks. However, we will focus on the Mumbai testnet:
In the fourth step of our stream setup, we will only select the contract interactions since we are interested in tracking ERC20 tokens:
The โAdvanced Optionsโ enable you to filter your tracking agenda further. For example, you can use a smart contractโs ABI to target specific smart contract functions. You can also add multiple other filters, but for the sake of this demo, we wonโt use any advanced options.
Example Transaction
Finally, we execute a transaction of Chainlink (LINK) tokens on the Mumbai testnet:
Our demo stream picks up the above transaction instantaneously:
The above screenshot shows that the stream not only detects the on-chain event but also fetches the related on-chain data. As such, you can see the transaction hash, the smart contract involved in the event, the โfromโ and โtoโ addresses, the transferred value, and more. Accordingly, you have a trigger plus a lot of useful details that you can neatly incorporate in all sorts of dapps or notifications/bots.

Crypto Wallet Tracking with Moralisโ JS SDK
As mentioned above, another way to use Web3 streams from Moralis is by incorporating them programmatically. For most production purposes, this tends to be a preferred method. Therefore, letโs look at the scripts that will make it possible to use NodeJS to create a backend dapp that detects and logs on-chain events.
Before we can focus on creating our stream, we need to have a server that will receive a webhook. For that purpose, we can create a simple NodeJS Express app with a โwebhookโ endpoint. These are the lines of code that you should copy-paste into your โindex.jsโ file:
const express = require("express"); const app = express(); const port = 3000; app.use(express.json()); app.post("/webhook", async (req, res) => { const {body} = req; try { console.log(body); } catch (e) { console.log(e); return res.status(400).json(); } return res.status(200).json(); }); app.listen(port, () => { console.log(`Listening to streams`); });
Note: If you are not experienced with creating NodeJS applications and setting up Express servers, use our โQuickstart NodeJSโ guide.
Once you have the above script set in place, use your terminal and run the following command:
npm run start
As a result, your terminal should return the โListening to streamsโ message:

Then, open another terminal, and use โngrokโ to create a tunnel to port โ3000โ. This will generate a URL address serving your streamโs webhook URL. To do this, use the following command:
ngrok http 3000
Now that you have your local server and tunnel ready, itโs time to take a closer look at the code that will make crypto wallet tracking possible. This is also where youโll learn to paste the above-marked URL address in the right place.
Crypto Wallet Tracking Script โ Code Walkthrough
Initialize another NodeJS app. Then, create a new โindex.jsโ file and first require Moralis and โdotenvโ:
const Moralis = require("moralis").default; const { EvmChain } = require("@moralisweb3/common-evm-utils"); require("dotenv").config();
You must also create a โ.envโ file and store your Moralis Web3 API key in that file under the โMORALIS_KEYโ variable. At this point, you should have your Moralis account up and running, and you can obtain your Web3 API key from your admin area in these two simple steps:
With your API key in place, itโs time to initialize Moralis by adding the following lines of code below the โrequire (โdotenvโ).config();โ line:
Moralis.start({ apiKey: process.env.MORALIS_KEY, });
Next, you need to define the streamโs options. These are the lines of code to use:
async function streams(){ const options = { chains: [EvmChain.MUMBAI], tag: "transfers", description: "Listen to Transfers", includeContractLogs: false, includeNativeTxs: true, webhookUrl: "your webhook url" }
Looking at the above code snippet, you can see that it defines a chain to focus on, a description, a tag, and a webhook URL. If you remember the Web3 Streams UI, you see that we are defining the same options as requested by the streamโs configuration. By setting โincludeContractLogsโ to โfalseโ, we are not listening to ERC20 transactions. Also, by setting โincludeNativeTxsโ to โtrueโ, we are focusing on native currency transfers. For the Mumbai network, thatโs โtestโ MATIC. So, all you have to do is copy-paste the above lines of code to your โindex.jsโ file and replace โyour webhook urlโ with the above-obtained โngrokโ URL:
As highlighted in the above image, do not forget to add โ/webhookโ at the end of your URL.
Create a New Stream
At this point, you have everything ready to finally implement the lines of code provided in the introduction of todayโs article. So, inside the streamโs โasyncโ function of your โindex.jsโ file below โwebhookUrlโ, add these simple lines of code:
const newStream = await Moralis.Streams.add(options) const {id} = newStream.toJSON(); const address = "wallet_address_you_want_to_track"; await Moralis.Streams.addAddress({address, id}) console.log("Fin") } streams()
The โMoralis.Streams.add(options)โ method takes the above-defined options and creates a new stream. Then, the code gets the ID of the new stream with โconst {id}โ. Next, it defines a wallet address to monitor. Here, make sure to replace โwallet_address_you_want_to_trackโ with your address (the one you can test). By using the โMoralis.Streams.addAddressโ method, you add the wallet address to your stream based on its ID. Finally, the above code console logs โFinโ, which signals it has done its thing.
Again, use the โnode index.jsโ command to run this โstream-creatingโ sample script. As a result, you should see โFinโ in your terminal:
If you now open the terminal again where you are running your local Express server, you should see the empty webhook initializing:
With everything set up correctly, we encourage you to test your stream โ use your MetaMask and transfer some โtestโ MATIC from or to the address you added above. As a result, youโll be able to see the details of your test transaction in your terminal:

Crypto Wallet Tracking Explained
Tracking crypto wallets is all about listening to real-time activities related to a specific public blockchain address and fetching the details of those activities. For instance, in the above tutorial, we focused on ERC20 transfers (when using the UI) and native transfers (when using the JS SDK). However, these are just two popular examples of on-chain events. All in all, countless dapps can greatly benefit from this sort of signaling and data fetching.

What is Crypto Wallet Tracking?
Crypto wallet tracking focuses on detecting the activity of Web3 wallets, and these signals can then be used in various ways. Essentially, the โmonitor Ethereum addressโ feature enables devs to create dapps that detect activities on monitored wallets and do something useful based on those signals and related data. After all, detected activities can trigger all sorts of actions. For instance, they can trigger notifications or unlock special features of a dapp.
Best Crypto Wallet Tracking Tool
Crypto wallets are public blockchain addresses. In turn, anyone can track every wallet address. However, it can be challenging to register when events occur and fetch parsed data without the proper means. This is why Moralisโ Streams API is such a popular tool. In todayโs tutorial, you saw this crypto wallet tracking tool in action. If youโd like to explore it further, you can review the main benefits of Web3 Streams API below.
While detecting real-time, on-chain events is extremely useful, exploring past activities and crypto assets related to any Web3 wallet can also be of great value. It can be the key to creating the ultimate wallet tracking dapp. This is where Moralisโ Web3 Data API โ the best Ethereum API in 2023 โ enters the scene. This API enables you to fetch any type of on-chain data with a single line of code. It allows you to get Ethereum logs and events, get Ethereum transaction details, get contract logs, and much more.
Last but not least, Moralis also offers the ultimate Web3 Auth API. This tool lets you add all of the most popular Web3 login methods to your dapps. That way, your users can participate in a frictionless Web3 onboarding experience.
Web3 Streams API Benefits โ Monitor EVM Chains, Not Just Ethereum
In our examples above, we exclusively focused on Polygonโs testnet: Mumbai. However, as you were able to see in the admin UI, Moralis supports all leading EVM-compatible chains. So, aside from monitoring an Ethereum address, you can monitor any other supported chain or multiple networks at once. In fact, cross-chain interoperability is one of the greatest benefits of all Moralisโ products. Not only does this allow you to target multiple chains, but it also future-proofs your work, as youโll never be stuck to a particular chain.
Another significant benefit of the Streams API is its user-friendliness. We used NodeJS above, but you can work with other leading legacy programming languages and frameworks to make the most out of the Web3 Streams API. Whatโs more, you can access this power with a free Moralis account.
Since todayโs objective was to monitor an Ethereum address, we focused on listening to wallet events. However, the Streams API enables you to listen to any smart contract address as well. This further expands the possibilities of utilizing on-chain events. For example, you can create a Twitter bot for crypto whale alerts.
Hereโs a list of major Web3 Streams API benefits:
Cross-chain interoperability
User-friendliness (cross-platform interoperability)
Listening to crypto wallets and smart contracts
Speed and efficiency
Advanced filtering options
Accessible with a free account
Additionally, with the Streams API, thereโs no more:
Connecting and maintaining buggy RPC nodes
Building unnecessary abstractions
Wasting time building complex data pipelines
If you are still using ethers.js to listen to the blockchain and you need more than the above benefits to help you decide which tool is best for the job, check out our ethers.js vs Web3 streams comparison.
TRUSTED BY INDUSTRY LEADERS

Monitor an Ethereum Address โ Crypto Wallet Tracking for EVM Chains โ Summary
By tackling todayโs tutorial, you had an opportunity to follow our lead and create your own Web3 streams. You explored how to do that via Moralisโ admin UI or with Moralisโ SDK. Each of the two methods has its benefits, one is more beginner-friendly, and the other is more suitable for production purposes. Still, they both provide the same results that support ultimate crypto wallet tracking. Todayโs article also taught you that the Streams API allows you to implement the โmonitor Ethereum addressโ feature on any EVM-compatible chain. You also learned what โcrypto wallet trackingโ is!
With all the main benefits of the Web3 Streams API in mind, you are probably eager to start building killer dapps. On your way, make the most out of Moralisโ docs and other Moralis resources. With our blockchain development YouTube channel, you can practice Web3 development by following our in-house expertsโ steps. You can also expand your Web3 horizons with the content on our crypto blog. Among many other topics, this is the place to learn what danksharding is, why you need the best Ethereum faucet, and how to implement Supabase authentication. Additionally, if you want to go full-time crypto sooner rather than later, enrolling in Moralis Academy tends to provide the edge. There, you can complete a wide range of high-quality courses; however, we recommend building strong blockchain and Bitcoin fundamentals first.
Read More: moralis.io