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:

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

< [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"]

Last updated

Was this helpful?