LogoLogo
Launch App
  • Standard
    • Thesis
    • Core Contributors
    • Sigma
    • $STND
    • Tokenomics
    • DeFi 3.0
  • Apps
    • Spot
      • For Traders
        • Market
        • Order Type
      • For Developers
        • REST API
        • Websocket Streams
          • Connect
          • Trades
          • Orders
          • Orderhistories
          • Prices
          • Orderbook
      • For Projects
        • Listing
        • Launchpad
        • Terminal
        • Market Making
    • Vaults
  • Standard L3
    • What is Standard L3?
      • How Standard L3 works
      • Modular Architecture
      • Bridge
Powered by GitBook
On this page

Was this helpful?

  1. Apps
  2. Spot
  3. For Developers

Websocket Streams

PreviousREST APINextConnect

Last updated 26 days ago

Was this helpful?

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

wscat