This endpoint is only available to Growth and Enterprise plans.

Product demo

Coming soon.

Endpoint details

Mobula now provides two dedicated WSS endpoints Why? Because EVM and Solana work very differently under the hood. If we tried to send both through a single WebSocket channel, things would get messy:
  • The event queue would get backed up under heavy traffic
  • Messages would arrive slower or even drop
  • Scaling would be harder since both ecosystems compete for the same resources
By keeping them separate, you get:
  • Faster and more reliable streams
  • Independent scaling (EVM traffic won’t affect Solana, and vice-versa)
  • Stable event delivery, even when network activity spikes
You cannot mix Solana subscriptions on the EVM endpoint (and vice-versa).
Always use the correct endpoint for the chain you’re working with.

EVM Chains

  • Endpoint: wss://stream-evm-prod.mobula.io/
  • Subscription Payload:
This stream will capture all transfers & swaps received by a specific address.
The EVM address in the filters must be lowercase.
{ 
    "type": "stream",
    "authorization": "YOUR_API_KEY",
    "payload": {
      "name": "MyWalletEvmTransactions",
      "chainIds": ["evm:6342"],
      "events": ["swap", "transfer"],
      "filters": { "eq": ["transactionTo", "0xd36b20c9dd8ffe68ed6078204dea8862d147193e"] },
      "subscriptionTracking":"true"
    }
}

SVM Chains

  • Endpoint: wss://stream-sol-prod.mobula.io/
  • Subscription Payload:
{ 
    "type": "stream",
    "authorization": "YOUR_API_KEY",
    "payload": {
      "name": "MyWalletEvmTransactions",
      "chainIds": ["solana:solana"],
      "events": ["swap", "transfer"],
      "subscriptionTracking":"true"
    }
}

Usage Examples

Before diving into the examples, make sure to check the data models for both EVM and SVM chains for swaps and transfers.
Pro Tip for Devs: Dive into these data models and experiment with filters — your imagination is the only limit! Mix and / or, combine keys, and watch your streams come alive!
  • Explore poolType, poolAddress, transactionFrom, transactionTo, and other keys in the data models.
  • Combine multiple conditions using and / or operators to capture exactly the events you want.
  • Mix and match filters across swaps and transfers to suit your application needs.

Filter Swaps by Pools

This stream captures all swaps from either raydium or raydium-clmm pools.
{ 
    "type": "stream",
    "authorization": "YOUR_API_KEY",
    "payload": {
      "name": "MyWalletSolTransactions",
      "chainIds": ["solana:solana"],
      "events": ["swap"],
      "filters": {
        "or": [
          {"eq": ["poolType", "raydium"]},
          {"eq": ["poolType", "raydium-clmm"]}
        ]
      },
      "subscriptionTracking":"true"
    }
}

Filter Transfer by Contract Address

This stream captures all swaps for a specific poolAddress and poolType.
{ 
    "type": "stream",
    "authorization": "YOUR_API_KEY",
    "payload": {
      "name": "MyWalletSolTransactions",
      "chainIds": ["solana:solana"],
      "events": ["transfer"],
      "filters": {
        "and": [
          {"eq": ["poolType", "pumpswap"]},
          {"eq": ["poolAddress", "68L2iPWLtkRuxhHBYVJLSzaApBVuM6DNqLL1pEywbDGR"]}
        ]
      },
      "subscriptionTracking":"true"
    }
}

Filter Transfers by Sender

This stream captures all transfers sent to a specific address.
{ 
    "type": "stream",
    "authorization": "YOUR_API_KEY",
    "payload": {
      "name": "MyWalletTransactions",
      "chainIds": ["solana:solana"],
      "events": ["transfer"],
      "filters": { "eq": ["transactionTo", "ASde6y8pBCU1aityWHRpqT7pEAcEonjCgFUMeh5egRes"] },
      "subscriptionTracking":"true"
    }
}

Filter Transfers From Sender and Receiver

This stream captures all transfers sent from or received by specific addresses.
{ 
    "type": "stream",
    "authorization": "YOUR_API_KEY",
    "payload": {
      "name": "MyWalletSolTransactions",
      "chainIds": ["solana:solana"],
      "events": ["transfer"],
      "filters": {
        "or": [
          {"eq": ["transactionFrom", "2zqLokC98qfedXyXZHeL4sEdFcmmTFizvb1UQeRweWxp"]},
          {"eq": ["transactionTo", "suqh5sHtr8HyJ7q8scBimULPkPpA557prMG47xCHQfK"]}
        ]
      },
      "subscriptionTracking":"true"
    }
}

Parameters

  • chainIds: details here
  • events: transactions, traces, logs, blocks, swaps, transfers, pools
  • filters: details here
  • subscriptionId (optional): A unique ID for your WebSocket connection. If not provided, it is automatically generated by the server.
  • subscriptionTracking (optional, default: false): Set this to true to include the subscriptionId and additional connection details in the response logs. Helpful for debugging and managing multiple active streams.

Implementation example

Let’s take a look at:
const socket = new WebSocket("wss://stream-evm-prod.mobula.io/");

socket.addEventListener("open", () => {
  socket.send(`{
    "type": "stream",
    "authorization": "YOUR_API_KEY",
    "payload": {
      "chainIds": ["evm:1", "evm:56"],
      "events": ["swap", "transfer"],
    }
}`);
});

socket.addEventListener("message", (event) => {
  const data = JSON.parse(event.data);

  if (event.reorg) {
    // Handle reorg
    return;
  }
});

// No need to close the socket, it will close automatically.
You can use the Network tab in your browser to see the WSS requests.

Unsubscribing from the stream

You can unsubscribe from the stream by sending an unsubscribe message:
  • Unsubscribe from all active streams: Send an empty payload as shown above. This will terminate all active subscriptions associated with the current WebSocket connection.

{
  "type": "unsubscribe",
  "authorization": "API-KEY", 
  "payload": {},
}
 
  • Unsubscribe from a specific subscriptionId: Include the relevant subscriptionId in the payload:

{
  "type": "unsubscribe",
  "authorization": "API-KEY",
  "payload": {
	  "subscriptionId": "your-subscription-id"
   }
}
After sending the unsubscribe payload, you will stop receiving events for the specified stream. Can’t find what you’re looking for? Reach out to us, response times < 1h.