# Websocket Streams

Developers can easily connect to the Standard WebSocket API to stream available market and orderbook data. We recommend using a single connection to subscribe to multiple topics. Each subscription requires the following fields:

1. id
   * An identifier chosen by the developer to easily match WebSocket responses to their corresponding subscriptions. id is used for filtering duplicate responses on stream.
2. method
   * Specifies the topic to subscribe or unsubscribe from.
3. params
   * Parameters specific to the subscription topic. When unsubscribing, the params must match the original subscription.

Example from command line using [wscat](https://github.com/websockets/wscat):

```bash
$ wscat -c  wss://rise-sepolia-websocket.standardweb3.com
Connected (press CTRL+C to quit)
>  { "id": 1, "method": "spot.trades.subscribe.pairs", "params": { "pairs": ["ETH/USDC", "WBTC/USDT"] } }
< { "result": null, "id": 1 }
```

Each stream will return in a form of array with predefined schema. This matters in high-frequency data (e.g. trades, price ticks), especially when sending **thousands of updates per second**.

```bash
< [12345, "0xBaseTokenAddress", "0xQuoteTokenAddress", "ETH", "USDC", "0xPairContractAddress", "ETH/USDC", true, 3142.25, "0xSenderAddress", "0xAssetAddress", "ETH", 1.5, 4713.375, 1.5, 4713.375, 1713657900, "0xTakerAddress", "0xMakerAddress", "0xTransactionHash"]
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.standard.im/apps/spot/for-developers/websocket-streams.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
