# Could not find a push corresponding to agg_traded in book_ticker

Is the update interval for Binance’s book_ticker 1ms? Sometimes when an agg_trade is pushed, there is no change in book_ticker, and the corresponding push information for the agg_trade’s quantity cannot be found in book_ticker either.

`bookTicker` represents the quantity for the best price currently on the book. While `aggTrade` streams show the quantity traded. Also note that a single order with big enough quantity might result in multiple aggtrades.

For example, suppose the ask side of the order book looks like this:

``````  3.22000000 @ 21.52
544.73000000 @ 21.53
``````

Then someone places a LIMIT order to buy 9.58 SOL at 21.55 BUSD.

This completely consumes the ask at 21.52 and then eats into the next level for the remaining quantity. Two aggregate trades happen at different prices, but it’s a single update to best price & quantity which goes from 3.22 @ 21.52 to 538.37 @ 21.53 as a result of that one order being filled.

Can I understand it this way? A taker order will only generate one book_ticker push (which also applies when the best price is broken).

I try to use diff_book_depth to find out the book_ticker corresponding to aggTrade. Below is my logic:

diff_book_depth[“E”]:1679375742706=<book_ticker[“E”]:1679375742778<=diff_book_depth[“E”]:1679375742806

diff_book_depth[“U”] should happen at diff_book_depth[“E”]:1679375742806

get diff_book_depth[“U”]:2754989225<=diff_book_depth[“U”]<=diff_book_depth[“U”]:2754989236

But from diff_book_depth[“U”]:2754989225<=diff_book_depth[“U”]<=diff_book_depth[“U”]:2754989236 there is only about a 95% chance of getting the book_ticker corresponding to aggTrade.

Do I need to use @trade to proceed?

Can I understand it this way? A taker order will only generate one book_ticker push?

Correct. A taker order generates a single `bookTicker` push, with the new best price & quantity after that order is done taking.

A maker order can push a `bookTicker` event too, if it adds quantity to the current best price, or offers a better price.

Note that `bookTicker` events are also pushed when orders with the best price are canceled. Not every `bookTicker` event corresponds to a trade.

This makes it quite non-trivial to correlate `bookTicker` events with `aggTrade`.

I try to use diff_book_depth to find out the book_ticker corresponding to aggTrade.

I’m afraid `depth` streams won’t help a lot here, besides being an indirect and imprecise way to infer the `"E"` value for `bookTicker` events. `depth` streams are throttled: that is, events are only pushed every 100 ms, not in real-time like `bookTicker` or `aggTrade`. Between two consecutive partial depth events there can be multiple `bookTicker` and `aggTrade` events, which you still need to match somehow.

Listening to the `trade` stream can help figure out which `aggTrade` events are caused by a single order. The first trade always happens at the current best price.

However, you must be very careful in tracking the best price, since events are only properly sequential in individual streams. That is, you can receive `bookTicker` events after corresponding `aggTrade`, or the other way around, they are not synchronized.

Here’s an example from listening to `wss://stream.binance.com/stream?streams=solbusd@trade/solbusd@aggTrade/solbusd@bookTicker`

Example
``````Maker BUY orders placed at 22.18.
Note that "u" are not contiguous. That are updates not at the best price.

{"stream":"solbusd@bookTicker","data":{"u":2755642659,"s":"SOLBUSD","b":"22.18000000","B":"901.11000000","a":"22.19000000","A":"50.33000000"}}
{"stream":"solbusd@bookTicker","data":{"u":2755642668,"s":"SOLBUSD","b":"22.18000000","B":"946.35000000","a":"22.19000000","A":"50.33000000"}}
{"stream":"solbusd@bookTicker","data":{"u":2755642671,"s":"SOLBUSD","b":"22.18000000","B":"949.54000000","a":"22.19000000","A":"50.33000000"}}

A single BUY order filled at 22.19, taking 50.33 - 26.72 = 23.61 in multiple trades.
This time "bookTicker" arrived before the "aggTrade".

{"stream":"solbusd@bookTicker","data":{"u":2755642676,"s":"SOLBUSD","b":"22.18000000","B":"949.54000000","a":"22.19000000","A":"26.72000000"}}

Another BUY order at 22.19 takes 26.72 - 24.57 = 2.15:

{"stream":"solbusd@bookTicker","data":{"u":2755642678,"s":"SOLBUSD","b":"22.18000000","B":"949.54000000","a":"22.19000000","A":"24.57000000"}}

And one more BUY order -- a different one (see "b") –– takes 24.57 - 23.61 = 0.96.
This time "bookTicker" arrived after "trade".

{"stream":"solbusd@bookTicker","data":{"u":2755642680,"s":"SOLBUSD","b":"22.18000000","B":"949.54000000","a":"22.19000000","A":"23.61000000"}}

Another BUY order takes the entire 22.19 level:

{"stream":"solbusd@bookTicker","data":{"u":2755642693,"s":"SOLBUSD","b":"22.18000000","B":"949.54000000","a":"22.20000000","A":"1369.03000000"}}

Placing maker SELL order at 22.20:

{"stream":"solbusd@bookTicker","data":{"u":2755642694,"s":"SOLBUSD","b":"22.18000000","B":"949.54000000","a":"22.20000000","A":"1475.21000000"}}

Placing maker BUY orders at 22.19 -- and some other updates in between:

{"stream":"solbusd@bookTicker","data":{"u":2755642695,"s":"SOLBUSD","b":"22.19000000","B":"121.09000000","a":"22.20000000","A":"1475.21000000"}}
{"stream":"solbusd@bookTicker","data":{"u":2755642699,"s":"SOLBUSD","b":"22.19000000","B":"125.26000000","a":"22.20000000","A":"1475.21000000"}}
{"stream":"solbusd@bookTicker","data":{"u":2755642700,"s":"SOLBUSD","b":"22.19000000","B":"128.78000000","a":"22.20000000","A":"1475.21000000"}}
{"stream":"solbusd@bookTicker","data":{"u":2755642705,"s":"SOLBUSD","b":"22.19000000","B":"130.45000000","a":"22.20000000","A":"1475.21000000"}}

Placing maker SELL order at 22.20:

{"stream":"solbusd@bookTicker","data":{"u":2755642722,"s":"SOLBUSD","b":"22.19000000","B":"130.45000000","a":"22.20000000","A":"1578.68000000"}}

Filling SELL order at 22.19 for 130.45 - 115.13 = 15.32:

{"stream":"solbusd@bookTicker","data":{"u":2755642724,"s":"SOLBUSD","b":"22.19000000","B":"115.13000000","a":"22.20000000","A":"1578.68000000"}}

Some SELL orders at 22.20 are being canceled:

{"stream":"solbusd@bookTicker","data":{"u":2755642725,"s":"SOLBUSD","b":"22.19000000","B":"115.13000000","a":"22.20000000","A":"1475.21000000"}}
{"stream":"solbusd@bookTicker","data":{"u":2755642726,"s":"SOLBUSD","b":"22.19000000","B":"115.13000000","a":"22.20000000","A":"933.33000000"}}
{"stream":"solbusd@bookTicker","data":{"u":2755642727,"s":"SOLBUSD","b":"22.19000000","B":"115.13000000","a":"22.20000000","A":"835.71000000"}}
``````

After trying to use Combined stream, there are still some omissions
`

`
Example

``````1679441181.2175071 : {"stream":"solbusd@bookTicker","data":{"u":2757515350,"s":"SOLBUSD","b":"22.60000000","B":"136.10000000","a":"22.61000000","A":"466.66000000"}}
1679441181.217715 : {"stream":"solbusd@bookTicker","data":{"u":2757515352,"s":"SOLBUSD","b":"22.60000000","B":"136.10000000","a":"22.61000000","A":"468.43000000"}}
#issue a sell order with quantity 136.1 >>> 136.1 - 136.1 = 0 "b"update to 22.59
1679441181.221313 : {"stream":"solbusd@bookTicker","data":{"u":2757515353,"s":"SOLBUSD","b":"22.59000000","B":"368.08000000","a":"22.61000000","A":"468.43000000"}}
1679441181.2224681 : {"stream":"solbusd@bookTicker","data":{"u":2757515354,"s":"SOLBUSD","b":"22.60000000","B":"43.20000000","a":"22.61000000","A":"468.43000000"}}
1679441181.222783 : {"stream":"solbusd@bookTicker","data":{"u":2757515355,"s":"SOLBUSD","b":"22.60000000","B":"194.61000000","a":"22.61000000","A":"468.43000000"}}
1679441181.2231958 : {"stream":"solbusd@bookTicker","data":{"u":2757515356,"s":"SOLBUSD","b":"22.60000000","B":"194.61000000","a":"22.61000000","A":"511.65000000"}}
1679441181.223331 : {"stream":"solbusd@bookTicker","data":{"u":2757515357,"s":"SOLBUSD","b":"22.60000000","B":"194.61000000","a":"22.61000000","A":"725.59000000"}}
1679441181.2242281 : {"stream":"solbusd@bookTicker","data":{"u":2757515358,"s":"SOLBUSD","b":"22.60000000","B":"199.20000000","a":"22.61000000","A":"725.59000000"}}
1679441181.2279198 : {"stream":"solbusd@bookTicker","data":{"u":2757515359,"s":"SOLBUSD","b":"22.60000000","B":"199.20000000","a":"22.61000000","A":"734.62000000"}}
1679441181.2351859 : {"stream":"solbusd@bookTicker","data":{"u":2757515360,"s":"SOLBUSD","b":"22.60000000","B":"199.20000000","a":"22.61000000","A":"754.62000000"}}
1679441181.2904031 : {"stream":"solbusd@bookTicker","data":{"u":2757515363,"s":"SOLBUSD","b":"22.60000000","B":"199.20000000","a":"22.61000000","A":"863.56000000"}}
1679441181.558026 : {"stream":"solbusd@bookTicker","data":{"u":2757515370,"s":"SOLBUSD","b":"22.60000000","B":"199.20000000","a":"22.61000000","A":"865.33000000"}}
1679441181.5681741 : {"stream":"solbusd@bookTicker","data":{"u":2757515371,"s":"SOLBUSD","b":"22.60000000","B":"269.70000000","a":"22.61000000","A":"865.33000000"}}
1679441182.35993 : {"stream":"solbusd@bookTicker","data":{"u":2757515374,"s":"SOLBUSD","b":"22.60000000","B":"199.20000000","a":"22.61000000","A":"865.33000000"}}
1679441182.3763058 : {"stream":"solbusd@bookTicker","data":{"u":2757515376,"s":"SOLBUSD","b":"22.60000000","B":"221.29000000","a":"22.61000000","A":"865.33000000"}}
1679441182.396995 : {"stream":"solbusd@bookTicker","data":{"u":2757515377,"s":"SOLBUSD","b":"22.60000000","B":"199.20000000","a":"22.61000000","A":"865.33000000"}}
1679441182.54904 : {"stream":"solbusd@bookTicker","data":{"u":2757515378,"s":"SOLBUSD","b":"22.60000000","B":"269.70000000","a":"22.61000000","A":"865.33000000"}}
1679441182.946325 : {"stream":"solbusd@bookTicker","data":{"u":2757515379,"s":"SOLBUSD","b":"22.60000000","B":"199.20000000","a":"22.61000000","A":"865.33000000"}}
1679441183.2433972 : {"stream":"solbusd@bookTicker","data":{"u":2757515380,"s":"SOLBUSD","b":"22.60000000","B":"269.70000000","a":"22.61000000","A":"865.33000000"}}
1679441183.355008 : {"stream":"solbusd@bookTicker","data":{"u":2757515381,"s":"SOLBUSD","b":"22.60000000","B":"291.79000000","a":"22.61000000","A":"865.33000000"}}
1679441184.3611462 : {"stream":"solbusd@bookTicker","data":{"u":2757515383,"s":"SOLBUSD","b":"22.60000000","B":"407.30000000","a":"22.61000000","A":"865.33000000"}}
1679441185.754037 : {"stream":"solbusd@bookTicker","data":{"u":2757515386,"s":"SOLBUSD","b":"22.60000000","B":"407.30000000","a":"22.61000000","A":"863.56000000"}}
1679441185.889375 : {"stream":"solbusd@bookTicker","data":{"u":2757515387,"s":"SOLBUSD","b":"22.60000000","B":"461.49000000","a":"22.61000000","A":"863.56000000"}}
1679441186.43463 : {"stream":"solbusd@bookTicker","data":{"u":2757515392,"s":"SOLBUSD","b":"22.60000000","B":"505.68000000","a":"22.61000000","A":"863.56000000"}}
1679441186.558835 : {"stream":"solbusd@bookTicker","data":{"u":2757515393,"s":"SOLBUSD","b":"22.60000000","B":"505.68000000","a":"22.61000000","A":"861.79000000"}}
1679441186.640162 : {"stream":"solbusd@bookTicker","data":{"u":2757515394,"s":"SOLBUSD","b":"22.60000000","B":"536.78000000","a":"22.61000000","A":"861.79000000"}}
1679441186.647561 : {"stream":"solbusd@bookTicker","data":{"u":2757515396,"s":"SOLBUSD","b":"22.60000000","B":"536.78000000","a":"22.61000000","A":"852.76000000"}}
1679441186.660161 : {"stream":"solbusd@bookTicker","data":{"u":2757515397,"s":"SOLBUSD","b":"22.60000000","B":"536.78000000","a":"22.61000000","A":"743.82000000"}}
1679441186.856002 : {"stream":"solbusd@bookTicker","data":{"u":2757515399,"s":"SOLBUSD","b":"22.60000000","B":"536.78000000","a":"22.61000000","A":"726.13000000"}}
1679441187.0588439 : {"stream":"solbusd@bookTicker","data":{"u":2757515402,"s":"SOLBUSD","b":"22.60000000","B":"538.55000000","a":"22.61000000","A":"726.13000000"}}
1679441187.199862 : {"stream":"solbusd@bookTicker","data":{"u":2757515403,"s":"SOLBUSD","b":"22.60000000","B":"540.32000000","a":"22.61000000","A":"726.13000000"}}
1679441189.001569 : {"stream":"solbusd@bookTicker","data":{"u":2757515405,"s":"SOLBUSD","b":"22.60000000","B":"540.32000000","a":"22.61000000","A":"681.95000000"}}
1679441189.026519 : {"stream":"solbusd@bookTicker","data":{"u":2757515407,"s":"SOLBUSD","b":"22.60000000","B":"540.32000000","a":"22.61000000","A":"661.95000000"}}
1679441189.082249 : {"stream":"solbusd@bookTicker","data":{"u":2757515411,"s":"SOLBUSD","b":"22.60000000","B":"587.50000000","a":"22.61000000","A":"661.95000000"}}
1679441189.087908 : {"stream":"solbusd@bookTicker","data":{"u":2757515413,"s":"SOLBUSD","b":"22.60000000","B":"587.50000000","a":"22.61000000","A":"639.86000000"}}
1679441189.1225011 : {"stream":"solbusd@bookTicker","data":{"u":2757515417,"s":"SOLBUSD","b":"22.60000000","B":"596.49000000","a":"22.61000000","A":"639.86000000"}}
1679441189.155346 : {"stream":"solbusd@bookTicker","data":{"u":2757515419,"s":"SOLBUSD","b":"22.60000000","B":"596.49000000","a":"22.61000000","A":"596.64000000"}}
1679441189.155555 : {"stream":"solbusd@bookTicker","data":{"u":2757515420,"s":"SOLBUSD","b":"22.60000000","B":"596.49000000","a":"22.61000000","A":"382.70000000"}}
1679441189.158875 : {"stream":"solbusd@bookTicker","data":{"u":2757515422,"s":"SOLBUSD","b":"22.60000000","B":"596.49000000","a":"22.61000000","A":"322.33000000"}}
1679441189.747564 : {"stream":"solbusd@bookTicker","data":{"u":2757515423,"s":"SOLBUSD","b":"22.60000000","B":"816.49000000","a":"22.61000000","A":"322.33000000"}}
1679441190.849649 : {"stream":"solbusd@bookTicker","data":{"u":2757515438,"s":"SOLBUSD","b":"22.60000000","B":"816.49000000","a":"22.61000000","A":"271.96000000"}}
1679441190.8574982 : {"stream":"solbusd@bookTicker","data":{"u":2757515442,"s":"SOLBUSD","b":"22.60000000","B":"816.49000000","a":"22.61000000","A":"266.96000000"}}
1679441190.858476 : {"stream":"solbusd@bookTicker","data":{"u":2757515443,"s":"SOLBUSD","b":"22.60000000","B":"821.47000000","a":"22.61000000","A":"266.96000000"}}
1679441190.874101 : {"stream":"solbusd@bookTicker","data":{"u":2757515447,"s":"SOLBUSD","b":"22.60000000","B":"821.47000000","a":"22.61000000","A":"157.27000000"}}
1679441190.879039 : {"stream":"solbusd@bookTicker","data":{"u":2757515448,"s":"SOLBUSD","b":"22.60000000","B":"821.47000000","a":"22.61000000","A":"179.35000000"}}
1679441190.887159 : {"stream":"solbusd@bookTicker","data":{"u":2757515452,"s":"SOLBUSD","b":"22.60000000","B":"880.43000000","a":"22.61000000","A":"179.35000000"}}
1679441190.893297 : {"stream":"solbusd@bookTicker","data":{"u":2757515456,"s":"SOLBUSD","b":"22.60000000","B":"923.63000000","a":"22.61000000","A":"179.35000000"}}
1679441190.9041321 : {"stream":"solbusd@bookTicker","data":{"u":2757515459,"s":"SOLBUSD","b":"22.60000000","B":"923.63000000","a":"22.61000000","A":"120.22000000"}}
#issue a buy order with quantity 46.41