diff --git a/exchanges/coinbasepro/coinbasepro_types.go b/exchanges/coinbasepro/coinbasepro_types.go index 2f14053e..f9e5b281 100644 --- a/exchanges/coinbasepro/coinbasepro_types.go +++ b/exchanges/coinbasepro/coinbasepro_types.go @@ -1,5 +1,7 @@ package coinbasepro +import "time" + // Product holds product information type Product struct { ID string `json:"id"` @@ -428,17 +430,21 @@ type WebsocketHeartBeat struct { // WebsocketTicker defines ticker websocket response type WebsocketTicker struct { - Type string `json:"type"` - Sequence int64 `json:"sequence"` - ProductID string `json:"product_id"` - Price float64 `json:"price,string"` - Open24H float64 `json:"open_24h,string"` - Volume24H float64 `json:"volumen_24h,string"` - Low24H float64 `json:"low_24h,string"` - High24H float64 `json:"high_24h,string"` - Volume30D float64 `json:"volume_30d,string"` - BestBid float64 `json:"best_bid,string"` - BestAsk float64 `json:"best_ask,string"` + Type string `json:"type"` + Sequence int64 `json:"sequence"` + ProductID string `json:"product_id"` + Price float64 `json:"price,string"` + Open24H float64 `json:"open_24h,string"` + Volume24H float64 `json:"volumen_24h,string"` + Low24H float64 `json:"low_24h,string"` + High24H float64 `json:"high_24h,string"` + Volume30D float64 `json:"volume_30d,string"` + BestBid float64 `json:"best_bid,string"` + BestAsk float64 `json:"best_ask,string"` + Side string `json:"side"` + Time time.Time `json:"time,string"` + TradeID int64 `json:"trade_id"` + LastSize float64 `json:"last_size,string"` } // WebsocketOrderbookSnapshot defines a snapshot response diff --git a/exchanges/coinbasepro/coinbasepro_websocket.go b/exchanges/coinbasepro/coinbasepro_websocket.go index 10f79b70..32874a08 100644 --- a/exchanges/coinbasepro/coinbasepro_websocket.go +++ b/exchanges/coinbasepro/coinbasepro_websocket.go @@ -155,14 +155,15 @@ func (c *CoinbasePro) WsHandleData() { } c.Websocket.DataHandler <- exchange.TickerData{ - Timestamp: time.Now(), - Pair: currency.NewPairFromString(ticker.ProductID), - AssetType: "SPOT", - Exchange: c.GetName(), - OpenPrice: ticker.Price, - HighPrice: ticker.High24H, - LowPrice: ticker.Low24H, - Quantity: ticker.Volume24H, + Timestamp: ticker.Time, + Pair: currency.NewPairFromString(ticker.ProductID), + AssetType: "SPOT", + Exchange: c.GetName(), + OpenPrice: ticker.Open24H, + HighPrice: ticker.High24H, + LowPrice: ticker.Low24H, + ClosePrice: ticker.Price, + Quantity: ticker.Volume24H, } case "snapshot":