> ## 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.

# Perps Order Events Stream

> Real-time WebSocket stream for perpetual order events, liquidations, and TP/SL updates

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

## Endpoint Details

Use this stream for perpetual trading activity: market orders, liquidations, limit orders, take profits, stop losses, and TP/SL updates.

* **Endpoint:** `wss://stream-perps-prod.mobula.io/`
* **Event:** `order`
* **Supported chains:** `lighter:301`, `lighter:304`, `evm:42161`
* **Supported exchanges:** Lighter and Gains Network

See the [Perps Data Model](/indexing-stream/stream/data-model/perps-data-model) for the full field reference.

## Subscription Payload

```json theme={null}
{
  "type": "stream",
  "authorization": "YOUR_API_KEY",
  "payload": {
    "name": "LighterLiquidations",
    "chainIds": ["lighter:301", "lighter:304"],
    "events": ["order"],
    "filters": {
      "or": [
        { "eq": ["type", "LIQUIDATION_LONG"] },
        { "eq": ["type", "LIQUIDATION_SHORT"] }
      ]
    },
    "subscriptionId": "lighter-liquidations",
    "subscriptionTracking": true
  }
}
```

## Response Frame

Every message uses the standard Multi-Events frame:

```json theme={null}
{
  "data": {
    "type": "LIQUIDATION_LONG",
    "exchange": "lighter",
    "market": "lighter-eth-usd",
    "account": "0x1234...",
    "price": 3450.12,
    "size": 1.5,
    "transactionHash": "0xabcd...",
    "date": "2026-06-08T00:18:34.613Z"
  },
  "chainId": "lighter:301",
  "duplicateCount": 1,
  "subscriptionId": "lighter-liquidations"
}
```

## Order Types

* `MARKET_BUY`
* `MARKET_SELL`
* `LIQUIDATION_LONG`
* `LIQUIDATION_SHORT`
* `LIMIT_BUY`
* `LIMIT_SELL`
* `TAKE_PROFIT`
* `STOP_LOSS`
* `UPDATE_TP`
* `UPDATE_SL`

## Common Filters

### Liquidations

```json theme={null}
{
  "or": [
    { "eq": ["type", "LIQUIDATION_LONG"] },
    { "eq": ["type", "LIQUIDATION_SHORT"] }
  ]
}
```

### Exchange

```json theme={null}
{
  "eq": ["exchange", "gains"]
}
```

### Market Orders

```json theme={null}
{
  "or": [
    { "eq": ["type", "MARKET_BUY"] },
    { "eq": ["type", "MARKET_SELL"] }
  ]
}
```

## Parameters

* **`chainIds`** (required): Perps chain identifiers, for example `["lighter:301"]`.
* **`events`** (required): Must include `order`.
* **`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

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

## Unsubscribe

```json theme={null}
{
  "type": "unsubscribe",
  "authorization": "YOUR_API_KEY",
  "payload": {
    "subscriptionId": "lighter-liquidations"
  }
}
```
