How to get real time bid / ask / price from GDAX websocket feed

Viewed 9401

The API doc discourages polling on /ticker endpoint, and recommend to use the websocket stream to listen for match message

But the match response only provide a price and a side (sell / buy)

How can I recreate the ticker data (price, ask and bid) from the websocket feed ?

{
  “price”: “333.99”,
  “size”: “0.193”,
  “bid”: “333.98”,
  “ask”: “333.99”,
  “volume”: “5957.11914015”,
  “time”: “2015-11-14T20:46:03.511254Z”
}

The ticker endpoint and the websocket feed both return a 'price', but I guess that it's not the same. Is the price from the ticker endpoint some sort of average over time ?

How can I compute Bid value, Ask value ?

1 Answers
Related