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

# useSettleSubscription

> Hook to subscribe to PnL settlement status events via WebSocket for the current account.

Subscribe to [PnL settlements](/build-on-omnichain/websocket-api/private/pnl-settlement) for current account via Websockets.

* [Tech docs](/sdks/tech-doc/modules/orderly_network_hooks#usesettlesubscription)

### Example

```ts theme={null}
useSettleSubscription({
  onMessage: (data: any) => {
    const { status } = data;

    switch (status) {
      case "COMPLETED":
        // settlement completed
        break;
      case "FAILED":
        // settlement failed
        break;
      default:
        break;
    }
  }
});
```
