> For the complete documentation index, see [llms.txt](https://docs.hydromancer.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hydromancer.xyz/readme/websocket/usertwapstatusupdates.md).

# userTwapStatusUpdates

Every live data message includes both routing identifiers with the same value:

```json
{"type": "userTwapStatusUpdates", "channel": "userTwapStatusUpdates"}
```

Other payload fields are omitted above. Existing clients may continue routing on either field.

{% hint style="info" %}
💧New endpoint - this endpoint is not a part of original Hyperliquid API and is added by us for builder convenience.
{% endhint %}

Delivers the same events as [allTwapStatusUpdates](/readme/websocket/alltwapstatusupdates.md), filtered to the subscribed `addresses`. Subscribing again merges new addresses into the existing subscription; unsubscribing requires the full current address set.

### Subscribe

```
{ 
    "type": "subscribe",
    "subscription": {
        "type": "userTwapStatusUpdates",
        "addresses": ["0x742d35Cc6634C0532925a3b844Bc9e7595f7F2e2"]
    }
} 
```

### Unsubscribe

```
{ 
    "type": "unsubscribe",
    "subscription": {
        "type": "userTwapStatusUpdates",
        "addresses": ["0x742d35Cc6634C0532925a3b844Bc9e7595f7F2e2"]
    }
}
```

{% hint style="info" %}
**Reconnection Note:** When reconnecting with a session, replay and live events may overlap. Deduplicate using `(time, txIndex)` - skip updates where this tuple is at or before your last processed update. See [Session Management](/readme/websocket/session-management-and-reconnection.md#deduplication) for details.
{% endhint %}

<details>

<summary>userTwapStatusUpdates data format</summary>

```json
{
  "type": "userTwapStatusUpdates",
  "channel": "userTwapStatusUpdates",
  "seq": 1,
  "cursor": "500:1704067200000:3",
  "updates": [
    {
      "time": "2025-09-03T10:48:14.285201806", // time of update
      "createdAt": 1756896494285, // time of creation
      "twapId": 12345,
      "user": "0x742d35cc6634c0532925a3b844bc9e7595f7f2e2",
      "coin": "ETH",
      "side": "B",

      "status": "activated", // can be activated, finished, terminated, stopped, waitingForTrigger or error
      "statusMessage": null, // only non null when status is error

      "sz": "100.5",
      "minutes": 60,
      "reduceOnly": false,
      "randomize": true,

      "executedSz": "25.125",
      "executedNtl": "50250.0",
      "txIndex": 3,

      // only present on trigger TWAPs: the TWAP activates when the mark
      // price crosses triggerPx in the direction given by triggerAbove
      "triggerPx": "3500.0",
      "triggerAbove": true,
      "stopPx": "3200.0" // only present when a stop price is attached
    }
  ]
}

```

</details>

### Examples

{% tabs %}
{% tab title="Javascript" %}

```javascript
const WebSocket = require('ws');

const ws = new WebSocket('wss://api.hydromancer.xyz/ws', {
    headers: { 'Authorization': `Bearer ${process.env.HYDROMANCER_API_KEY}` }
});

ws.on('open', () => {
    ws.send(JSON.stringify({
        method: 'subscribe',
        subscription: {
            type: 'userTwapStatusUpdates',
            addresses: ['0x010461c14e146ac35fe42271bdc1134ee31c703a']
        }
    }));
});

ws.on('message', (data) => {
    const msg = JSON.parse(data);
    if (msg.type === 'userTwapStatusUpdates') {
        for (const update of msg.updates) {
            console.log(`${update.user} ${update.coin} ${update.status}`);
        }
    }
});
```

{% endtab %}

{% tab title="Python" %}

```python
import json
import os
import websocket

def on_open(ws):
    ws.send(json.dumps({
        "method": "subscribe",
        "subscription": {
            "type": "userTwapStatusUpdates",
            "addresses": ["0x010461c14e146ac35fe42271bdc1134ee31c703a"]
        }
    }))

def on_message(ws, message):
    msg = json.loads(message)
    if msg.get("type") == "userTwapStatusUpdates":
        for update in msg["updates"]:
            print(f"{update['user']} {update['coin']} {update['status']}")

ws = websocket.WebSocketApp(
    "wss://api.hydromancer.xyz/ws",
    header={"Authorization": f"Bearer {os.environ['HYDROMANCER_API_KEY']}"},
    on_open=on_open,
    on_message=on_message,
)
ws.run_forever()
```

{% endtab %}
{% endtabs %}
