> ## Documentation Index
> Fetch the complete documentation index at: https://monadfoundation-40611fb6-devops-1498-direct-udp-implementat.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-devops-1498-direct-udp-implementat/1megrMDa5MHiTh2n/static/img/guides/indexers/quicknode-streams/1.png?fit=max&auto=format&n=1megrMDa5MHiTh2n&q=85&s=fc77a48bcafb9f87707fcda7452e8947" 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-devops-1498-direct-udp-implementat/1megrMDa5MHiTh2n/static/img/guides/indexers/quicknode-streams/2.png?fit=max&auto=format&n=1megrMDa5MHiTh2n&q=85&s=1d2d2c93e9fdad75ec07be2c1264b84d" 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-devops-1498-direct-udp-implementat/1megrMDa5MHiTh2n/static/img/guides/indexers/quicknode-streams/3.png?fit=max&auto=format&n=1megrMDa5MHiTh2n&q=85&s=995346cabb7473bd091df7661f7d84a8" 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-devops-1498-direct-udp-implementat/1megrMDa5MHiTh2n/static/img/guides/indexers/quicknode-streams/4.png?fit=max&auto=format&n=1megrMDa5MHiTh2n&q=85&s=360b6d0b906aca8e221bf57fb86053fe" 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-devops-1498-direct-udp-implementat/1megrMDa5MHiTh2n/static/img/guides/indexers/quicknode-streams/5.png?fit=max&auto=format&n=1megrMDa5MHiTh2n&q=85&s=bed11184388b104bf41230fbfcf2635c" 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-devops-1498-direct-udp-implementat/1megrMDa5MHiTh2n/static/img/guides/indexers/quicknode-streams/6.png?fit=max&auto=format&n=1megrMDa5MHiTh2n&q=85&s=3c50e3faa23a12f4551a588fbc475c93" 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-devops-1498-direct-udp-implementat/1megrMDa5MHiTh2n/static/img/guides/indexers/quicknode-streams/7.png?fit=max&auto=format&n=1megrMDa5MHiTh2n&q=85&s=b72ea07307c2b07534dfc14b479a2644" 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-devops-1498-direct-udp-implementat/1megrMDa5MHiTh2n/static/img/guides/indexers/quicknode-streams/8.png?fit=max&auto=format&n=1megrMDa5MHiTh2n&q=85&s=849a70a45cec259bbd6882f6a366d0f9" 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-devops-1498-direct-udp-implementat/1megrMDa5MHiTh2n/static/img/guides/indexers/quicknode-streams/9.png?fit=max&auto=format&n=1megrMDa5MHiTh2n&q=85&s=f67877fd36699cb2c259d6742355b1f9" 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-devops-1498-direct-udp-implementat/1megrMDa5MHiTh2n/static/img/guides/indexers/quicknode-streams/10.png?fit=max&auto=format&n=1megrMDa5MHiTh2n&q=85&s=96fa7b22f3f0934864e0e9f2b6649bd9" 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-devops-1498-direct-udp-implementat/1megrMDa5MHiTh2n/static/img/guides/indexers/quicknode-streams/11.png?fit=max&auto=format&n=1megrMDa5MHiTh2n&q=85&s=f5899bfa66589ff597401776b32620f4" 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-devops-1498-direct-udp-implementat/1megrMDa5MHiTh2n/static/img/guides/indexers/quicknode-streams/12.png?fit=max&auto=format&n=1megrMDa5MHiTh2n&q=85&s=596c7f65cc0bcb7c12a41018a4fffe30" 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-devops-1498-direct-udp-implementat/1megrMDa5MHiTh2n/static/img/guides/indexers/quicknode-streams/13.png?fit=max&auto=format&n=1megrMDa5MHiTh2n&q=85&s=3db782f64f6b9887c3fe61b0a583789a" 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-devops-1498-direct-udp-implementat/1megrMDa5MHiTh2n/static/img/guides/indexers/quicknode-streams/14.png?fit=max&auto=format&n=1megrMDa5MHiTh2n&q=85&s=d8f92c2f6b1b8bada25b43f89bfcfae5" 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-devops-1498-direct-udp-implementat/1megrMDa5MHiTh2n/static/img/guides/indexers/quicknode-streams/15.png?fit=max&auto=format&n=1megrMDa5MHiTh2n&q=85&s=f3ca393f34fb366a33992213e48275a8" 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-devops-1498-direct-udp-implementat/1megrMDa5MHiTh2n/static/img/guides/indexers/quicknode-streams/16.png?fit=max&auto=format&n=1megrMDa5MHiTh2n&q=85&s=2168be631215c5f261d68908e560cf1d" 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-devops-1498-direct-udp-implementat/1megrMDa5MHiTh2n/static/img/guides/indexers/quicknode-streams/17.png?fit=max&auto=format&n=1megrMDa5MHiTh2n&q=85&s=05a86b4b76db066eca23702c3ba2591d" 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-devops-1498-direct-udp-implementat/1megrMDa5MHiTh2n/static/img/guides/indexers/quicknode-streams/18.png?fit=max&auto=format&n=1megrMDa5MHiTh2n&q=85&s=d6bc22478b3e72f852128de716176793" 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-devops-1498-direct-udp-implementat/1megrMDa5MHiTh2n/static/img/guides/indexers/quicknode-streams/19.png?fit=max&auto=format&n=1megrMDa5MHiTh2n&q=85&s=76051ffebfe0df2712407bdf9566fabe" 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-devops-1498-direct-udp-implementat/1megrMDa5MHiTh2n/static/img/guides/indexers/quicknode-streams/20.png?fit=max&auto=format&n=1megrMDa5MHiTh2n&q=85&s=15c1d31d3947cb35f0908a9662f5d6f5" 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-devops-1498-direct-udp-implementat/1megrMDa5MHiTh2n/static/img/guides/indexers/quicknode-streams/1.gif?s=05676e653912f0cfacc5aa41b941694d" 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-devops-1498-direct-udp-implementat/1megrMDa5MHiTh2n/static/img/guides/indexers/quicknode-streams/21.png?fit=max&auto=format&n=1megrMDa5MHiTh2n&q=85&s=ed561c0f650c4f5e91d21620e7d9c6ac" 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.
