Websocket bar data discrepancy?

Hi there, I’m probably doing something wrong, but I’m getting different results from the websocket bar data and REST call - the websocket sends what appears to be a 1Min bar based on the timestamp (and it sends data only once per minute), but it seems to be a small slice of the minute bar dataset.

I’m using the JS framework, so with the following:

alpaca.data_stream_v2.onConnect(() => {

alpaca.data_stream_v2..onStockBar((bar) => {



    T: 'b',
    Symbol: 'QQQ',
    OpenPrice: 398.045,
    ClosePrice: 397.985,
    HighPrice: 398.045,
    LowPrice: 397.985,
    Volume: 2842,
    Timestamp: 2021-12-07T19:02:00.000Z,
    TradeCount: 26,
    VWAP: 398.001246

Whereas, with the REST call using alpaca.getBarsV2, I get:

  Timestamp: '2021-12-07T19:02:00Z',
  OpenPrice: 398.015,
  HighPrice: 398.05,
  LowPrice: 397.835,
  ClosePrice: 397.84,
  Volume: 79011,
  TradeCount: 851,
  VWAP: 397.972621

Ah, I suspect this was because I was using iex as the websocket data source, changed to sip – we’ll see what I get on Monday…

can confirm sip bar data websocket data matches the api v2 bar data