bloXroute Documentation
WebsiteBlogTwitterDiscord
  • Welcome to bloXroute
  • Introduction
    • Why Use bloXroute?
    • Products
    • Create An Account
    • Technical Support
  • SOLANA
    • Trader API
      • Introduction
        • Regions
        • Authorization
        • Rate Limits
        • Tip and Tipping Addresses
      • Quick Start
        • Transaction Submission
        • Front-Running Protection & Transaction Bundle
        • Go SDK
        • Python SDK
        • Typescript SDK
        • Rust SDK
      • API Endpoints
        • Core Endpoints
          • submit
          • submit-paladin
          • submit-batch
          • balance
          • rate-limit
          • transaction
          • priority-fee
          • GetPriorityFeeStream
          • GetBundleTipStream
          • submit-snipe
        • Pump.fun
          • quotes
          • swap
          • swap-sol
          • GetPumpFunNewTokensStream
          • GetPumpFunSwapsStream
          • GetPumpFunAMMSwapsStream
        • Raydium
          • quotes
          • pools
          • pool-reserves
          • swap
          • cpmm-swap
          • clmm-swap
          • route-swap
          • GetPoolReservesStream
          • GetSwapsStream
          • GetNewRaydiumPoolsStream
          • GetNewRaydiumPoolsByTransactionStream
        • Jupiter
          • quotes
          • swap
          • swap-instructions
          • route-swap
        • Openbook
          • markets
          • orderbooks/{market}
          • depth/{market}
          • tickers/{market}
          • open-orders/{market}
          • unsettled/{market}
          • place
          • replace
          • cancel
          • settle
          • GetOrderbooksStream
          • GetTickersStream
      • Best Performance for Landing Transactions
      • Support
        • API Health
        • Contact us
        • Suggestions
        • Wiki
          • Terms & Concepts
          • Resources
    • Optimized Feed Relay (OFR)
      • Transaction Streamer
      • Gateway and OFR Requirements
      • Gateway and OFR Setup
      • Gateway Startup Arguments
      • OFR performance
      • Logging
      • Submitting Transaction
      • Upgrading Gateway
      • Troubleshooting
  • BSC & ETH
    • EVM Blockchain Distribution Network (BDN)
      • How to Connect
      • The bloXroute Gateway
        • Local Gateway
          • Installation and Startup
            • Authentication & Certificates
            • Requirements
            • Supported Clients
            • GitHub repository option
            • Docker container option
            • Startup Script
            • Startup Arguments
          • General Connectivity Troubleshooting
          • Logging
          • Upgrading your Gateway
        • Add Your Gateway as a Trusted Peer to Your Execution Layer Client
        • Connecting Your Gateway with the Consensus Layer
      • IPs & Relays
        • Relays IPs
        • Private Relays
        • Cloud-API IPs
          • ⏩Reducing Latencies using the BDN
    • APIs
      • Authorization
      • Check Transaction Quota
      • Submit a Transaction
        • Raw Transaction Construction
        • Tx-Validation
        • Batch Transaction
      • Private Transactions
        • ETH Private Transactions
        • BSC Private Transactions
      • Transaction Bundles
        • Bundle Simulation
        • Bundle Validation
        • Bundle Submission
          • BSC Bundle Submission
            • List of BSC Validators
          • ETH Bundle Submission
          • Bundle Submission with Gateway
        • Bundle Tracking
          • BSC Bundle-Trace
          • ETH Bundle-Trace
          • ETH Bundle Inclusion Status
        • Bundle Refunds
          • Priority Fee Refund
          • Bundle Refund
          • Latest Bundle Refunds
      • Backrun Arbitrage
        • BackRunMe: Bundle Submission
          • BSC submit arbOnly
          • ETH submit arbOnly
            • blxr_info
            • ETH arbOnly Simulation
      • Token Launch Sniping
      • Other Utilities
        • List of bloXroute Builders
        • List of External Builders
        • Tx-Trace
        • Ping
    • Streams
      • Requirements
      • Subscription limits
      • Working With Streams
        • Creating a Subscription
          • Websocket
          • gRPC
        • Handling the Notification
          • Websocket
          • gRPC
        • Cancelling a Subscription
          • Websocket
          • gRPC
        • Local Node Validation
      • newTxs and pendingTxs
        • Filters
        • Raw TX Reconstruction
      • BackRunMe: arbOnlyMEV
        • ETH arbOnlyMEV
        • BSC arbOnlyMEV
      • transactionStatus
      • txReceipts
      • newBlocks
      • bdnBlocks
      • ethOnBlock
      • MEVBlockValue
      • MEVNextProposerInfo
    • Block Builders and Validators
      • Validator Gateway
      • MEV Relay (For Validators)
      • Block Submission
      • Proposer MEV-Protect
      • Compliance Lists
      • Preconfirmations
    • Protect RPCs
      • ETH Protect RPC
      • ETH Gas Protect RPC
      • BSC Protect RPC
      • SOL Protect RPC
  • Base Network
    • Submit Transactions
    • Streams
      • GetBdnBlockStream
  • TON NETWORK
    • TON Trader API
      • Quick Start
      • Fee Schedule
      • Connection
      • Submit Signed Transaction
  • Resources
    • BDN Explorer
    • Block Explorer
    • Guides
      • Algorithmic Trading
      • Setting Up a Local Gateway
      • Gateway as Web3 Bridge
    • Architecture
      • BDN Architecture
        • Network Components
        • Performance Techniques
          • Block Compression
          • Cut-through Routing
          • Optimized Topology
      • bloXroute Protocol
        • Versioning
        • Message Structure
        • Message Types
    • Contact Us
Powered by GitBook
On this page

Last updated 4 months ago

Subscribe

Method:

Parameters:

Parameter
Type
Description

Subscribe:

Even Result Details:

Field
Type
Description

orderbook

Field
Type
Description

bids & asks

Sample event:

Field
Type
Description
GetOrderbooksStream

markets

array

A list of Solana program addresses or market symbols.

limit

number

OPTIONAL. The maximum number of orders to fetch on both sides. If not specified, gets the whole orderbook.

wscat --header "Authorization: $AUTH_HEADER" \
-c wss://ny.solana.dex.blxrbdn.com/ws --wait 1000 --execute '{"jsonrpc": "2.0", "id": 1, "method": "subscribe", "params": ["GetOrderbooksStream", {"markets": ["SOL/USDC"], "limit": 10}]}'
//Make sure to set environment variable AUTH_HEADER.
stream, err := w.GetOrderbooksStream(ctx, []string{"SOL/USDC"}, 3)
if err != nil {
	panic(err)
}

orderbookCh := stream.Channel(0)
for i := 1; i <= 5; i++ {
	update, ok := <-orderbookCh
	fmt.Println(update)
}
# Make sure to set environment variable AUTH_HEADER.
async for response in api.get_orderbooks_stream(market="["SOLUSDC"]"):
    print(response.to_json())
await provider.getOrderbooksStream({
    markets: ["SOLUSDC"],
    project: "P_OPENBOOK",
    limit: 5,
})

slot

string

The slot number.

orderbook

string

See orderbook below for details.

market

string

Symbol of the market.

marketAddress

string

The program address the target market.

project

string

Name of the DEX project. "P_OPENBOOK", "P_SERUM"

bids

list

See bids & asks below for details. Sorted by price in descending order.

asks

list

See bids & asks below for details. Sorted by price in ascending order.

price

number

The price of the order (in quote/base currency).

size

number

The size of the order (in base currency).

{
    "method":"subscribe",
    "params":{
        "subscription":"1b9c7fd7-69a3-4aab-8c23-3c6f9d9684b6",
        "result":{
            "slot":"150678295",
            "orderbook":{
                "market":"SOL/USDC",
                "project": "S_SERUM",
                "marketAddress":"9wFFyRfZBsuAha4YcuxcXLKwMxJR43S7fPfQLusDBzvT",
                "bids":[
                    {
                        "price":33.333,
                        "size":0.1
                    },
                    {
                        "price":33.334,
                        "size":0.1
                    },
                    {
                        "price":33.34,
                        "size":201.9
                    },
                    {    
                        "price":33.344,
                        "size":0.1
                    },
                    {
                        "price":33.365,
                        "size":0.1
                    }
                ],
                "asks":[
                    {
                        "price":33.389,
                        "size":59.7
                    },
                    {
                        "price":33.391,
                        "size":406.2
                    },
                    {
                        "price":33.392,
                        "size":149.8
                    },
                    {
                        "price":33.401,
                        "size":60.5
                    },
                    {
                        "price":33.403,
                        "size":89.8
                    }
                ]
            }
        }
    },
    "jsonrpc":"2.0"}
  1. SOLANA
  2. Trader API
  3. API Endpoints
  4. Openbook

GetOrderbooksStream

This channel provides orderbook data specified by the market. It will tick every time there were updates in the targeted market.

PrevioussettleNextGetTickersStream