> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mobula.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Swap Events Stream

> Real-time WebSocket stream for raw swap events across EVM and Solana chains

<Tip> This endpoint is only available to Growth and Enterprise plans. </Tip>

## Endpoint Details

Use this stream when you need every raw swap event that matches your filters.

| Chain family | Endpoint                           | Event  |
| ------------ | ---------------------------------- | ------ |
| EVM          | `wss://stream-evm-prod.mobula.io/` | `swap` |
| Solana       | `wss://stream-sol-prod.mobula.io/` | `swap` |

<Warning>
  Do not mix Solana `chainIds` on the EVM endpoint, or EVM `chainIds` on the Solana endpoint.
</Warning>

<Note>The EVM addresses used in filters must be lowercase.</Note>

## Subscription Payload

```json theme={null}
{
  "type": "stream",
  "authorization": "YOUR_API_KEY",
  "payload": {
    "name": "SolanaRaydiumSwaps",
    "chainIds": ["solana:solana"],
    "events": ["swap"],
    "filters": {
      "or": [
        { "eq": ["poolType", "raydium"] },
        { "eq": ["poolType", "raydium-clmm"] }
      ]
    },
    "subscriptionId": "solana-raydium-swaps",
    "subscriptionTracking": true
  }
}
```

## Response Frame

Every message uses the standard Multi-Events frame:

```json theme={null}
{
  "data": {
    "type": "swap",
    "poolAddress": "4WYhS4JwJQsqfVfNx2uN9ZoRhrMTTsYo8kjdTLvFtSDy",
    "poolType": "raydium-clmm",
    "transactionHash": "snFJGsc6gUyZHpYTbxVQQnDYpWSuPUJ4NTdvTJHTX6Wyd2Amsb3MTbNeyDe9VzkRVf87DhQ1aV79Ptnq2fZufei",
    "swapSenderAddress": "7rhFTmUrRSQsL2b3YDoTuSC2sBQUeN9smbSHpne3vowa",
    "addressToken0": "So11111111111111111111111111111111111111112",
    "addressToken1": "HjgFP3f1nc9kxD71YQXxD1fWHZLNp6b5ARdvhfVKpgCP",
    "amount0": 0.32,
    "amount1": -2944849.817626,
    "amountUSD": 56.42,
    "date": "2026-06-08T00:18:34.613Z"
  },
  "chainId": "solana:solana",
  "duplicateCount": 1,
  "subscriptionId": "solana-raydium-swaps"
}
```

See the [Curated Data Model](/indexing-stream/stream/data-model/curated-data-model#swap-model) for the swap fields.

## Common Filters

### Pool Types

```json theme={null}
{
  "or": [
    { "eq": ["poolType", "raydium"] },
    { "eq": ["poolType", "raydium-clmm"] }
  ]
}
```

### Pool Address Batch

```json theme={null}
{
  "in": [
    "poolAddress",
    [
      "0xd0b53d9277642d899df5c87a3966a349a798f224",
      "0xedc625b74537ee3a10874f53d170e9c17a906b9c"
    ]
  ]
}
```

### Pool Type and Sender

```json theme={null}
{
  "and": [
    { "in": ["poolType", ["uniswap-v2", "uniswap-v3", "uniswap-v4"]] },
    {
      "in": [
        "swapSenderAddress",
        [
          "0xd0b53d9277642d899df5c87a3966a349a798f224",
          "0xa6b579684e943f7d00d616a48cf99b5147fc57a5"
        ]
      ]
    }
  ]
}
```

## Parameters

* **`chainIds`** (required): Chain identifiers, for example `["evm:8453"]` or `["solana:solana"]`.
* **`events`** (required): Must include `swap`.
* **`filters`** (optional): Filter conditions. See [filters](/indexing-stream/stream/filters).
* **`subscriptionId`** (optional): Identifier copied into matching responses.
* **`subscriptionTracking`** (optional, default: `false`): Include subscription details in response logs.
* **`tag`** (optional): Usage tag shown in the dashboard breakdown.

## Keepalive

Send a ping periodically to keep long-lived connections active:

```json theme={null}
{ "event": "ping" }
```

## Unsubscribe

```json theme={null}
{
  "type": "unsubscribe",
  "authorization": "YOUR_API_KEY",
  "payload": {
    "subscriptionId": "solana-raydium-swaps"
  }
}
```
