Skip to content

Commit e0c89c7

Browse files
authored
add note for local order book management (binance#83)
* add note for local order book management
1 parent 451c182 commit e0c89c7

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

web-socket-streams.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
33
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
44

5+
- [Web Socket Streams for Binance (2019-11-13)](#web-socket-streams-for-binance-2019-11-13)
56
- [General WSS information](#general-wss-information)
67
- [Websocket Limits](#websocket-limits)
78
- [Live Subscribing/Unsubscribing to streams](#live-subscribingunsubscribing-to-streams)
@@ -10,6 +11,7 @@
1011
- [Listing Subscriptions](#listing-subscriptions)
1112
- [Setting Properties](#setting-properties)
1213
- [Retrieving Properties](#retrieving-properties)
14+
- [Error Messages](#error-messages)
1315
- [Detailed Stream information](#detailed-stream-information)
1416
- [Aggregate Trade Streams](#aggregate-trade-streams)
1517
- [Trade Streams](#trade-streams)
@@ -465,3 +467,6 @@ Order book price and quantity depth updates used to locally manage an order book
465467
7. The data in each event is the **absolute** quantity for a price level.
466468
8. If the quantity is 0, **remove** the price level.
467469
9. Receiving an event that removes a price level that is not in your local order book can happen and is normal.
470+
471+
Note:
472+
Due to depth snapshots having a limit on the number of price levels, a price level outside of the initial snapshot that doesn't have a quantity change won't have an update in the Diff. Depth Stream. Consequently, those price levels will not be visible in the local order book even when applying all updates from the Diff. Depth Stream correctly and cause the local order book to have some slight differences with the real order book. However, for most use cases the depth limit of 5000 is enough to understand the market and trade effectively.

web-socket-streams_CN.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,3 +282,6 @@ m -> 分钟; h -> 小时; d -> 天; w -> 周; M -> 月
282282
6. 每一个新event的`U`应该恰好等于上一个event的`u`+1,否则可能出现了丢包,请从step3重新进行初始化。
283283
7. 每一个event中的挂单量代表这个价格目前的挂单量**绝对值**,而不是相对变化。
284284
8. 如果某个价格对应的挂单量为0,表示该价位的挂单已经撤单或者被吃,应该移除这个价位。
285+
286+
注意:
287+
因为深度快照对价格档位数量有限制,初始快照之外的价格档位并且没有数量变化的价格档位不会出现在增量深度的更新信息内。因此,即使应用来自增量深度的所有更新,这些价格档位也不会在本地 order book 中可见,所以本地的 order book 与真实的 order book 可能会有一些差异。 不过对于大多数用例,5000 的深度限制足以有效地了解市场和交易。

0 commit comments

Comments
 (0)