When connected to wss://stream.binance.com:9443/ws/ethusdt@depth
in place of a quantity i sometimes (in fact quite often) get 0 like in example message:
{
"e": "depthUpdate",
"E": 1623439441427,
"s": "ETHUSDT",
"U": 8550164870,
"u": 8550165574,
"b": [
[
"2406.49000000",
"0.00000000"
],
[
"2406.48000000",
"0.00000000"
],
[
"2406.35000000",
"0.00000000"
],
[
"2406.25000000",
"0.00000000"
],
[
"2406.23000000",
"0.00000000"
],
[
"2406.21000000",
"0.00000000"
],
[
"2406.20000000",
"0.00000000"
],
[
"2406.19000000",
"0.00000000"
],
[
"2406.17000000",
"0.00000000"
],
[
"2406.16000000",
"0.00000000"
],
[
"2406.15000000",
"0.00000000"
],
[
"2406.14000000",
"0.00000000"
],
[
"2406.01000000",
"0.00000000"
],
[
"2405.99000000",
"0.00000000"
],
[
"2405.97000000",
"0.00000000"
],
[
"2405.96000000",
"0.00000000"
],
[
"2405.95000000",
"0.00000000"
],
[
"2405.94000000",
"0.00000000"
],
[
"2405.93000000",
"0.00000000"
],
[
"2405.86000000",
"0.00000000"
],
],
"a": [
[
"2405.59000000",
"0.00000000"
],
[
"2405.60000000",
"0.00000000"
],
[
"2405.61000000",
"0.00000000"
],
[
"2405.64000000",
"0.00000000"
],
[
"2405.65000000",
"0.00000000"
],
[
"2405.66000000",
"0.95380000"
],
[
"2405.67000000",
"8.00000000"
],
[
"2405.83000000",
"0.00000000"
],
[
"2406.10000000",
"0.98850000"
],
[
"2406.11000000",
"3.31912000"
],
[
"2406.12000000",
"3.28392000"
],
[
"2406.13000000",
"0.00000000"
],
[
"2406.16000000",
"0.00000000"
],
[
"2406.17000000",
"0.00000000"
],
[
"2406.18000000",
"0.00000000"
],
[
"2406.19000000",
"0.32100000"
],
[
"2406.20000000",
"0.00000000"
],
[
"2406.21000000",
"0.00000000"
],
[
"2406.22000000",
"0.00000000"
],
[
"2406.23000000",
"0.00000000"
],
[
"2406.26000000",
"1.00000000"
],
[
"2406.29000000",
"3.00000000"
],
[
"2406.30000000",
"0.75917000"
],
[
"2406.31000000",
"0.00000000"
],
[
"2406.36000000",
"0.00000000"
],
[
"2406.37000000",
"0.54000000"
],
[
"2406.46000000",
"7.81255000"
],
[
"2406.47000000",
"10.38000000"
],
[
"2406.48000000",
"3.00000000"
],
[
"2406.49000000",
"1.50103000"
],
[
"2406.50000000",
"0.00000000"
],
[
"2406.51000000",
"1.48621000"
],
[
"2406.62000000",
"0.00000000"
],
[
"2406.63000000",
"9.40536000"
],
[
"2406.64000000",
"17.91499000"
],
[
"2406.70000000",
"2.76583000"
],
[
"2406.78000000",
"0.00000000"
],
[
"2406.79000000",
"0.00000000"
],
[
"2406.80000000",
"0.06000000"
],
[
"2406.81000000",
"0.00000000"
],
[
"2406.83000000",
"0.00000000"
],
]
}
Here the second number in each pair represents Bid or Ask quantity. I get the same exact behavior in Postman and using rust client library on other coin pairs as well. Is it intentional or some kind of a bug?
This is normal. I don't know why binance does not fix this, but as API doc say you should ignore it.
How to manage a local order book correctly
If the quantity is 0, remove the price level.