Skip to main content

Documentation Index

Fetch the complete documentation index at: https://developer.wooxpro.com/llms.txt

Use this file to discover all available pages before exploring further.

【Public】Depth Channel

Get depth data

Pushing Rules

  1. No user login required
  2. After subscribing, then the changes will be pushed

Request

Request
{
  "action":"subscribe",
  "args":["futures/depth20:BTCUSDT@200ms"]
}
Message Format: {"action":"subscribe","args":["<channel:symbol><@speed>"]}
  • actions: subscribe
  • channel: Channel name, such as futures/depth20
  • symbol: Trading pair, such as BTCUSDT
  • speed: Update speed, support 200ms or 100ms

Parameters Channel Name List

Channel NameDescription
futures/depth55 Level Depth Channel
futures/depth2020 Level Depth Channel
futures/depth5050 Level Depth Channel

Response

Response
{
    "group":"futures/depth20:BTCUSDT@200ms",
    "data":{
            "symbol":"BTCUSDT",
            "way":1,
            "depths":[
              {"price":"5","vol":"97"}
            ],
            "ms_t": 1542337219120
        }
}
Return data description:
FieldTypeDescription
symbolStringSymbol of the contract(like BTCUSDT)
wayLongTrading side
-1=bid
-2=ask
depthsListArray of depth details
ms_tLongData push timestamp (in millisecond)
Instruction Description of the depths details field:
FieldTypeDescription
priceStringprice
volStringvolume

【Public】Depth-All Channel

Return depth data, each push is the full data

Pushing Rules

  1. No user login required
  2. After subscribing, then the changes will be pushed

Request

Request
{
  "action":"subscribe",
  "args":["futures/depthAll20:BTCUSDT@200ms"]
}
Message Format: {"action":"subscribe","args":["<channel:symbol><@speed>"]}
  • channel: Channel name, such asfutures/depthAll20
  • symbol: Trading pair, such asBTCUSDT
  • speed: Update speed, support 200ms or 100ms
Parameters Channel Name List
Channel NameDescription
futures/depthAll55 Level Depth Channel
futures/depthAll2020 Level Depth Channel
futures/depthAll5050 Level Depth Channel

Response

Response
{
    "data": {
        "symbol": "BTCUSDT",
        "asks": [
            {
                "price": "70294.4",
                "vol": "455"
            }
        ],
        "bids": [
            {
                "price": "70293.9",
                "vol": "1856"
            }
        ],
        "ms_t": 1730399750402
    },
    "group": "futures/depthAll20:BTCUSDT@200ms"
}
Return data description:
FieldTypeDescription
symbolStringSymbol of the contract(like BTCUSDT
asksListAsks Depth Array
bidsListBids Depth Array
ms_tLongData push timestamp (in millisecond)
Instruction Description of the asks bids details field:
FieldTypeDescription
priceStringprice
volStringvolume

【Public】Depth-Increase Channel

Return depth data, support the creation of a local full depth cache data

Pushing Rules

  1. No user login required
  2. After subscribing, the current data will be returned directly, and then the changes will be pushed

Request

Subscribe Request
{
  "action":"subscribe",
  "args":["futures/depthIncrease20:BTCUSDT@200ms"]
}
Full depth snapshot data Request
{ 
  "action": "request", 
  "args":["futures/depthIncrease20:BTCUSDT@200ms"]
}
Message Format: {"action":"<op>","args":["<channel:symbol><@speed>"]}
  • op: subscribe=Subscribe, You will receive a message that the subscription is successful, and then you will receive incremental depth data pushed in real time. request=Single request for the latest depth snapshot, You will receive a full depth of data immediately.
  • channel:Channel name, such as futures/depthIncrease20
  • symbol: Trading pair, such as BTCUSDT
  • speed: Update speed, support 200ms or 100ms
Parameters Channel Name List
Channel NameDescription
futures/depthIncrease55 Level Depth Channel
futures/depthIncrease2020 Level Depth Channel
futures/depthIncrease5050 Level Depth Channel

Response

Full depth snapshot data
{
    "data": {
        "symbol": "BTCUSDT",
        "asks": [
            {
                "price": "70391.6",
                "vol": "3550"
            }
        ],
        "bids": [
            {
                "price": "70391.2",
                "vol": "1335"
            }
        ],
        "ms_t": 1730400086184,
        "version": 980361,
        "type": "snapshot"
    },
    "group": "futures/depthIncrease20:BTCUSDT@200ms"
}
Incremental depth data
{
    "data": {
        "symbol": "BTCUSDT",
        "asks": [
            {
                "price": "70395.3",
                "vol": "341"
            },
            {
                "price": "70395.4",
                "vol": "323"
            }
        ],
        "bids": [
            {
                "price": "70391.2",
                "vol": "0"
            },
            {
                "price": "70353.4",
                "vol": "11435"
            }
        ],
        "ms_t": 1730400086194,
        "version": 980362,
        "type": "update"
    },
    "group": "futures/depthIncrease20:BTCUSDT@200ms"
}
Return data description:
FieldTypeDescription
symbolStringSymbol of the contract (like BTCUSDT)
asksListAsks Depth Array
bidsListBids Depth Array
ms_tLongData push timestamp (in millisecond)
versionLongdata version
typeStringdata type
-snapshot=Full depth snapshot data
-update=Incremental depth data
Instruction Description of the asks bids details field:
FieldTypeDescription
priceStringprice
volStringvolume

How to correctly maintain a copy of OrderBook locally:

  1. First, the client send a subscription request {"action": "subscribe", "args": ["futures/depthIncrease20:<symbol>"] }
  2. After successful subscription, you will receive two types of messages, type=snapshot(full data)和type=update(update)
  3. If a type=snapshot type message is received, update the deep snapshot content to thelocal cache. If there is no local cache, create one.
  4. If a type=update message is received, update the data in the deep snapshot to local cache. The update rules are as follows:
    • 4.1 If the field version number in the received new message is less than or equal to the version in the local cache(new version<=local version), this data can be discarded.
    • 4.2 If the field version number in the new message received is equal to the version in the local cache plus 1(new version==local version+1), the quantity of the corresponding price will be updated to the local cache.
    • 4.3 If the field version number in the new message received is greater than the version in the local cache plus 1(new version>local version+1), please obtain the latest depth snapshot from step 7 and overwrite the local cache.
  5. The pending order volume in each returned message represents the absolute value of the current pending order volume at this price, rather than the relative change.
  6. How to update local cache? Under the premise of 4.2:
    • 6.1 New: If the same price is not already in the local cache, it means that it is a new pending order and needs to be added to the cache.
    • 6.2 Modify or Remove: If the same price is already in the local cache, it means that the quantity has changed. If the quantity is 0, it will be directly removed from the cache. Otherwise, just change the quantity.
  7. Request through request {"action": "request", "args": ["futures/depthIncrease20:<symbol>"] } to obtain the latest depth snapshot (type=snapshot in the message), and add the depth The content in the snapshot is overwritten to the local cache, and then the logic continues from step 2.
  • Abnormal Situation:
    1. Because the depth snapshot has a limit on the number of price tiers, price tiers outside the initial snapshot and without quantity changes will not appear in the incremental depth update information. Therefore, even if all updates from the incremental depth are applied, these price brackets will not be visible in the local order book, so there may be some differences between the local order book and the real order book.

【Public】Individual Symbol Book Ticker Channel

Pushes any update to the best bid or ask’s price or quantity in real-time for a specified symbol

Pushing Rules

  1. No user login required
  2. After subscribing, then the changes will be pushed
  3. Real-time push

Request

Request
{
  "action":"subscribe",
  "args":["futures/bookticker:BTCUSDT"]
}
Message Format: {"action":"subscribe","args":["<channel:symbol>"]}
  • actions: subscribe
  • channel: Channel name, such as futures/bookticker
  • symbol: Trading pair, such as BTCUSDT

Response

Response
{
    "data": {
        "symbol": "BTCUSDT",
        "best_bid_price": "97315",
        "best_bid_vol": "156",
        "best_ask_price": "97315.4",
        "best_ask_vol": "333",
        "ms_t": 1733891542244
    },
    "group": "futures/bookticker:BTCUSDT"
}
Return data description:
FieldTypeDescription
symbolStringSymbol of the contract(like BTCUSDT)
best_bid_priceStringBest bid price
best_bid_volStringBest bid volume
best_ask_priceStringBest ask price
best_ask_volStringBest ask volume
ms_tLongData push timestamp (in millisecond)