> ## Documentation Index
> Fetch the complete documentation index at: https://monadfoundation-40611fb6-v0-16-0.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# How to index every WMON transfer using QuickNode Streams

In this guide, you will learn how to use QuickNode Streams to index every [WMON](https://testnet.monadvision.com/token/0xFb8bf4c1CC7a94c73D209a149eA2AbEa852BC541) transfer, including internal transactions, on Monad Testnet.

## What is QuickNode Streams?

[QuickNode Streams](https://www.quicknode.com/docs/streams/getting-started) is a web3 data streaming solution supporting real-time and historical Monad data that offers:

* **Reliable Data Delivery** - Exactly-once, guaranteed delivery, seamlessly integrating with your data lake. Streams ensures every block, receipt, or trace is delivered exactly-once in the order of dataset finality, preventing issues like corrupt or missing data
* **Real-Time Data Consistency** - Consistent, live data streaming
* **Efficient Historical Data Handling** - Configurable date ranges and destinations for streamlined historical data management
* **Easy Integration** - Simple setup through a user-friendly interface
* **Transparent User Experience** - Clear logging, metrics, and usage tracking

## Setup Guide

### 1. Initial setup

1. Sign up for [QuickNode](https://dashboard.quicknode.com/?prompt=signup) and log into your dashboard.

2. Click on "Streams" in the left sidebar.

<img src="https://mintcdn.com/monadfoundation-40611fb6-v0-16-0/F8OEprt_DoI8Hxdt/static/img/guides/indexers/quicknode-streams/1.png?fit=max&auto=format&n=F8OEprt_DoI8Hxdt&q=85&s=8427c338c4ce1526c12fbad293bf338d" alt="QuickNode Dashboard" width="3020" height="1572" data-path="static/img/guides/indexers/quicknode-streams/1.png" />

3. Click on "Create Stream".

<img src="https://mintcdn.com/monadfoundation-40611fb6-v0-16-0/F8OEprt_DoI8Hxdt/static/img/guides/indexers/quicknode-streams/2.png?fit=max&auto=format&n=F8OEprt_DoI8Hxdt&q=85&s=b4d7962715467eff9aac1d181d91521d" alt="Create Stream Button" width="3020" height="1572" data-path="static/img/guides/indexers/quicknode-streams/2.png" />

### 2. Configure Stream range

1. Give your stream a name. In this example we will name it `monad-quicknode-stream`.

2. In the "Network" section, select `Monad` from the dropdown.

3. In the "Stream Start" section you can choose to start the stream from the latest block or from a specific block number.

<img src="https://mintcdn.com/monadfoundation-40611fb6-v0-16-0/F8OEprt_DoI8Hxdt/static/img/guides/indexers/quicknode-streams/3.png?fit=max&auto=format&n=F8OEprt_DoI8Hxdt&q=85&s=6d586ad27fe49c077f7178cf6bec56af" alt="Stream Configuration" width="3020" height="1572" data-path="static/img/guides/indexers/quicknode-streams/3.png" />

4. In the "Stream End" section you can choose to end the stream until manually paused or at a specific block number.

5. In the "Latest block delay" section, you can set a block number as a delay in receiving data. For this guide we will receive data as soon as it is available.<br /><br />For example: If the block delay is `3`, you will receive data only when there is **new data available** for `3` blocks including latest block, this helps in case there is a reorg.

6. In the "Restream on reorg" section you can decide if you would like to get updated data restreamed in case of a reorg. For this guide we will keep this off.

7. Once done click "Next".

<img src="https://mintcdn.com/monadfoundation-40611fb6-v0-16-0/F8OEprt_DoI8Hxdt/static/img/guides/indexers/quicknode-streams/4.png?fit=max&auto=format&n=F8OEprt_DoI8Hxdt&q=85&s=ff47b636abe639f7d3f1136223e5dd15" alt="Additional Settings" width="3020" height="1572" data-path="static/img/guides/indexers/quicknode-streams/4.png" />

### 3. Set up dataset

1. In the "Dataset" dropdown you can select the dataset of your choice according to the use case. For this guide we will select `Block with Receipts` since we want to filter logs with events emitted by WMON contract.

* Optional: Enable "Batch messages" to receive multiple blocks in a single message. This can be useful when the stream is not starting from the latest block.

<img src="https://mintcdn.com/monadfoundation-40611fb6-v0-16-0/F8OEprt_DoI8Hxdt/static/img/guides/indexers/quicknode-streams/5.png?fit=max&auto=format&n=F8OEprt_DoI8Hxdt&q=85&s=d02be56b4711b4839516017ff499d312" alt="Dataset Selection" width="3020" height="1572" data-path="static/img/guides/indexers/quicknode-streams/5.png" />

2. Feel free to test it out by entering a block number and clicking "Fetch payload".

<img src="https://mintcdn.com/monadfoundation-40611fb6-v0-16-0/F8OEprt_DoI8Hxdt/static/img/guides/indexers/quicknode-streams/6.png?fit=max&auto=format&n=F8OEprt_DoI8Hxdt&q=85&s=77689595524e1a833a705466ce1ac09b" alt="Raw Payload Example" width="3020" height="1572" data-path="static/img/guides/indexers/quicknode-streams/6.png" />

### 4. Create WMON Transfer filter

1. In the "Modify the stream payload" section, you can define filters by clicking **"Customize your payload"**. For this guide, we will filter to only retrieve receipts involving WMON transfers.

<img src="https://mintcdn.com/monadfoundation-40611fb6-v0-16-0/F8OEprt_DoI8Hxdt/static/img/guides/indexers/quicknode-streams/7.png?fit=max&auto=format&n=F8OEprt_DoI8Hxdt&q=85&s=077f6b8db312afa39aab19cec980f557" alt="modify stream image" width="3020" height="1572" data-path="static/img/guides/indexers/quicknode-streams/7.png" />

2. QuickNode has a set of filter templates. Select the **Decoded ERC20 transfers** template:

<img src="https://mintcdn.com/monadfoundation-40611fb6-v0-16-0/F8OEprt_DoI8Hxdt/static/img/guides/indexers/quicknode-streams/8.png?fit=max&auto=format&n=F8OEprt_DoI8Hxdt&q=85&s=b3a331630fe22d084e5e52304b15e25b" alt="image for filter" width="3020" height="1572" data-path="static/img/guides/indexers/quicknode-streams/8.png" />

3. The editor will appear:

<img src="https://mintcdn.com/monadfoundation-40611fb6-v0-16-0/F8OEprt_DoI8Hxdt/static/img/guides/indexers/quicknode-streams/9.png?fit=max&auto=format&n=F8OEprt_DoI8Hxdt&q=85&s=a7338350b1ece11a1ad85f1aef82fb71" alt="image of filter editor" width="3020" height="1572" data-path="static/img/guides/indexers/quicknode-streams/9.png" />

The current filter allows all ERC20 transfers through. Replace the filter code with:

```js lines theme={null}
function main(stream) {  
  const erc20Abi = `[{
    "anonymous": false,
    "inputs": [
      {"indexed": true, "type": "address", "name": "from"},
      {"indexed": true, "type": "address", "name": "to"},
      {"indexed": false, "type": "uint256", "name": "value"}
    ],
    "name": "Transfer",
    "type": "event"
  }]`;
  
  const data = stream.data ? stream.data : stream;
  
  // Decodes logs from the receipts that match the Transfer event ABI
  var result = decodeEVMReceipts(data[0].receipts, [erc20Abi]);
  
  // Filter for receipts with decoded logs
  result = result.filter(receipt => {
        // Check if there are any ERC20 transfers
        if(receipt.decodedLogs) {
            // Check if there are any WMON transfers
            receipt.decodedLogs = receipt.decodedLogs.filter(log => log.address == "0xFb8bf4c1CC7a94c73D209a149eA2AbEa852BC541");
            
            // Return receipt if there logs which indicate a WMON transfer.
            return receipt.decodedLogs.length > 0;
        }

        // Return nothing if there are no ERC20 transfers.
        return false;
    });
  
  return { result };
}
```

4. Test the filter with "Run test"

<img src="https://mintcdn.com/monadfoundation-40611fb6-v0-16-0/F8OEprt_DoI8Hxdt/static/img/guides/indexers/quicknode-streams/10.png?fit=max&auto=format&n=F8OEprt_DoI8Hxdt&q=85&s=c45555485f35da2ee93b664d41658240" alt="run test image" width="3020" height="1572" data-path="static/img/guides/indexers/quicknode-streams/10.png" />

5. "Save & close" to save the filter.

<img src="https://mintcdn.com/monadfoundation-40611fb6-v0-16-0/F8OEprt_DoI8Hxdt/static/img/guides/indexers/quicknode-streams/11.png?fit=max&auto=format&n=F8OEprt_DoI8Hxdt&q=85&s=a0e9b4c0adac485f6dbdf201bca60402" alt="save & close image" width="3020" height="1572" data-path="static/img/guides/indexers/quicknode-streams/11.png" />

6. Click "Next"

### 5. Set up Stream destination

For this guide we will keep the stream destination simple and use `Webhook` as the "Destination Type".

1. Let's use a site like [Svix Play](https://www.svix.com/play/) to quickly get a webhook and test the stream.

<img src="https://mintcdn.com/monadfoundation-40611fb6-v0-16-0/F8OEprt_DoI8Hxdt/static/img/guides/indexers/quicknode-streams/12.png?fit=max&auto=format&n=F8OEprt_DoI8Hxdt&q=85&s=f1382ce4251f920f1e6ddf10c6879ff9" alt="svix play image" width="3020" height="1572" data-path="static/img/guides/indexers/quicknode-streams/12.png" />

2. Copy the webhook url from Svix Play:

<img src="https://mintcdn.com/monadfoundation-40611fb6-v0-16-0/F8OEprt_DoI8Hxdt/static/img/guides/indexers/quicknode-streams/13.png?fit=max&auto=format&n=F8OEprt_DoI8Hxdt&q=85&s=1a8756345d4373c502b250d1355fc248" alt="svix play copy url image" width="3020" height="1576" data-path="static/img/guides/indexers/quicknode-streams/13.png" />

3. In QuickNode:

* Select `Webhook` as destination type
* Paste your webhook URL
* We can keep the rest of the settings as default

<img src="https://mintcdn.com/monadfoundation-40611fb6-v0-16-0/F8OEprt_DoI8Hxdt/static/img/guides/indexers/quicknode-streams/14.png?fit=max&auto=format&n=F8OEprt_DoI8Hxdt&q=85&s=8c1463830ddf7302aec232194c38bbbe" alt="webhook dropdown image" width="3020" height="1576" data-path="static/img/guides/indexers/quicknode-streams/14.png" />

4. Click on "Check Connection" to test the webhook url. Check if you received the "PING" message in the Svix Play dashboard.

<img src="https://mintcdn.com/monadfoundation-40611fb6-v0-16-0/F8OEprt_DoI8Hxdt/static/img/guides/indexers/quicknode-streams/15.png?fit=max&auto=format&n=F8OEprt_DoI8Hxdt&q=85&s=b6318b7807ea2a43afd65c0bae92395d" alt="check connection image" width="3020" height="1576" data-path="static/img/guides/indexers/quicknode-streams/15.png" />

<img src="https://mintcdn.com/monadfoundation-40611fb6-v0-16-0/F8OEprt_DoI8Hxdt/static/img/guides/indexers/quicknode-streams/16.png?fit=max&auto=format&n=F8OEprt_DoI8Hxdt&q=85&s=f0c7fafe88f4203c81c021684d8c364f" alt="ping message image" width="3020" height="1576" data-path="static/img/guides/indexers/quicknode-streams/16.png" />

5. Click "Send Payload" to send a test payload to the webhook.

<img src="https://mintcdn.com/monadfoundation-40611fb6-v0-16-0/F8OEprt_DoI8Hxdt/static/img/guides/indexers/quicknode-streams/17.png?fit=max&auto=format&n=F8OEprt_DoI8Hxdt&q=85&s=d68d2677488b51ca11bbc0fe2bb94d4d" alt="add send payload image" width="3020" height="1576" data-path="static/img/guides/indexers/quicknode-streams/17.png" />

<img src="https://mintcdn.com/monadfoundation-40611fb6-v0-16-0/F8OEprt_DoI8Hxdt/static/img/guides/indexers/quicknode-streams/18.png?fit=max&auto=format&n=F8OEprt_DoI8Hxdt&q=85&s=b4b18a8a016dad05146da0bcd414ad39" alt="svix payload image" width="3020" height="1576" data-path="static/img/guides/indexers/quicknode-streams/18.png" />

6. Finally click "Create a Stream" to create the stream.

<img src="https://mintcdn.com/monadfoundation-40611fb6-v0-16-0/F8OEprt_DoI8Hxdt/static/img/guides/indexers/quicknode-streams/19.png?fit=max&auto=format&n=F8OEprt_DoI8Hxdt&q=85&s=3745a0147e0f6816e26d7e584ed798b3" alt="create stream image" width="3020" height="1576" data-path="static/img/guides/indexers/quicknode-streams/19.png" />

### 6. Launch and Monitor

You should now be able to see the stream delivering the messages to the webhook!

<img src="https://mintcdn.com/monadfoundation-40611fb6-v0-16-0/F8OEprt_DoI8Hxdt/static/img/guides/indexers/quicknode-streams/20.png?fit=max&auto=format&n=F8OEprt_DoI8Hxdt&q=85&s=c27cc2ac7e5915a40843d66e217d76e4" alt="stream delivering image" width="3020" height="1576" data-path="static/img/guides/indexers/quicknode-streams/20.png" />

<img src="https://mintcdn.com/monadfoundation-40611fb6-v0-16-0/F8OEprt_DoI8Hxdt/static/img/guides/indexers/quicknode-streams/1.gif?s=3e39b6936e4c039195a7d0718ff71f2f" alt="svix streaming receiving message video" width="800" height="417" data-path="static/img/guides/indexers/quicknode-streams/1.gif" />

You can pause the stream by clicking the switch in the top right corner.

<img src="https://mintcdn.com/monadfoundation-40611fb6-v0-16-0/F8OEprt_DoI8Hxdt/static/img/guides/indexers/quicknode-streams/21.png?fit=max&auto=format&n=F8OEprt_DoI8Hxdt&q=85&s=2446d6d9cf0fb03ece936ec5d763e015" alt="pause switch image" width="3020" height="1576" data-path="static/img/guides/indexers/quicknode-streams/21.png" />

## Next Steps

* Monitor your stream's performance in the QuickNode dashboard
* Adjust filter parameters as needed
* Connect to your production webhook endpoint when ready

Your stream will now track all WMON transfers until manually paused or until reaching your specified end block.
