Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.moralis.com/llms.txt

Use this file to discover all available pages before exploring further.

You can create a stream either through the Moralis Admin Panel (no code required) or programmatically via the API. The flow is the same on every chain — define a stream, attach the addresses (or xpub / programs / mints) you care about, and point Moralis at your webhook URL — but the parameters and chain-specific features differ.

Option 1: Create via Admin Panel

Getting Started

  1. Go to admin.moralis.com/streams.
  2. Click on Create a new Stream.
  3. Choose one of the EVM templates:
    • Custom Event — Customizable options for events and filters, allowing precise notifications.
    • Wallet Activity — Track native transactions and smart contract interactions (transfers, approvals).
    • Contract Activity — Monitor smart contract events (logs).

Setting Up the Stream

  1. Name your stream and select the types of events you want to track.
  2. Set up event filtering. See Filters for details.
  3. Add a tag for your stream and choose if you wish to receive additional data.
  4. Add the addresses you wish to track.
  5. Pick which EVM chains should be tracked (Ethereum, Base, Polygon, etc.).
  6. Test your stream (optional).
  7. Add your webhook URL where the POST requests will be sent.
For testing, you can use a service like webhook.site to receive and inspect webhooks.
  1. Save your configuration.

Option 2: Create via SDK

Make sure you have a Moralis API key. You can get one from the Moralis Admin Panel.

Step 1: Create a Stream

Required parameters:
  • webhookUrl — Webhook URL where Moralis will send the POST request.
  • description — A description for this stream.
  • tag — A user-provided tag sent along with the webhook to identify the stream.
  • chains — An array of EVM chain IDs to monitor (hex-encoded).
  • At least one of includeContractLogs, includeNativeTxs, or includeInternalTxs must be true.
const Moralis = require("moralis").default;

const runApp = async () => {
  await Moralis.start({
    apiKey: "YOUR_API_KEY",
  });

  const response = await Moralis.Streams.add({
    webhookUrl: "https://webhook.site/YOUR_WEBHOOK_URL",
    description: "My first stream",
    tag: "my_stream",
    chains: ["0x1"],
    includeNativeTxs: true,
  });

  console.log(response.toJSON().id); // print the stream id
};

runApp();

Step 2: Add an Address to a Stream

Now that you have a stream ID, you can add addresses to monitor. You can add individual addresses or a batch.
const Moralis = require("moralis").default;

const runApp = async () => {
  await Moralis.start({
    apiKey: "YOUR_API_KEY",
  });

  const list = [
    "0xf3d8d9f1f1ccbc8f7e313b7e7cdaa1d6e5b2c2f2",
    "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",
  ];

  const response = await Moralis.Streams.addAddress({
    id: "YOUR_STREAM_ID",
    address: list,
  });

  console.log(response.toJSON());
};

runApp();

Step 3: Update a Stream (Optional)

You can update a stream to add contract log monitoring, such as listening for ERC-20 transfers.
const Moralis = require("moralis").default;

const runApp = async () => {
  await Moralis.start({
    apiKey: "YOUR_API_KEY",
  });

  const ERC20TransferABI = [
    {
      anonymous: false,
      inputs: [
        { indexed: true, name: "from", type: "address" },
        { indexed: true, name: "to", type: "address" },
        { indexed: false, name: "value", type: "uint256" },
      ],
      name: "Transfer",
      type: "event",
    },
  ];

  const response = await Moralis.Streams.update({
    id: "YOUR_STREAM_ID",
    abi: ERC20TransferABI,
    includeContractLogs: true,
    topic0: ["Transfer(address,address,uint256)"],
    description: "My first stream - with ERC20 transfers",
  });

  console.log(response.toJSON());
};

runApp();

Next Steps

Once your stream is created, you will receive a mandatory test webhook that you must respond to with a 200 status code for the stream to activate.