coinbase/coinbase-pro-trading-toolkit

ticker channel / tickers with trade prices which are not best bid neither best ask

Closed this issue · 1 comments

When subbed to ticker channel, received tickers come with following labels: product_id / price / best_bid / best_ask / side / trade_id / last_size
For some tickers, trade price is not at the best bid neither at the best ask. Is it a mismatch from the server or does it have a specific meaning?
As API documentation specifies :

It batches updates in case of cascading matches, greatly reducing bandwidth requirements.

does it mean that if a metaorder is passed which consumes entirely the best bid, the price registered in the ticker is the last final price after market impact? Similarly, are the lines best_bid and best_ask the best bid and ask registered after order is passed or before?

CjS77 commented

The last trade price is often at best bid/ask, but is not necessarily the case. I don't think there's a bug here.

Consider this book:

bids:
  0.1 100
  1.0 98
asks:
  1.0 105
  0.5 106

If a sell order for 0.1 comes in, it will fill completely at 100 and the order book will now look like:

bids:
  1.0 98
asks:
  1.0 105
  0.5 106

Meaning that the ticker will now return:

{ price: 100, bid: 98, ask: 105 }