Stream Orderbooks

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

Subscribe

Parameters:

ParameterTypeDescription

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.

Subscribe:

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}]}'

Even Result Details:

FieldTypeDescription

slot

string

The slot number.

orderbook

string

See orderbook below for details.

orderbook

FieldTypeDescription

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.

bids & asks

FieldTypeDescription

price

number

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

size

number

The size of the order (in base currency).

Sample event:

{
    "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"}

Last updated